Skip to content

Commit 20ab984

Browse files
authored
Add maven metadata and signature on workflowcheck aritfacts (#2793)
1 parent 6aca435 commit 20ab984

File tree

2 files changed

+27
-21
lines changed

2 files changed

+27
-21
lines changed

gradle/publishing.gradle

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,24 @@ subprojects {
2727
}
2828
}
2929
}
30-
// to test local publishing use ./gradlew publish and comment nexusPublishing
31-
// repositories {
32-
// maven {
33-
// def releasesRepoUrl = "$System.env.HOME/repos/releases"
34-
// def snapshotsRepoUrl = "$System.env.HOME/repos/snapshots"
35-
// url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
36-
// }
37-
// }
38-
}
3930

40-
if (project.hasProperty('signing.keyId')) {
41-
signing {
42-
sign publishing.publications.mavenJava
43-
}
31+
// To test local publishing use ./gradlew publish and comment nexusPublishing
32+
//
33+
// repositories {
34+
// maven {
35+
// def releasesRepoUrl = "$System.env.HOME/repos/releases"
36+
// def snapshotsRepoUrl = "$System.env.HOME/repos/snapshots"
37+
// url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
38+
// }
39+
// }
4440
}
4541

46-
//customize the pom in afterEvaluate to allow subproject build.gradle files to
47-
//contribute the description field
42+
// Customize the pom for all publications and sign all, in afterEvaluate so
43+
// subproject build.gradle files can contribute (e.g. description) and custom
44+
// publications (e.g. shadow) exist.
4845
afterEvaluate { subproject ->
49-
subproject.publishing.publications.mavenJava {
50-
pom {
46+
subproject.publishing.publications.withType(MavenPublication).each { publication ->
47+
publication.pom {
5148
name = subproject.description
5249
description = subproject.description
5350
url = 'https://github.com/temporalio/sdk-java'
@@ -79,5 +76,12 @@ subprojects {
7976
}
8077
}
8178
}
79+
if (subproject.hasProperty('signing.keyId')) {
80+
subproject.signing {
81+
subproject.publishing.publications.withType(MavenPublication).each { publication ->
82+
sign publication
83+
}
84+
}
85+
}
8286
}
8387
}

temporal-workflowcheck/build.gradle

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,16 @@ startScripts.dependsOn shadowJar
3333
// Configure publishing to publish both regular library jar and shadow executable jar
3434
publishing {
3535
publications {
36-
// Regular library jar for programmatic usage and compile-time annotations
37-
maven(MavenPublication) {
38-
from components.java
39-
}
36+
// Regular library jar for programmatic usage and compile-time annotations.
37+
// That publication is configured by the default setup in publishing.gradle.
38+
// mavenJava(MavenPublication) { ... }
39+
4040
// Fat executable jar with shaded dependencies
4141
shadow(MavenPublication) { publication ->
4242
project.shadow.component(publication)
4343
artifactId = "${project.name}-all"
44+
artifact sourcesJar
45+
artifact javadocJar
4446
}
4547
}
4648
}

0 commit comments

Comments
 (0)