From be51e4d958f5fe682e3d96c5fd7fea2453835ca4 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Mon, 29 Dec 2014 15:35:42 +0100 Subject: [PATCH] Publish artifacts to oss.jfrog.org and Bintray See updates to ethereumj-core/README.md for details. --- ethereumj-core/README.md | 29 +++- ethereumj-core/bintray-publish-version.xml | 167 --------------------- ethereumj-core/build.gradle | 65 ++++++++ 3 files changed, 91 insertions(+), 170 deletions(-) delete mode 100644 ethereumj-core/bintray-publish-version.xml diff --git a/ethereumj-core/README.md b/ethereumj-core/README.md index 1d534aff..e7283fb9 100644 --- a/ethereumj-core/README.md +++ b/ethereumj-core/README.md @@ -3,8 +3,29 @@ ### Include ethereum-core in your project - 1. Add http://dl.bintray.com/ethereum/maven as a repository to your build script - 2. Add a dependency on `org.ethereum:ethereumj:$version`, where `$version` is one of those listed at https://bintray.com/ethereum/maven/org.ethereum/view +#### For snapshot builds: + + - Add https://oss.jfrog.org/libs-snapshot/ as a repository to your build script + - Add a dependency on `org.ethereum:ethereumj-core:${VERSION}`, where `${VERSION}` is of the form `0.7.14-SNAPSHOT`. + +Example: + + + jfrog-snapshots + oss.jfrog.org + https://oss.jfrog.org/libs-snapshot/ + true + + + + org.ethereum + ethereumj-core + 0.7.14-SNAPSHOT + + +#### For release builds: + +_There are no release builds at this time. Use snapshots in the meantime._ ### Examples @@ -38,4 +59,6 @@ Run `../gradlew install`. #### Publish ethereumj-core builds -_TODO: integrate bintray gradle plugin_ +Push to master. + +Run `../gradlew release`. Snapshots will be published to oss.jfrog.org; releases will be published to Bintray. You must supply the `bintrayUser` and `bintrayKey` properties to the Gradle build in order to authenticate. Do this in $HOME/.gradle/gradle.properties for greatest convenience and security. diff --git a/ethereumj-core/bintray-publish-version.xml b/ethereumj-core/bintray-publish-version.xml deleted file mode 100644 index 3960fa24..00000000 --- a/ethereumj-core/bintray-publish-version.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ethereumj-core/build.gradle b/ethereumj-core/build.gradle index 040f2b3d..9eb40ba7 100644 --- a/ethereumj-core/build.gradle +++ b/ethereumj-core/build.gradle @@ -2,9 +2,13 @@ plugins { id 'application' id 'jacoco' id 'maven' + id 'maven-publish' id 'com.github.johnrengelman.shadow' version '1.2.0' id 'me.champeau.gradle.antlr4' version '0.1' id 'com.github.kt3k.coveralls' version '2.0.1x' + id 'com.jfrog.artifactory' version '3.0.1' + id 'com.jfrog.bintray' version '1.0' + } mainClassName = 'org.ethereum.Start' @@ -91,3 +95,64 @@ artifacts { archives sourcesJar archives javadocJar } + +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + artifact sourcesJar + artifact javadocJar + } + } +} + +def bintrayUsername = project.hasProperty('bintrayUser') ? project.bintrayUser : '' +def bintrayPassword = project.hasProperty('bintrayKey') ? project.bintrayKey : '' +def pullRequest = System.getenv('TRAVIS_PULL_REQUEST') + +artifactory { + contextUrl = 'http://oss.jfrog.org/artifactory' + publish { + repository { + repoKey = 'oss-snapshot-local' + username = bintrayUsername + password = bintrayPassword + } + defaults { + publications ('mavenJava') + } + } + resolve { + repository { + repoKey = 'libs-release' + } + } + +} + +artifactoryPublish.onlyIf { + (!pullRequest || pullRequest == 'false') && project.version.endsWith('-SNAPSHOT') +} + +bintray { + user = bintrayUsername + key = bintrayPassword + + publications = ['mavenJava'] + dryRun = false //Whether to run this as dry-run, without deploying + publish = true //If version should be auto published after an upload + pkg { + userOrg = 'ethereum' //An optional organization name when the repo belongs to one of the user's orgs + repo = 'maven' + name = 'org.ethereum' + } +} + +bintrayUpload.onlyIf { + (!pullRequest || pullRequest == 'false') && !project.version.endsWith('-SNAPSHOT') +} + +task release { + description = "Releases snapshot versions to oss.jfrog.org and releases to Bintray" + dependsOn artifactoryPublish, bintrayUpload +}