From acb225065ce5d2a3c42e6257e51c13b1aff5f101 Mon Sep 17 00:00:00 2001 From: satorufujiwara Date: Wed, 2 Aug 2017 19:20:54 +0900 Subject: [PATCH] Add bintray publish --- binder-rx/android-artifacts.gradle | 25 ++++++++++++ binder-rx/bintray-publish.gradle | 64 ++++++++++++++++++++++++++++++ binder-rx/build.gradle | 3 ++ binder/bintray-publish.gradle | 6 +-- gradle.properties | 3 +- 5 files changed, 96 insertions(+), 5 deletions(-) create mode 100644 binder-rx/android-artifacts.gradle create mode 100755 binder-rx/bintray-publish.gradle diff --git a/binder-rx/android-artifacts.gradle b/binder-rx/android-artifacts.gradle new file mode 100644 index 0000000..bc64f23 --- /dev/null +++ b/binder-rx/android-artifacts.gradle @@ -0,0 +1,25 @@ +task androidJavadocs(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar" + classpath += files(ext.androidJar) +} + +task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { + classifier = 'javadoc' + from androidJavadocs.destinationDir +} + +task androidSourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.sourceFiles +} + +task androidJar(type: Jar) { + from 'build/intermediates/classes/release' +} + +artifacts { + archives androidSourcesJar + archives androidJavadocsJar + archives androidJar +} \ No newline at end of file diff --git a/binder-rx/bintray-publish.gradle b/binder-rx/bintray-publish.gradle new file mode 100755 index 0000000..dbf592e --- /dev/null +++ b/binder-rx/bintray-publish.gradle @@ -0,0 +1,64 @@ +apply plugin: 'maven-publish' +apply plugin: 'com.jfrog.bintray' + +publishing { + publications { + mavenJava(MavenPublication) { + groupId GROUP + version VERSION_NAME + artifactId 'recyclerview-binder-rx' +// artifact "build/outputs/aar/binder-release.aar" + artifact androidJar + artifact androidJavadocsJar + artifact androidSourcesJar + pom.withXml { + Node root = asNode() + root.appendNode('name', 'recyclerview-binder-rx') + root.appendNode('description', POM_DESCRIPTION) + root.appendNode('url', POM_URL) + + def issues = root.appendNode('issueManagement') + issues.appendNode('system', 'github') + issues.appendNode('url', ISSUE_URL) + + def scm = root.appendNode('scm') + scm.appendNode('url', POM_SCM_URL) + scm.appendNode('connection', POM_SCM_CONNECTION) + scm.appendNode('developerConnection', POM_SCM_DEV_CONNECTION) + + def license = root.appendNode('licenses').appendNode('license') + license.appendNode('name', POM_LICENCE_NAME) + license.appendNode('url', POM_LICENCE_URL) + license.appendNode('distribution', POM_LICENCE_DIST) + } + } + } +} + +def getBintrayUserProperty() { + return hasProperty('bintrayUser') ? bintrayUser : "" +} + +def getBintrayApiKeyProperty() { + return hasProperty('bintrayApiKey') ? bintrayApiKey : "" +} + +bintray { + user = bintrayUserProperty + key = bintrayApiKeyProperty + publications = ['mavenJava'] + + dryRun = false + publish = false + pkg { + repo = 'maven' + name = 'recyclerview-binder-rx' + licenses = ['Apache-2.0'] + labels = ['android'] + + version { + name = VERSION_NAME + vcsTag = VERSION_NAME + } + } +} diff --git a/binder-rx/build.gradle b/binder-rx/build.gradle index 86e4650..c730b93 100644 --- a/binder-rx/build.gradle +++ b/binder-rx/build.gradle @@ -22,3 +22,6 @@ dependencies { compile project(':binder') compile "io.reactivex.rxjava2:rxjava:$RX_JAVA_VERSION" } + +apply from: 'android-artifacts.gradle' +apply from: 'bintray-publish.gradle' diff --git a/binder/bintray-publish.gradle b/binder/bintray-publish.gradle index 4ad5797..2cc7290 100755 --- a/binder/bintray-publish.gradle +++ b/binder/bintray-publish.gradle @@ -6,14 +6,14 @@ publishing { mavenJava(MavenPublication) { groupId GROUP version VERSION_NAME - artifactId ARTIFACT_ID + artifactId 'recyclerview-binder' // artifact "build/outputs/aar/binder-release.aar" artifact androidJar artifact androidJavadocsJar artifact androidSourcesJar pom.withXml { Node root = asNode() - root.appendNode('name', ARTIFACT_ID) + root.appendNode('name', 'recyclerview-binder') root.appendNode('description', POM_DESCRIPTION) root.appendNode('url', POM_URL) @@ -52,7 +52,7 @@ bintray { publish = false pkg { repo = 'maven' - name = ARTIFACT_ID + name = 'recyclerview-binder' licenses = ['Apache-2.0'] labels = ['android'] diff --git a/gradle.properties b/gradle.properties index 24f0069..cf87a23 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,10 +6,9 @@ TARGET_SDK_VERSION=23 SUPPORT_APP_COMPAT_VERSION=25.3.1 RX_JAVA_VERSION=2.1.2 -VERSION_NAME=1.3.3 +VERSION_NAME=2.0.0 VERSION_CODE=3 GROUP=jp.satorufujiwara -ARTIFACT_ID=recyclerview-binder POM_DESCRIPTION=Android Library for RecyclerView to manage order of items and multiple view types. POM_URL=https://github.com/satorufujiwara/recyclerview-binder