Skip to content

Commit

Permalink
Update the build.gradle for publishing
Browse files Browse the repository at this point in the history
The updated versions of gradle appear to require a slightly different
way of publishing.

Based on a local empirical test, these changes appear to be sound

Signed-off-by: Matthew B White <[email protected]>
  • Loading branch information
mbwhite authored and jt-nti committed Jul 22, 2021
1 parent 4ea0f71 commit 292c4eb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
4 changes: 2 additions & 2 deletions ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ stages:
inputs:
secureFile: secring.gpg
- script: |
./gradlew -Psigning.keyId=${SIGNING_ID} -Psigning.password=${SIGNING_PASSWORD} -Psigning.secretKeyRingFile=${KEYRING_FILE} -PossrhUsername=${OSSRH_USER} -PossrhPassword=${OSSRH_PASSWORD} publishMavenPublicationToReleaseRepository
./gradlew -Psigning.keyId=${SIGNING_ID} -Psigning.password=${SIGNING_PASSWORD} -Psigning.secretKeyRingFile=${KEYRING_FILE} -PossrhUsername=${OSSRH_USER} -PossrhPassword=${OSSRH_PASSWORD} publishMavenPublicationToSnapshotRepository
./gradlew -Psigning.keyId=${SIGNING_ID} -Psigning.password=${SIGNING_PASSWORD} -Psigning.secretKeyRingFile=${KEYRING_FILE} -PossrhUsername=${OSSRH_USER} -PossrhPassword=${OSSRH_PASSWORD} publishAllPublicationsToReleaseRepository
./gradlew -Psigning.keyId=${SIGNING_ID} -Psigning.password=${SIGNING_PASSWORD} -Psigning.secretKeyRingFile=${KEYRING_FILE} -PossrhUsername=${OSSRH_USER} -PossrhPassword=${OSSRH_PASSWORD} publishAllPublicationsToSnapshotRepository
env:
SIGNING_ID: $(JAR-Signing-Id)
SIGNING_PASSWORD: $(JAR-Signing-Password)
Expand Down
14 changes: 3 additions & 11 deletions fabric-chaincode-protos/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ if (JavaVersion.current().isJava8Compatible()) {
}
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}


publishing {
Expand Down Expand Up @@ -224,11 +220,7 @@ signing {
}
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives javadocJar, sourcesJar
java {
withJavadocJar()
withSourcesJar()
}
14 changes: 7 additions & 7 deletions fabric-chaincode-shim/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,6 @@ if (JavaVersion.current().isJava8Compatible()) {
}
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

publishing {
publications {
Expand Down Expand Up @@ -333,18 +329,22 @@ signing {
}
}

// Need to specify the sourcesJar task BEFORE the java{withSourcesJar()} so that it picks up the duplicatesStratergy
// otherwise this fails with a duplicates error.
// (see https://github.com/gradle/gradle/issues/17236)

task sourcesJar(type: Jar) {
duplicatesStrategy = 'include'
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives javadocJar, sourcesJar
java {
withJavadocJar()
withSourcesJar()
}



build.dependsOn licenseCheck

// setup more detailed test output formats
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 292c4eb

Please sign in to comment.