From 7f4343ab082d61128b94fecb1eabe8b9f44422e2 Mon Sep 17 00:00:00 2001 From: Paul-Marie Tetedoie Date: Fri, 8 Jun 2018 13:11:42 -0700 Subject: [PATCH 1/4] update bintray conf --- WebServiceManager/build.gradle | 66 +--------------------- WebServiceManager/publish.gradle | 94 ++++++++++++++++++++++++++++++++ build.gradle | 8 +-- gradle.properties | 4 +- 4 files changed, 100 insertions(+), 72 deletions(-) create mode 100644 WebServiceManager/publish.gradle diff --git a/WebServiceManager/build.gradle b/WebServiceManager/build.gradle index 767a097..397f027 100644 --- a/WebServiceManager/build.gradle +++ b/WebServiceManager/build.gradle @@ -1,6 +1,4 @@ apply plugin: 'com.android.library' -apply plugin: 'com.jfrog.bintray' -apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion 27 @@ -10,7 +8,7 @@ android { minSdkVersion 8 targetSdkVersion 27 versionCode 1 - versionName "1.0" + versionName "1.0.3" } buildTypes { release { @@ -27,64 +25,4 @@ dependencies { implementation 'com.raizlabs:CoreUtils:1.1.7' } -//Generate POM files needed to publish the artifacts to JCenter public Repo -install { - repositories.mavenInstaller.pom.project { - packaging 'aar' - groupId GROUP_NAME - artifactId ARTIFACT_NAME - - // Set your license - licenses { - license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - } - } - - scm { - connection GIT_URL - developerConnection GIT_URL - url SITE_URL - } - } -} - -task androidJavadocs(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) -} - -task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { - classifier = 'javadoc' - from androidJavadocs.destinationDir -} - -task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs -} - -artifacts { - archives androidSourcesJar - archives androidJavadocsJar -} - -//Bintray Upload -Properties properties = new Properties() -properties.load(project.rootProject.file('local.properties').newDataInputStream()) - -bintray { - user = properties.getProperty("bintray_user") - key = properties.getProperty("bintray_key") - - configurations = ['archives'] - - pkg { - repo = 'Libraries' - name = ARTIFACT_NAME - userOrg = 'raizlabs' - publish = true - version.name = VERSION_NAME - } -} \ No newline at end of file +apply from: 'publish.gradle' \ No newline at end of file diff --git a/WebServiceManager/publish.gradle b/WebServiceManager/publish.gradle new file mode 100644 index 0000000..c727519 --- /dev/null +++ b/WebServiceManager/publish.gradle @@ -0,0 +1,94 @@ +apply plugin: 'maven-publish' +apply plugin: 'com.jfrog.bintray' + +version VERSION_NAME +group GROUP_NAME + +publishing { + publications { + Production(MavenPublication) { + artifact("$buildDir/outputs/aar/WebServiceManager-release.aar") + groupId GROUP_NAME + artifactId ARTIFACT_NAME + version this.version + + pom.withXml { + def dependenciesNode = asNode().appendNode('dependencies') + + // Iterate over the implementation dependencies (we don't want the test ones), adding a node for each + configurations.implementation.allDependencies.each { + // Ensure dependencies such as fileTree are not included in the pom. + if (it.name != 'unspecified') { + def dependencyNode = dependenciesNode.appendNode('dependency') + dependencyNode.appendNode('groupId', it.group) + dependencyNode.appendNode('artifactId', it.name) + dependencyNode.appendNode('version', it.version) + } + } + + project { + licenses { + license { + name 'The Apache Software License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + + scm { + connection GIT_URL + developerConnection GIT_URL + url SITE_URL + } + } + } + } + } +} + +task androidJavadocs(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) +} + +task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { + classifier = 'javadoc' + from androidJavadocs.destinationDir +} + +task androidSourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.srcDirs +} + +artifacts { + archives androidSourcesJar + archives androidJavadocsJar +} + +Properties properties = new Properties() +properties.load(project.rootProject.file('bintray.properties').newDataInputStream()) + +bintray { + user = properties.getProperty('bintrayUser') + key = properties.getProperty('bintrayApiKey') + publications = ['Production'] + configurations = ['archives'] + override = true + pkg { + repo = REPO + name = ARTIFACT_NAME + userOrg = 'raizlabs' + publish = true + description = DESCRIPTION + publicDownloadNumbers = true + licenses = ['The Apache Software License, Version 2.0', 'http://www.apache.org/licenses/LICENSE-2.0.txt'] + vcsUrl = GIT_URL + dryRun = true + version { + name = this.version + desc = "WebServiceManager ${this.version}" + released = new Date() + vcsTag = this.version + } + } +} diff --git a/build.gradle b/build.gradle index 276ab83..4288d90 100644 --- a/build.gradle +++ b/build.gradle @@ -3,18 +3,12 @@ buildscript { repositories { jcenter() - maven { - url 'https://maven.google.com/' - name 'Google' - } + google() } dependencies { classpath 'com.android.tools.build:gradle:3.1.2' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files } } diff --git a/gradle.properties b/gradle.properties index 3e87d95..a4d00cc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,4 +2,6 @@ VERSION_NAME=1.0.3 ARTIFACT_NAME = WebServiceManager GROUP_NAME = com.raizlabs GIT_URL = https://github.com/Raizlabs/AndroidWebServiceManager.git -SITE_URL = https://github.com/Raizlabs/AndroidWebServiceManager \ No newline at end of file +SITE_URL = https://github.com/Raizlabs/AndroidWebServiceManager +REPO = Libraries +DESCRIPTION = An efficient http client wrapper library that handles all the multi-threaded web requests and responses asynchronously. \ No newline at end of file From 1ca64a207244a1f2932dd01d39296fde08c62a5b Mon Sep 17 00:00:00 2001 From: Paul-Marie Tetedoie Date: Fri, 8 Jun 2018 13:31:42 -0700 Subject: [PATCH 2/4] change properties files to store credential add alternatively environement variable --- WebServiceManager/publish.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WebServiceManager/publish.gradle b/WebServiceManager/publish.gradle index c727519..1f93bd7 100644 --- a/WebServiceManager/publish.gradle +++ b/WebServiceManager/publish.gradle @@ -66,11 +66,11 @@ artifacts { } Properties properties = new Properties() -properties.load(project.rootProject.file('bintray.properties').newDataInputStream()) +properties.load(project.rootProject.file('local.properties').newDataInputStream()) bintray { - user = properties.getProperty('bintrayUser') - key = properties.getProperty('bintrayApiKey') + user = properties.hasProperty('bintrayUser') ? properties.getProperty('bintrayUser') : System.getenv('BINTRAY_USER') + key = properties.hasProperty('bintrayApiKey') ? properties.getProperty('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') publications = ['Production'] configurations = ['archives'] override = true From 5ff9d917d7d6c57dbf2330b4cee530fa1341d3c2 Mon Sep 17 00:00:00 2001 From: Paul-Marie Tetedoie Date: Fri, 8 Jun 2018 13:59:01 -0700 Subject: [PATCH 3/4] clean-up --- WebServiceManager/publish.gradle | 38 +------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/WebServiceManager/publish.gradle b/WebServiceManager/publish.gradle index 1f93bd7..f60fd3b 100644 --- a/WebServiceManager/publish.gradle +++ b/WebServiceManager/publish.gradle @@ -14,10 +14,9 @@ publishing { pom.withXml { def dependenciesNode = asNode().appendNode('dependencies') - // Iterate over the implementation dependencies (we don't want the test ones), adding a node for each configurations.implementation.allDependencies.each { - // Ensure dependencies such as fileTree are not included in the pom. + // Ensure dependencies such as fileTree are not included. if (it.name != 'unspecified') { def dependencyNode = dependenciesNode.appendNode('dependency') dependencyNode.appendNode('groupId', it.group) @@ -25,46 +24,11 @@ publishing { dependencyNode.appendNode('version', it.version) } } - - project { - licenses { - license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - } - } - - scm { - connection GIT_URL - developerConnection GIT_URL - url SITE_URL - } - } } } } } -task androidJavadocs(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) -} - -task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { - classifier = 'javadoc' - from androidJavadocs.destinationDir -} - -task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs -} - -artifacts { - archives androidSourcesJar - archives androidJavadocsJar -} - Properties properties = new Properties() properties.load(project.rootProject.file('local.properties').newDataInputStream()) From de39e4a08c5fd0a5f43ec77a1e55ab36a3e8334d Mon Sep 17 00:00:00 2001 From: Paul-Marie Tetedoie Date: Fri, 8 Jun 2018 14:05:11 -0700 Subject: [PATCH 4/4] clean-up --- WebServiceManager/publish.gradle | 2 +- gradle.properties | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WebServiceManager/publish.gradle b/WebServiceManager/publish.gradle index f60fd3b..4a7295c 100644 --- a/WebServiceManager/publish.gradle +++ b/WebServiceManager/publish.gradle @@ -41,7 +41,7 @@ bintray { pkg { repo = REPO name = ARTIFACT_NAME - userOrg = 'raizlabs' + userOrg = USER_ORG publish = true description = DESCRIPTION publicDownloadNumbers = true diff --git a/gradle.properties b/gradle.properties index a4d00cc..95d1846 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,5 +3,6 @@ ARTIFACT_NAME = WebServiceManager GROUP_NAME = com.raizlabs GIT_URL = https://github.com/Raizlabs/AndroidWebServiceManager.git SITE_URL = https://github.com/Raizlabs/AndroidWebServiceManager +DESCRIPTION = An efficient http client wrapper library that handles all the multi-threaded web requests and responses asynchronously. REPO = Libraries -DESCRIPTION = An efficient http client wrapper library that handles all the multi-threaded web requests and responses asynchronously. \ No newline at end of file +USER_ORG = raizlabs \ No newline at end of file