Skip to content

Commit

Permalink
Publish docgenerator and testapi artifacts to bintray in seperate pac…
Browse files Browse the repository at this point in the history
…kage

* 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
  • Loading branch information
sverhoeven committed Jun 13, 2019
1 parent 66641c8 commit 4c1dee0
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 16 deletions.
11 changes: 4 additions & 7 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,14 @@ To add the release to bintray, do the following:
```bash
export BINTRAY_USER=<your bintray username>
export BINTRAY_KEY=<your bintray API 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

Expand Down Expand Up @@ -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.
101 changes: 96 additions & 5 deletions gradle/distribution.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand All @@ -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')
}
}
}
}
15 changes: 11 additions & 4 deletions gradle/release.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
}

0 comments on commit 4c1dee0

Please sign in to comment.