From 66641c8d6c0199d2952554adddcc8798f4668179 Mon Sep 17 00:00:00 2001 From: Stefan Verhoeven Date: Thu, 13 Jun 2019 17:24:23 +0200 Subject: [PATCH 1/3] Use gradle all so ide can better understand gradle build files. --- gradle/wrapper/gradle-wrapper.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f4d7b2bf6..74dd84151 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Thu Jun 13 16:52:12 CEST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip From 4c1dee0d43b048ae7fb95e58524d677ba19956e5 Mon Sep 17 00:00:00 2001 From: Stefan Verhoeven Date: Thu, 13 Jun 2019 17:25:08 +0200 Subject: [PATCH 2/3] Publish docgenerator and testapi artifacts to bintray in seperate package * Created new `publishToBintray` task to publish xenon, xenon-testapi and xenon-docgenerator package * Using MavenPublication to publish to bintray maven repos instead of bintray plugin as can only upload to a single package. * xenon package is now automaticly published after uploading, instead of having to visit bintray web site to publish. * Included a sources.jar for every package --- RELEASE.md | 11 ++-- gradle/distribution.gradle | 101 +++++++++++++++++++++++++++++++++++-- gradle/release.gradle | 15 ++++-- 3 files changed, 111 insertions(+), 16 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index aaa8fb4f4..a74525cf8 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -71,17 +71,14 @@ To add the release to bintray, do the following: ```bash export BINTRAY_USER= export BINTRAY_KEY= -./gradlew bintrayUpload +./gradlew publishToBintray ``` This should create the new release on bintray and upload all necessary data, jars, etc. -Next, go to the bintray page: - -https://bintray.com/nlesc/xenon/xenon# - -and click on 'publish' to publish the release. The latest verion tag usually takes a few minutes to update. +On https://bintray.com/nlesc/xenon check that xenon* packages have been updated. +The latest version tag usually takes a few minutes to update. ### Alternative manual bintray step @@ -111,6 +108,6 @@ the .m2 repository. Click on `save` and then on `publish` to publish the version ### 7. Update applications using Xenon. -Update related repros such as Xenon-examples, pyXenon, xenon-cli, etc +Update related repos such as Xenon-examples, pyXenon, xenon-cli, etc And finally celebrate. diff --git a/gradle/distribution.gradle b/gradle/distribution.gradle index 3916183d1..68159a3ac 100644 --- a/gradle/distribution.gradle +++ b/gradle/distribution.gradle @@ -7,28 +7,43 @@ // ============== task sourcesJar(type: Jar, dependsOn: classes) { description "Creates jar file of Java sources" - classifier = 'sources' + archiveClassifier = 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { description "Creates jar file of javadoc" - classifier = 'javadoc' + archiveClassifier = 'javadoc' from javadoc.destinationDir } task testApiJar(type: Jar) { description "Creates jar with test api" - baseName = 'xenon-testapi' + archiveBaseName = 'xenon-testapi' from sourceSets.testApi.output } +task testApiSourceJar(type: Jar, dependsOn: classes) { + description "Creates jar file of testapi Java sources" + archiveBaseName = 'xenon-testapi' + archiveClassifier = 'sources' + from sourceSets.testApi.allSource +} + task docGeneratorJar(type: Jar) { description "Creates jar with doc generator" - baseName = 'xenon-docgenerator' + archiveBaseName = 'xenon-docgenerator' from sourceSets.docGenerator.output } +task docGeneratorSourceJar(type: Jar, dependsOn: classes) { + description "Creates jar with doc generator Java sources" + archiveBaseName = 'xenon-docgenerator' + archiveClassifier = 'sources' + from sourceSets.docGenerator.allSource +} + + artifacts { archives sourcesJar archives javadocJar @@ -87,13 +102,71 @@ publishing { version version artifact testApiJar + artifact testApiSourceJar + + pom { + url = "https://xenon-middleware.github.io/xenon" + description = "Abstract classes for Xenon adaptor integration tests" + url = "https://github.com/xenon-middleware/xenon" + licenses { + license { + name = "The Apache License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + } + } + scm { + connection = "scm:git:https://github.com/xenon-middleware/xenon.git" + url = "https://github.com/xenon-middleware/xenon" + } + } + // Add dependencies.testApiCompile to publication + pom.withXml { + def dependenciesNode = asNode().appendNode('dependencies') + configurations.testApiCompile.allDependencies.each { + if (it.group) { + def dependencyNode = dependenciesNode.appendNode('dependency') + dependencyNode.appendNode('groupId', it.group) + dependencyNode.appendNode('artifactId', it.name) + dependencyNode.appendNode('version', it.version) + } + } + // Xenon is added as sourceSets.main.output, which cannot be resolved to a dependency, so add manually + def dependencyNode = dependenciesNode.appendNode('dependency') + dependencyNode.appendNode('groupId', 'nl.esciencecenter.xenon') + dependencyNode.appendNode('artifactId', 'xenon') + dependencyNode.appendNode('version', version) + } } DocGeneratorPublication(MavenPublication) { groupId 'nl.esciencecenter.xenon' artifactId 'xenon-docgenerator' version version - artifact docGeneratorJar + artifact docGeneratorSourceJar + pom { + url = "https://xenon-middleware.github.io/xenon" + description = "Class to generate documentation for all Xenon adaptors in class path" + url = "https://github.com/xenon-middleware/xenon" + licenses { + license { + name = "The Apache License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + } + } + scm { + connection = "scm:git:https://github.com/xenon-middleware/xenon.git" + url = "https://github.com/xenon-middleware/xenon" + } + } + // Add dependencies.testApiCompile to publication + pom.withXml { + def dependenciesNode = asNode().appendNode('dependencies') + // Xenon is added as sourceSets.main.output, which cannot be resolved to a dependency, so add manually + def dependencyNode = dependenciesNode.appendNode('dependency') + dependencyNode.appendNode('groupId', 'nl.esciencecenter.xenon') + dependencyNode.appendNode('artifactId', 'xenon') + dependencyNode.appendNode('version', version) + } } LiveTestPublication(MavenPublication) { groupId 'nl.esciencecenter.xenon' @@ -103,4 +176,22 @@ publishing { artifact liveTestJar } } + repositories { + maven { + name = 'TestApiRepo' + url = 'https://api.bintray.com/maven/nlesc/xenon/xenon-testapi/;publish=1' + credentials { + username = System.getenv('BINTRAY_USER') + password = System.getenv('BINTRAY_KEY') + } + } + maven { + name = 'DocGeneratorRepo' + url = 'https://api.bintray.com/maven/nlesc/xenon/xenon-docgenerator/;publish=1' + credentials { + username = System.getenv('BINTRAY_USER') + password = System.getenv('BINTRAY_KEY') + } + } + } } diff --git a/gradle/release.gradle b/gradle/release.gradle index d305bbca4..2675662e5 100644 --- a/gradle/release.gradle +++ b/gradle/release.gradle @@ -13,13 +13,14 @@ bintray { repo = 'xenon' name = 'xenon' desc = description + publish = true userOrg = 'nlesc' licenses = ['Apache-2.0'] websiteUrl = 'https://nlesc.github.io/Xenon' vcsUrl = 'https://github.com/NLeSC/Xenon.git' issueTrackerUrl = 'https://github.com/NLeSC/Xenon/issues' } - publications = ['MyPublication', 'TestApiPublication', 'DocGeneratorPublication'] + publications = ['MyPublication'] } tasks.publish.dependsOn 'bintrayUpload' @@ -49,7 +50,13 @@ task copyJavadoc(type: Copy) { } task publishSite() { - description 'Publishes artifacts to site (aka /docs/ directory)' - group 'Publishing' - dependsOn 'versionSite', 'copyJavadoc' + description 'Publishes artifacts to site (aka /docs/ directory)' + group 'Publishing' + dependsOn 'versionSite', 'copyJavadoc' +} + +task publishToBintray() { + dependsOn 'bintrayUpload', + 'publishDocGeneratorPublicationPublicationToDocGeneratorRepoRepository', + 'publishTestApiPublicationPublicationToTestApiRepoRepository' } From 09979df6179012500fa52e9240583ecffb7a5e96 Mon Sep 17 00:00:00 2001 From: Stefan Verhoeven Date: Thu, 13 Jun 2019 20:00:17 +0200 Subject: [PATCH 3/3] Move publish=true to right level --- gradle/release.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/release.gradle b/gradle/release.gradle index 2675662e5..633534430 100644 --- a/gradle/release.gradle +++ b/gradle/release.gradle @@ -9,11 +9,11 @@ bintray { user = System.getenv('BINTRAY_USER') key = System.getenv('BINTRAY_KEY') + publish = true pkg { repo = 'xenon' name = 'xenon' desc = description - publish = true userOrg = 'nlesc' licenses = ['Apache-2.0'] websiteUrl = 'https://nlesc.github.io/Xenon'