Skip to content

Commit

Permalink
Add signature of distribution zip
Browse files Browse the repository at this point in the history
To make this work, we had to inject the files from the subprojects, instead of declaring it in the main project.
  • Loading branch information
mrotteveel committed Nov 8, 2024
1 parent 0f31675 commit fc42bc1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 19 deletions.
19 changes: 2 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ tasks.named('asciidoctor', AsciidoctorTask).configure {
}

tasks.register('dist', Zip) {
dependsOn assemble, asciidoctor
//dependsOn jar, javadocJar, sourcesJar, asciidoctor
destinationDirectory = layout.buildDirectory.dir('dist')

from jar.outputs
Expand All @@ -143,22 +143,7 @@ tasks.register('dist', Zip) {
from(configurations.runtimeClasspath) {
into 'lib'
}
def chacha64 = project('chacha64-plugin')
from chacha64.jar.outputs
from chacha64.javadocJar.outputs
from chacha64.sourcesJar.outputs
from(chacha64.configurations.runtimeClasspath) {
exclude 'jaybird-*'
into 'lib'
}
def jaybirdNative = project('jaybird-native')
from jaybirdNative.jar.outputs
from jaybirdNative.javadocJar.outputs
from jaybirdNative.sourcesJar.outputs
from(jaybirdNative.configurations.runtimeClasspath) {
exclude 'jaybird-*'
into 'lib'
}
// NOTE: Inclusion of files from sub-projects is handled in their respective build.gradle files
}

jar {
Expand Down
11 changes: 11 additions & 0 deletions chacha64-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ javadoc {
options.addBooleanOption('Xdoclint:none', true)
}

parent.tasks.named('dist', Zip) {
from jar.outputs
from javadocJar.outputs
from sourcesJar.outputs
from(configurations.runtimeClasspath) {
exclude 'jaybird-*'
exclude 'jspecify-*'
into 'lib'
}
}

publishing {
publications {
// chacha-64 maven artifact
Expand Down
5 changes: 3 additions & 2 deletions devdoc/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ Publishing
To publish to Maven use

```
gradlew clean publish -PcredentialsPassphrase=<credentials password>
gradlew clean assemble publish -PcredentialsPassphrase=<credentials password>
```

Where `<credentials password>` is the password used to add the credentials (see
also below).

The `assemble` task is not strictly necessary, but will also generate the `dist`
zip and sign it.

Publishing to Maven Central (non-SNAPSHOT releases) requires an explicit close
and release through <https://oss.sonatype.org/>.
Expand Down
11 changes: 11 additions & 0 deletions jaybird-native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ javadoc {
options.addBooleanOption('Xdoclint:none', true)
}

parent.tasks.named('dist', Zip) {
from jar.outputs
from javadocJar.outputs
from sourcesJar.outputs
from(configurations.runtimeClasspath) {
exclude 'jaybird-*'
exclude 'jspecify-*'
into 'lib'
}
}

publishing {
publications {
// jaybird-native maven artifact
Expand Down
1 change: 1 addition & 0 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,5 @@ allprojects {
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask(':publish') }
sign publishing.publications.jaybird
sign dist
}

0 comments on commit fc42bc1

Please sign in to comment.