From 8b2c1d1159acd206119020ea30eb56ddb2c85e96 Mon Sep 17 00:00:00 2001 From: Maxime Biais Date: Tue, 6 Sep 2016 11:30:10 +0200 Subject: [PATCH 1/5] Update gradle wrapper --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 26af108ccec2..5e7158a61136 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Jul 09 11:48:51 CEST 2014 +#Tue Sep 06 11:08:13 CEST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip From 65eff6d362af0ab57fd34d759393b9e8c0a4d9e2 Mon Sep 17 00:00:00 2001 From: Maxime Biais Date: Tue, 6 Sep 2016 11:30:52 +0200 Subject: [PATCH 2/5] remove unused gradle config --- WordPressUtils/build.gradle | 43 ------------------------------------- 1 file changed, 43 deletions(-) diff --git a/WordPressUtils/build.gradle b/WordPressUtils/build.gradle index e881111de401..fd0fb43c9df7 100644 --- a/WordPressUtils/build.gradle +++ b/WordPressUtils/build.gradle @@ -49,51 +49,8 @@ signing { sign configurations.archives } -uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: project.properties.ossrhUsername, password: project.properties.ossrhPassword) - } - - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: project.properties.ossrhUsername, password: project.properties.ossrhPassword) - } - - pom.project { - name 'WordPress-Utils-Android' - packaging 'aar' - description 'Utils lib for WordPress-Android' - url 'https://github.com/wordpress-mobile/WordPress-Utils-Android' - scm { - connection 'scm:git:https://github.com/wordpress-mobile/WordPress-Utils-Android.git' - developerConnection 'scm:git:https://github.com/wordpress-mobile/WordPress-Utils-Android.git' - url 'https://github.com/wordpress-mobile/WordPress-Utils-Android' - } - - licenses { - license { - name 'The MIT License (MIT)' - url 'http://opensource.org/licenses/MIT' - } - } - - developers { - developer { - id 'maxme' - name 'Maxime Biais' - email 'maxime@automattic.com' - } - } - } - } - } -} android.libraryVariants.all { variant -> - task("generate${variant.name}Javadoc", type: Javadoc) { description "Generates Javadoc for $variant.name." source = variant.javaCompile.source From 0c548287e64f987c468b28a91f8ba0bf200adaa1 Mon Sep 17 00:00:00 2001 From: Maxime Biais Date: Tue, 6 Sep 2016 11:47:55 +0200 Subject: [PATCH 3/5] Update the README with bintray infos --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5bfc36560535..e18da3d9265a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,27 @@ # WordPress-Utils-Android -Part of the [WordPress-Android] project. +Collection of utility methods for Android and WordPress. -[WordPress-Android]: https://github.com/wordpress-mobile/WordPress-Android +## Use the library + +* In your build.gradle: +```groovy +dependencies { + // use the latest 1.x version + compile 'org.wordpress:utils:1.+' +} +``` + +## Publish it to bintray + +```shell +$ ./gradlew assemble publishToMavenLocal bintrayUpload -PbintrayUser=FIXME -PbintrayKey=FIXME -PdryRun=false +``` + +## Apps that use this library +- [WordPress for Android][1] + +## License +Dual licensed under MIT, and GPL. + +[1]: https://github.com/wordpress-mobile/WordPress-Android From 2573319b80a894ca2d499a26693ff35892218a96 Mon Sep 17 00:00:00 2001 From: Maxime Biais Date: Tue, 6 Sep 2016 11:48:28 +0200 Subject: [PATCH 4/5] Use bintray plugin to publish the maven artifact --- WordPressUtils/build.gradle | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/WordPressUtils/build.gradle b/WordPressUtils/build.gradle index fd0fb43c9df7..88be314b733d 100644 --- a/WordPressUtils/build.gradle +++ b/WordPressUtils/build.gradle @@ -4,12 +4,12 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:2.1.2' + classpath 'com.novoda:bintray-release:0.3.4' } } apply plugin: 'com.android.library' -apply plugin: 'maven' -apply plugin: 'signing' +apply plugin: 'com.novoda.bintray-release' repositories { jcenter() @@ -32,24 +32,12 @@ android { buildToolsVersion "23.0.3" defaultConfig { - versionName "1.11.0" + versionName "1.12.0" minSdkVersion 14 targetSdkVersion 23 } } -version android.defaultConfig.versionName -group = "org.wordpress" -archivesBaseName = "utils" - -signing { - required { - has("release") && project.properties.containsKey("signing.keyId") && project.properties.containsKey("signing.secretKeyRingFile") - } - sign configurations.archives -} - - android.libraryVariants.all { variant -> task("generate${variant.name}Javadoc", type: Javadoc) { description "Generates Javadoc for $variant.name." @@ -62,3 +50,16 @@ android.libraryVariants.all { variant -> exclude '**/R.java' } } + +publish { + artifactId = 'utils' + userOrg = 'wordpress-mobile' + groupId = 'org.wordpress' + uploadName = 'utils' + description = 'Utils library for Android' + publishVersion = android.defaultConfig.versionName + licences = ['MIT', 'GPL'] + website = 'https://github.com/wordpress-mobile/WordPress-Utils-Android/' + dryRun = 'false' + autoPublish = 'true' +} From c2f2939b6f584d05c61c93a9aa84322c942f3d8c Mon Sep 17 00:00:00 2001 From: Maxime Biais Date: Tue, 6 Sep 2016 11:49:08 +0200 Subject: [PATCH 5/5] fix minor JavaDocs issue that was breaking the build --- .../src/main/java/org/wordpress/android/util/StringUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WordPressUtils/src/main/java/org/wordpress/android/util/StringUtils.java b/WordPressUtils/src/main/java/org/wordpress/android/util/StringUtils.java index c398ee079cb9..b15e8d824fa1 100644 --- a/WordPressUtils/src/main/java/org/wordpress/android/util/StringUtils.java +++ b/WordPressUtils/src/main/java/org/wordpress/android/util/StringUtils.java @@ -225,10 +225,10 @@ public static String replaceUnicodeSurrogateBlocksWithHTMLEntities(final String * Used to convert a language code ([lc]_[rc] where lc is language code (en, fr, es, etc...) * and rc is region code (zh-CN, zh-HK, zh-TW, etc...) to a displayable string with the languages * name. - *

+ * * The input string must be between 2 and 6 characters, inclusive. An empty string is returned * if that is not the case. - *

+ * * If the input string is recognized by {@link Locale} the result of this method is the given * * @return non-null