Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 21 additions & 17 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,24 @@ subprojects {
}
}
}
// to test local publishing use ./gradlew publish and comment nexusPublishing
// repositories {
// maven {
// def releasesRepoUrl = "$System.env.HOME/repos/releases"
// def snapshotsRepoUrl = "$System.env.HOME/repos/snapshots"
// url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
// }
// }
}

if (project.hasProperty('signing.keyId')) {
signing {
sign publishing.publications.mavenJava
}
// To test local publishing use ./gradlew publish and comment nexusPublishing
//
// repositories {
// maven {
// def releasesRepoUrl = "$System.env.HOME/repos/releases"
// def snapshotsRepoUrl = "$System.env.HOME/repos/snapshots"
// url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
// }
// }
}

//customize the pom in afterEvaluate to allow subproject build.gradle files to
//contribute the description field
// Customize the pom for all publications and sign all, in afterEvaluate so
// subproject build.gradle files can contribute (e.g. description) and custom
// publications (e.g. shadow) exist.
afterEvaluate { subproject ->
subproject.publishing.publications.mavenJava {
pom {
subproject.publishing.publications.withType(MavenPublication).each { publication ->
publication.pom {
name = subproject.description
description = subproject.description
url = 'https://github.com/temporalio/sdk-java'
Expand Down Expand Up @@ -79,5 +76,12 @@ subprojects {
}
}
}
if (subproject.hasProperty('signing.keyId')) {
subproject.signing {
subproject.publishing.publications.withType(MavenPublication).each { publication ->
sign publication
}
}
}
}
}
10 changes: 6 additions & 4 deletions temporal-workflowcheck/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ startScripts.dependsOn shadowJar
// Configure publishing to publish both regular library jar and shadow executable jar
publishing {
publications {
// Regular library jar for programmatic usage and compile-time annotations
maven(MavenPublication) {
from components.java
}
// Regular library jar for programmatic usage and compile-time annotations.
// That publication is configured by the default setup in publishing.gradle.
// mavenJava(MavenPublication) { ... }

// Fat executable jar with shaded dependencies
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
artifactId = "${project.name}-all"
artifact sourcesJar
artifact javadocJar
}
}
}
Expand Down
Loading