Skip to content

Commit 4b6f980

Browse files
committed
Try to wire signing into publishing.
1 parent db1484c commit 4b6f980

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

src/AndroidClient/android/build.gradle

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@ if (project.hasProperty('versionSuffix')) {
1111
version = "${version}-${versionSuffix}"
1212
}
1313

14-
if (project.hasProperty('signing.keyId')) {
15-
println "Signing enabled"
16-
signing {
17-
sign publishing.publications.mavenJava
18-
}
19-
} else {
20-
println "Signing disabled"
21-
}
22-
2314
// Specify dependencies
2415
dependencies {
2516
implementation 'com.google.code.gson:gson:2.8.9'
@@ -59,6 +50,11 @@ android {
5950
}
6051
}
6152

53+
java {
54+
withJavadocJar()
55+
withSourcesJar()
56+
}
57+
6258
// Configure the publishing block for Maven Central deployment
6359
publishing {
6460
publications {
@@ -122,4 +118,14 @@ publishing {
122118
}
123119
}
124120
}
121+
}
122+
123+
124+
if (project.hasProperty('signing.keyId')) {
125+
println "Signing enabled"
126+
signing {
127+
sign publishing.publications.mavenJava
128+
}
129+
} else {
130+
println "Signing disabled"
125131
}

src/AndroidClient/client/build.gradle

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@ if (project.hasProperty('versionSuffix')) {
1111
version = "${version}-${versionSuffix}"
1212
}
1313

14-
if (project.hasProperty('signing.keyId')) {
15-
println "Signing enabled"
16-
signing {
17-
sign publishing.publications.mavenJava
18-
}
19-
} else {
20-
println "Signing disabled"
21-
}
22-
2314
// Specify dependencies
2415
dependencies {
2516
implementation 'com.google.code.gson:gson:2.8.9'
@@ -28,14 +19,9 @@ dependencies {
2819
}
2920

3021
// Additional tasks for generating source and Javadoc JARs
31-
task sourcesJar(type: Jar) {
32-
from sourceSets.main.allJava
33-
archiveClassifier.set('sources')
34-
}
35-
36-
task javadocJar(type: Jar, dependsOn: javadoc) {
37-
from javadoc.destinationDir
38-
archiveClassifier.set('javadoc')
22+
java {
23+
withJavadocJar()
24+
withSourcesJar()
3925
}
4026

4127
// Configure the publishing block for Maven Central deployment
@@ -104,6 +90,16 @@ publishing {
10490
}
10591
}
10692

93+
if (project.hasProperty('signing.keyId')) {
94+
println "Signing enabled"
95+
signing {
96+
sign publishing.publications.mavenJava
97+
}
98+
} else {
99+
println "Signing disabled"
100+
}
101+
102+
107103
java {
108104
sourceCompatibility = JavaVersion.VERSION_1_8
109105
targetCompatibility = JavaVersion.VERSION_1_8

0 commit comments

Comments
 (0)