Skip to content

Commit e779f0d

Browse files
author
Quintin Willison
committed
Add the naming ruleset to our use of CodeNarc, fixing violations.
1 parent 9dbd9a3 commit e779f0d

3 files changed

Lines changed: 27 additions & 26 deletions

File tree

android/maven.gradle

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apply plugin: 'maven'
22
apply plugin: 'signing'
33

4-
final String groupId = 'io.ably'
5-
final String artifactId = 'ably-android'
6-
final String localReleaseDest = "${buildDir}/release/${version}"
7-
final String mavenUser = hasProperty('ossrhUsername') ? ossrhUsername : ''
8-
final String 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

2222
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
23-
authentication(userName: mavenUser, password: mavenPassword)
23+
authentication(userName: MAVEN_USER, password: MAVEN_PASSWORD)
2424
}
2525

2626
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
27-
authentication(userName: mavenUser, password: mavenPassword)
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)
@@ -89,20 +89,20 @@ 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

9696
task zipRelease(type: Zip) {
97-
from localReleaseDest
97+
from LOCAL_RELEASE_DESTINATION
9898
destinationDir buildDir
9999
archiveName "release-${version}.zip"
100100
}
101101

102102
tasks.whenTaskAdded { task ->
103103
if (task.name == 'assembleRelease') {
104104
task.doLast {
105-
logger.quiet("Release ${version} can be found at ${localReleaseDest}/")
105+
logger.quiet("Release ${version} can be found at ${LOCAL_RELEASE_DESTINATION}/")
106106
logger.quiet("Release ${version} zipped can be found ${buildDir}/release-${version}.zip")
107107
}
108108

gradle-lint/src/main/groovy/build-script-rules.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ruleset {
1515
}
1616

1717
ruleset 'rulesets/groovyism.xml'
18+
ruleset 'rulesets/naming.xml'
1819
ruleset 'rulesets/unnecessary.xml'
1920
ruleset 'rulesets/unused.xml'
2021
}

java/maven.gradle

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ apply plugin: 'java'
22
apply plugin: 'maven'
33
apply plugin: 'signing'
44

5-
final String groupId = 'io.ably'
6-
final String artifactId = 'ably-java'
7-
final String localReleaseDest = "${buildDir}/release/${version}"
8-
final String mavenUser = hasProperty('ossrhUsername') ? ossrhUsername : ''
9-
final String mavenPassword = hasProperty('ossrhPassword') ? ossrhPassword : ''
5+
final String GROUP_ID = 'io.ably'
6+
final String ARTIFACT_ID = 'ably-java'
7+
final String LOCAL_RELEASE_DESTINATION = "${buildDir}/release/${version}"
8+
final String MAVEN_USER = hasProperty('ossrhUsername') ? ossrhUsername : ''
9+
final String MAVEN_PASSWORD = hasProperty('ossrhPassword') ? ossrhPassword : ''
1010

1111
/*
1212
* Task which signs and uploads the Java artifacts to Nexus OSSRH.
@@ -16,20 +16,20 @@ uploadArchives {
1616
sign configurations.archives
1717
}
1818
repositories.mavenDeployer {
19-
logger.lifecycle('OSSRH auth with username: ' + mavenUser)
19+
logger.lifecycle('OSSRH auth with username: ' + MAVEN_USER)
2020

2121
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
2222

2323
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
24-
authentication(userName: mavenUser, password: mavenPassword)
24+
authentication(userName: MAVEN_USER, password: MAVEN_PASSWORD)
2525
}
2626

2727
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
28-
authentication(userName: mavenUser, password: mavenPassword)
28+
authentication(userName: MAVEN_USER, password: MAVEN_PASSWORD)
2929
}
3030

31-
pom.groupId = groupId
32-
pom.artifactId = artifactId
31+
pom.groupId = GROUP_ID
32+
pom.artifactId = ARTIFACT_ID
3333
pom.version = version
3434

3535
// Add other pom properties here if you want (developer details / licenses)
@@ -79,19 +79,19 @@ uploadArchives {
7979
// Export files to local storage
8080
// COMMENT OUT THIS LINE IN ORDER TO RELEASE TO SONATYPE NEXUS STAGING
8181
// TODO https://github.com/ably/ably-java/issues/566
82-
repository(url: "file://${localReleaseDest}")
82+
repository(url: "file://${LOCAL_RELEASE_DESTINATION}")
8383
}
8484
}
8585

8686
task zipRelease(type: Zip) {
87-
from localReleaseDest
87+
from LOCAL_RELEASE_DESTINATION
8888
destinationDir buildDir
8989
archiveName "release-${version}.zip"
9090
}
9191

9292
task assembleRelease {
9393
doLast {
94-
logger.quiet("Release ${version} can be found at ${localReleaseDest}")
94+
logger.quiet("Release ${version} can be found at ${LOCAL_RELEASE_DESTINATION}")
9595
logger.quiet("Release ${version} zipped can be found ${buildDir}/release-${version}.zip")
9696
}
9797
dependsOn(uploadArchives)

0 commit comments

Comments
 (0)