Skip to content

Commit

Permalink
Publish connect api as a separate artifact (#183)
Browse files Browse the repository at this point in the history
* Publish connect api as a separate artifact

* Add maven dependency for connect api
  • Loading branch information
priyaashah authored Jul 16, 2020
1 parent 17c1431 commit 68674f1
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 6 deletions.
5 changes: 3 additions & 2 deletions connect-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {

defaultConfig {
minSdkVersion rootProject.minSdkVersion
versionCode 1
versionName "1.0"
versionCode 6
versionName "$libVersion"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -43,3 +43,4 @@ dependencies {
testImplementation 'com.squareup.okhttp3:mockwebserver:4.4.0'
testImplementation "com.squareup.retrofit2:retrofit-mock:$retrofitVersion"
}
apply from: 'publish.gradle'
122 changes: 122 additions & 0 deletions connect-api/publish.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'

ext {
bintrayRepo = 'Maven'
bintrayName = 'ConnectSDK-Android'

publishedGroupId = 'com.ifttt'
libraryName = 'connect-api'
artifact = 'connect-api'

libraryDescription =
'Connect Api is a library that helps facilitate network calls and data for the Connect Button SDK. It is not meant to be used as a stand-alone library'

siteUrl = 'https://github.com/IFTTT/ConnectSDK-Android'
gitUrl = 'https://github.com/IFTTT/ConnectSDK-Android.git'

libraryVersion = "$libVersion"

developerId = 'lzanita09'
developerName = 'Zhe Lu'
developerEmail = '[email protected]'

licenseName = 'MIT'
licenseUrl = 'https://github.com/IFTTT/ConnectSDK-Android/blob/master/LICENSE'
allLicenses = ['MIT']
}

group = publishedGroupId

install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
groupId publishedGroupId
artifactId artifact

name libraryName
description libraryDescription
url siteUrl

licenses {
license {
name licenseName
url licenseUrl
}
}
developers {
developer {
id developerId
name developerName
email developerEmail
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}

version = libraryVersion

task sourcesJar(type: Jar) {
archiveClassifier.set("sources")
from android.sourceSets.main.java.srcDirs
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

afterEvaluate {
javadoc.classpath +=
files(android.libraryVariants.collect { variant -> variant.javaCompileProvider.get().classpath.files
})
}

task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set("javadoc")
from javadoc.destinationDir
}

artifacts {
archives javadocJar
archives sourcesJar
}

if (project.hasProperty('bintrayUser') && project.hasProperty('bintrayKey') &&
project.hasProperty('bintrayGpgPassphrase')) {
bintray.user = project.bintrayUser
bintray.key = project.bintrayKey
bintray.pkg.version.gpg.passphrase = project.bintrayGpgPassphrase
}

bintray {
configurations = ['archives']
pkg {
repo = bintrayRepo
name = bintrayName
desc = libraryDescription
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = allLicenses
publish = false
version {
name = libraryVersion
desc = libraryDescription
released = new Date()
vcsTag = libraryVersion
gpg {
sign = true
}
}
}
}
1 change: 1 addition & 0 deletions connect-button/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ android {

dependencies {
api project(':connect-api')
releaseApi "com.ifttt:connect-api:$libVersion"

implementation 'androidx.browser:browser:1.2.0'
implementation "androidx.work:work-runtime:$workManagerVersion"
Expand Down
4 changes: 0 additions & 4 deletions connect-button/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ task sourcesJar(type: Jar) {
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))

options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}

afterEvaluate {
Expand Down

0 comments on commit 68674f1

Please sign in to comment.