Skip to content

Commit f02379d

Browse files
committed
Updated to support publishing and signing.
1 parent c2debe4 commit f02379d

File tree

10 files changed

+179
-15
lines changed

10 files changed

+179
-15
lines changed

build.gradle

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ buildscript {
77

88
}
99

10+
1011
plugins {
1112
id "io.spring.nohttp" version "0.0.11"
1213
id "checkstyle"
1314
id "jacoco"
1415
id "net.ltgt.errorprone" version "3.1.0"
16+
id 'maven-publish'
1517
}
1618

1719
println("Environment setup:")
@@ -160,6 +162,7 @@ allprojects {
160162
}
161163
}
162164

165+
163166
}
164167

165168
task printProperties {
@@ -183,6 +186,7 @@ ext {
183186

184187
subprojects {
185188
apply plugin: 'eclipse'
189+
apply plugin: 'maven-publish'
186190

187191

188192
JavaVersion current = JavaVersion.current();
@@ -276,6 +280,30 @@ subprojects {
276280
languageVersion = JavaLanguageVersion.of(21)
277281
}
278282
}
283+
284+
publishing {
285+
repositories {
286+
maven {
287+
name "cwmaven"
288+
url System.getenv("CW_MAVEN_S3_URL")
289+
credentials(AwsCredentials) {
290+
accessKey System.getenv("AWS_KEY")
291+
secretKey System.getenv("AWS_SECRET")
292+
}
293+
}
294+
}
295+
}
296+
297+
298+
jar.doLast {
299+
if (System.getenv("SIGNJAR_CMD") != null) {
300+
exec {
301+
commandLine(System.getenv("SIGNJAR_CMD"), archiveFile.get())
302+
}
303+
}
304+
}
305+
306+
279307
}
280308

281309

core/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,14 @@ test {
1515
maxParallelForks = 8;
1616
}
1717

18+
publishing {
19+
publications {
20+
maven(MavenPublication) {
21+
groupId = 'org.bouncycastle'
22+
artifactId = "bccore-$vmrange"
23+
24+
from components.java
25+
26+
}
27+
}
28+
}

jmail/build.gradle

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ dependencies {
2727

2828
implementation group: 'jakarta.mail', name: 'jakarta.mail-api', version: '2.0.1'
2929
implementation group: 'jakarta.activation', name: 'jakarta.activation-api', version: '2.0.0'
30-
implementation project(path: ':core')
3130

3231
java9Implementation files(sourceSets.main.output.classesDirs) {
3332
builtBy compileJava
@@ -113,4 +112,19 @@ test {
113112
maxParallelForks = 8;
114113
}
115114

116-
compileJava9Java.dependsOn([":prov:jar", ":util:jar",":pkix:jar"])
115+
compileJava9Java.dependsOn([":prov:jar", ":util:jar",":pkix:jar"])
116+
117+
publishing {
118+
publications {
119+
maven(MavenPublication) {
120+
groupId = 'org.bouncycastle'
121+
artifactId = "bcjmail-$vmrange"
122+
from components.java
123+
124+
125+
artifact(javadocJar)
126+
artifact(sourcesJar)
127+
}
128+
129+
}
130+
}

mail/build.gradle

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ dependencies {
1818
implementation project(':pkix')
1919

2020
implementation group: 'javax.mail', name: 'mail', version: '1.4'
21-
implementation project(path: ':core')
2221

2322
java9Implementation files(sourceSets.main.output.classesDirs) {
2423
builtBy compileJava
@@ -92,4 +91,20 @@ test {
9291
maxParallelForks = 8;
9392
}
9493

95-
compileJava9Java.dependsOn([":prov:jar", ":util:jar",":pkix:jar"])
94+
compileJava9Java.dependsOn([":prov:jar", ":util:jar",":pkix:jar"])
95+
96+
publishing {
97+
publications {
98+
maven(MavenPublication) {
99+
groupId = 'org.bouncycastle'
100+
artifactId = "bcmail-$vmrange"
101+
from components.java
102+
103+
104+
artifact(javadocJar)
105+
artifact(sourcesJar)
106+
}
107+
108+
109+
}
110+
}

mls/build.gradle

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ sourceSets {
2929
}
3030

3131
dependencies {
32-
implementation project(':core')
3332
implementation project(':util')
3433
implementation project(':pkix')
3534
implementation project(':prov')
@@ -189,4 +188,20 @@ artifacts {
189188
archives sourcesJar
190189
}
191190

192-
compileJava9Java.dependsOn([":prov:jar", ":util:jar",":pkix:jar"])
191+
compileJava9Java.dependsOn([":prov:jar", ":util:jar",":pkix:jar"])
192+
193+
publishing {
194+
publications {
195+
maven(MavenPublication) {
196+
groupId = 'org.bouncycastle'
197+
artifactId = "bcmls-$vmrange"
198+
from components.java
199+
200+
201+
artifact(javadocJar)
202+
artifact(sourcesJar)
203+
}
204+
205+
206+
}
207+
}

pg/build.gradle

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ sourceSets {
1818

1919

2020
dependencies {
21-
implementation project(':core')
2221
implementation project(':prov')
2322
implementation project(':util')
2423

@@ -113,4 +112,20 @@ test {
113112
maxHeapSize = "3g";
114113
}
115114

116-
compileJava9Java.dependsOn([":prov:jar", ":util:jar"])
115+
compileJava9Java.dependsOn([":prov:jar", ":util:jar"])
116+
117+
publishing {
118+
publications {
119+
maven(MavenPublication) {
120+
groupId = 'org.bouncycastle'
121+
artifactId = "bcpg-$vmrange"
122+
from components.java
123+
124+
125+
artifact(javadocJar)
126+
artifact(sourcesJar)
127+
}
128+
129+
130+
}
131+
}

pkix/build.gradle

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ evaluationDependsOn(":prov")
1515
evaluationDependsOn(":util")
1616

1717
dependencies {
18-
implementation project(':core')
18+
1919
implementation project(':prov')
2020
implementation project(':util')
2121

@@ -99,4 +99,18 @@ test {
9999
maxParallelForks = 8;
100100
}
101101

102-
compileJava9Java.dependsOn([":prov:jar", ":util:jar"])
102+
compileJava9Java.dependsOn([":prov:jar", ":util:jar"])
103+
104+
publishing {
105+
publications {
106+
maven(MavenPublication) {
107+
groupId = 'org.bouncycastle'
108+
artifactId = "bcpkix-$vmrange"
109+
from components.java
110+
111+
artifact(javadocJar)
112+
artifact(sourcesJar)
113+
}
114+
115+
}
116+
}

prov/build.gradle

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,21 @@ compileTest21Java {
211211
options.sourcepath = files(['src/test/java', 'src/test/jdk21'])
212212
}
213213

214+
publishing {
215+
publications {
216+
maven(MavenPublication) {
217+
groupId = 'org.bouncycastle'
218+
artifactId = "bcprov-$vmrange"
219+
from components.java
220+
221+
artifact(javadocJar)
222+
artifact(sourcesJar)
223+
}
224+
225+
}
226+
}
227+
228+
214229
test {
215230
jvmArgs = ['-Dtest.java.version.prefix=1.8']
216231
dependsOn("test21")
@@ -360,3 +375,5 @@ task test21(type: Test) {
360375
}
361376
}
362377

378+
379+

tls/build.gradle

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ sourceSets {
4545
}
4646

4747
dependencies {
48-
implementation project(':core')
48+
4949
implementation project(':prov')
5050
implementation project(':util')
5151
implementation project(':pkix')
5252

53-
java9Implementation project(':core')
5453
java9Implementation project(':prov')
5554
java9Implementation project(':util')
5655
java9Implementation project(':pkix')
@@ -63,17 +62,14 @@ dependencies {
6362
test21Implementation group: 'junit', name: 'junit', version: '4.13.2'
6463

6564

66-
test11Implementation project(':core')
6765
test11Implementation project(':prov')
6866
test11Implementation project(':util')
6967
test11Implementation project(':pkix')
7068

71-
test15Implementation project(':core')
7269
test15Implementation project(':prov')
7370
test15Implementation project(':util')
7471
test15Implementation project(':pkix')
7572

76-
test21Implementation project(':core')
7773
test21Implementation project(':prov')
7874
test21Implementation project(':util')
7975
test21Implementation project(':pkix')
@@ -162,6 +158,21 @@ artifacts {
162158
archives sourcesJar
163159
}
164160

161+
publishing {
162+
publications {
163+
maven(MavenPublication) {
164+
groupId = 'org.bouncycastle'
165+
artifactId = "bctls-$vmrange"
166+
from components.java
167+
168+
artifact(javadocJar)
169+
artifact(sourcesJar)
170+
}
171+
172+
}
173+
}
174+
175+
165176
test {
166177
jvmArgs = ['-Dtest.java.version.prefix=1.8']
167178
dependsOn("test21")

util/build.gradle

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ jar {
6868
manifest.attributes('Bundle-Version': "${v}")
6969
}
7070

71+
jar.doLast {
72+
if (System.getenv("SIGNJAR_CMD") != null ) {
73+
exec {
74+
commandLine(System.getenv("SIGNJAR_CMD"),jar.archiveFile)
75+
}
76+
}
77+
}
78+
79+
7180

7281
task sourcesJar(type: Jar) {
7382
archiveBaseName = jar.archiveBaseName
@@ -91,6 +100,21 @@ artifacts {
91100
archives sourcesJar
92101
}
93102

103+
publishing {
104+
publications {
105+
maven(MavenPublication) {
106+
groupId = 'org.bouncycastle'
107+
artifactId = "butil-$vmrange"
108+
from components.java
109+
110+
artifact(javadocJar)
111+
artifact(sourcesJar)
112+
}
113+
114+
}
115+
}
116+
117+
94118
test {
95119
forkEvery = 1;
96120
maxParallelForks = 8;

0 commit comments

Comments
 (0)