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 diff --git a/WordPressUtils/build.gradle b/WordPressUtils/build.gradle index e881111de401..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,68 +32,13 @@ 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 -} - -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 @@ -105,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' +} 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 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