11apply plugin : ' maven'
22apply plugin : ' signing'
33
4- def groupId = " io.ably"
5- def artifactId = " ably-android"
6- def localReleaseDest = " ${ buildDir} /release/${ version} "
7- def mavenUser = hasProperty(' ossrhUsername' ) ? ossrhUsername : ' '
8- def mavenPassword = hasProperty(' ossrhPassword' ) ? ossrhPassword : ' '
4+ final String GROUP_ID = ' io.ably'
5+ final String ARTIFACT_ID = ' ably-android'
6+ final String LOCAL_RELEASE_DESTINATION = " ${ buildDir} /release/${ version} "
7+ final String MAVEN_USER = hasProperty(' ossrhUsername' ) ? ossrhUsername : ' '
8+ final String MAVEN_PASSWORD = hasProperty(' ossrhPassword' ) ? ossrhPassword : ' '
99
1010/*
1111 * Task which signs and uploads the Android artifacts to Nexus OSSRH.
@@ -15,19 +15,19 @@ uploadArchives {
1515 sign configurations. archives
1616 }
1717 repositories. mavenDeployer {
18- logger. lifecycle(' OSSRH auth with username: ' + mavenUser )
18+ logger. lifecycle(' OSSRH auth with username: ' + MAVEN_USER )
1919
2020 beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
2121
22- repository(url : " https://oss.sonatype.org/service/local/staging/deploy/maven2/" ) {
23- authentication(userName : mavenUser , password : mavenPassword )
22+ repository(url : ' https://oss.sonatype.org/service/local/staging/deploy/maven2/' ) {
23+ authentication(userName : MAVEN_USER , password : MAVEN_PASSWORD )
2424 }
2525
26- snapshotRepository(url : " https://oss.sonatype.org/content/repositories/snapshots/" ) {
27- authentication(userName : mavenUser , password : mavenPassword )
26+ snapshotRepository(url : ' https://oss.sonatype.org/content/repositories/snapshots/' ) {
27+ authentication(userName : MAVEN_USER , password : MAVEN_PASSWORD )
2828 }
29- pom. groupId = groupId
30- pom. artifactId = artifactId
29+ pom. groupId = GROUP_ID
30+ pom. artifactId = ARTIFACT_ID
3131 pom. version = version
3232
3333 // Add other pom properties here if you want (developer details / licenses)
@@ -70,7 +70,7 @@ uploadArchives {
7070 pom. whenConfigured { p ->
7171 p. dependencies = p. dependencies. findAll {
7272 // Exclude dependency on lib subproject.
73- dep -> dep. artifactId != " lib"
73+ dep -> dep. artifactId != ' lib'
7474 }. findAll {
7575 // Exclude Google services since we don't want to impose a particular
7676 // version on users. Ideally we would specify a version range,
@@ -89,21 +89,21 @@ uploadArchives {
8989 // Export files to local storage
9090 // COMMENT OUT THIS LINE AND THE ONE ABOVE IN ORDER TO RELEASE TO SONATYPE NEXUS STAGING
9191 // TODO https://github.com/ably/ably-java/issues/566
92- repository(url : " file://${ localReleaseDest } " )
92+ repository(url : " file://${ LOCAL_RELEASE_DESTINATION } " )
9393 }
9494}
9595
9696task zipRelease (type : Zip ) {
97- from localReleaseDest
97+ from LOCAL_RELEASE_DESTINATION
9898 destinationDir buildDir
9999 archiveName " release-${ version} .zip"
100100}
101101
102102tasks. whenTaskAdded { task ->
103103 if (task. name == ' assembleRelease' ) {
104104 task. doLast {
105- logger. quiet(" Release ${ version} can be found at ${ localReleaseDest } /" );
106- logger. quiet(" Release ${ version} zipped can be found ${ buildDir} /release-${ version} .zip" );
105+ logger. quiet(" Release ${ version} can be found at ${ LOCAL_RELEASE_DESTINATION } /" )
106+ logger. quiet(" Release ${ version} zipped can be found ${ buildDir} /release-${ version} .zip" )
107107 }
108108
109109 task. dependsOn(uploadArchives)
@@ -118,7 +118,7 @@ task sourcesJar(type: Jar) {
118118
119119task javadoc (type : Javadoc ) {
120120 source = android. sourceSets. main. java. srcDirs
121- classpath + = project. files(android. getBootClasspath() . join(File . pathSeparator))
121+ classpath + = project. files(android. bootClasspath . join(File . pathSeparator))
122122 failOnError false
123123}
124124
0 commit comments