This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
Upload jars to bintray as part of releases #1608
Merged
Merged
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
157efc7
Upload jars to bintray. WCPGW?
ajsutton f4b5aca
Prep first and upload to the test repo right.
ajsutton 94d76bc
Allow overwriting snapshot versions.
ajsutton 18e3a45
Merge branch 'master' into upload-jars
ajsutton dacc828
Publish sources and javadoc.
ajsutton 5a31b4a
Publish to real repo and only on master branch.
ajsutton 6f884a1
Merge branch 'master' of github.com:PegaSysEng/pantheon into upload-jars
ajsutton 69a8749
Spotless.
ajsutton 1327ec9
Extract out common parts of bintray config. Do one more test run on …
ajsutton 4b50cf4
Ensure snapshot distributions get published.
ajsutton c2b2779
Don't publish snapshot release. We need to work out how that will in…
ajsutton 298ef45
Release to the real repo.
ajsutton bd2d4a9
Merge branch 'master' of github.com:PegaSysEng/pantheon into upload-jars
ajsutton f7cbdd3
Put all resources in the one package.
ajsutton d9ebed8
Include internal in the group name.
ajsutton f336870
Try adding repositories block to get maven info.
ajsutton aa2fd8f
Test run.
ajsutton f60a74c
Revert "Test run."
ajsutton 729e57d
Revert "Try adding repositories block to get maven info."
ajsutton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,13 +57,31 @@ def _strListCmdArg(name, defaultValue) { | |
if (!project.hasProperty(name)) | ||
return defaultValue | ||
|
||
return ((String)project.property(name)).tokenize(',') | ||
return ((String) project.property(name)).tokenize(',') | ||
} | ||
|
||
def _strListCmdArg(name) { | ||
return _strListCmdArg(name, null) | ||
} | ||
|
||
apply plugin: 'com.jfrog.bintray' | ||
|
||
def bintrayUser = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') | ||
def bintrayKey = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY') | ||
def bintrayPackage = bintray.pkg { | ||
repo = 'pegasys-repo' | ||
name = 'pantheon' | ||
userOrg = 'consensys' | ||
licenses = ['Apache-2.0'] | ||
websiteUrl = 'https://github.com/PegaSysEng/pantheon' | ||
issueTrackerUrl = 'https://github.com/PegaSysEng/pantheon/issues' | ||
vcsUrl = 'https://github.com/PegaSysEng/pantheon.git' | ||
|
||
version { | ||
name = project.version | ||
released = new Date() | ||
} | ||
} | ||
|
||
allprojects { | ||
apply plugin: 'java-library' | ||
|
@@ -82,6 +100,16 @@ allprojects { | |
} | ||
} | ||
|
||
task sourcesJar(type: Jar, dependsOn: classes) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: javadoc) { | ||
classifier = 'javadoc' | ||
from javadoc.destinationDir | ||
} | ||
|
||
sourceCompatibility = '1.8' | ||
targetCompatibility = '1.8' | ||
|
||
|
@@ -93,7 +121,7 @@ allprojects { | |
jcenter() | ||
mavenCentral() | ||
mavenLocal() | ||
maven { url "https://consensys.bintray.com/pegasys-repo" } | ||
maven { url "https://consensys.bintray.com/pegasys-repo" } | ||
} | ||
} | ||
|
||
|
@@ -249,6 +277,54 @@ task deploy() {} | |
|
||
subprojects { | ||
|
||
if (file('src/main/java').directory) { | ||
apply plugin: 'com.jfrog.bintray' | ||
apply plugin: 'maven-publish' | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
groupId "tech.pegasys.${project.group}" | ||
version "${project.version}" | ||
from components.java | ||
artifact sourcesJar | ||
artifact javadocJar | ||
versionMapping { | ||
usage('java-api') { fromResolutionOf('runtimeClasspath') } | ||
usage('java-runtime') { fromResolutionResult() } | ||
} | ||
pom { | ||
name = "Pantheon - ${project.name}" | ||
url = 'http://github.com/PegaSysEng/pantheon' | ||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:git://github.com/PegaSysEng/pantheon.git' | ||
developerConnection = 'scm:git:ssh://github.com/PegaSysEng/pantheon.git' | ||
url = 'https://github.com/PegaSysEng/pantheon' | ||
} | ||
} | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think if you add a repositories {
maven {
// change URLs to point to your repos, e.g. http://my.org/repo
def releasesRepoUrl = "$buildDir/repos/releases"
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No luck. But I've tested with both gradle and maven depending on these publish jars and it works even without the metadata. |
||
} | ||
|
||
bintray { | ||
user = bintrayUser | ||
key = bintrayKey | ||
|
||
publications = ['mavenJava'] | ||
override = version.endsWith('SNAPSHOT') | ||
|
||
publish = true | ||
|
||
pkg = bintrayPackage | ||
} | ||
} | ||
|
||
tasks.withType(Test) { | ||
// If GRADLE_MAX_TEST_FORKS is not set, use half the available processors | ||
maxParallelForks = (System.getenv('GRADLE_MAX_TEST_FORKS') ?: (Runtime.runtime.availableProcessors().intdiv(2) ?: 1)).toInteger() | ||
|
@@ -258,7 +334,6 @@ subprojects { | |
options.fork = true | ||
options.incremental = true | ||
} | ||
apply plugin: 'maven-publish' | ||
|
||
sourceSets { | ||
// test-support can be consumed as a library by other projects in their tests | ||
|
@@ -286,7 +361,7 @@ subprojects { | |
testSupportArtifacts | ||
} | ||
|
||
task testSupportJar (type: Jar) { | ||
task testSupportJar(type: Jar) { | ||
baseName = "${project.name}-support-test" | ||
from sourceSets.testSupport.output | ||
} | ||
|
@@ -296,7 +371,7 @@ subprojects { | |
integrationTestImplementation sourceSets.testSupport.output | ||
} | ||
|
||
task integrationTest(type: Test, dependsOn:["compileTestJava"]){ | ||
task integrationTest(type: Test, dependsOn: ["compileTestJava"]) { | ||
group = "verification" | ||
description = "Runs the Pantheon integration tests" | ||
|
||
|
@@ -343,7 +418,9 @@ applicationDefaultJvmArgs = [ | |
run { | ||
args project.hasProperty("pantheon.run.args") ? project.property("pantheon.run.args").toString().split("\\s+") : [] | ||
doFirst { | ||
applicationDefaultJvmArgs = applicationDefaultJvmArgs.collect{it.replace('PANTHEON_HOME', "$buildDir/pantheon")} | ||
applicationDefaultJvmArgs = applicationDefaultJvmArgs.collect { | ||
it.replace('PANTHEON_HOME', "$buildDir/pantheon") | ||
} | ||
} | ||
} | ||
|
||
|
@@ -412,7 +489,7 @@ tasks.register("dockerDistUntar") { | |
new File(dockerBuildDir).mkdir() | ||
copy { | ||
from tarTree(distTarFile) | ||
into (dockerBuildDir) | ||
into(dockerBuildDir) | ||
} | ||
file("${dockerBuildDir}/${distTarFileName}").renameTo("${dockerBuildDir}/pantheon") | ||
} | ||
|
@@ -446,7 +523,7 @@ configurations { annotationProcessor } | |
|
||
// Prevent errorprone-checks being dependent upon errorprone-checks! | ||
// However, ensure all subprojects comply with the custom rules. | ||
configure(subprojects.findAll {it.name != 'errorprone-checks'}) { | ||
configure(subprojects.findAll { it.name != 'errorprone-checks' }) { | ||
dependencies { annotationProcessor project(":errorprone-checks") } | ||
|
||
tasks.withType(JavaCompile) { | ||
|
@@ -488,16 +565,16 @@ def getCheckedOutGitCommitHash() { | |
def head = new File(gitFolder + "HEAD").text.split(":") // .git/HEAD | ||
def isCommit = head.length == 1 // e5a7c79edabbf7dd39888442df081b1c9d8e88fd | ||
|
||
if(isCommit) return head[0].trim().take(takeFromHash) // e5a7c79edabb | ||
if (isCommit) return head[0].trim().take(takeFromHash) // e5a7c79edabb | ||
|
||
def refHead = new File(gitFolder + head[1].trim()) // .git/refs/heads/master | ||
refHead.text.trim().take takeFromHash | ||
} | ||
|
||
apply plugin: 'net.researchgate.release' | ||
|
||
task releaseIntegrationTest(type: Test){ | ||
for(TaskContainer taskList : subprojects.tasks){ | ||
task releaseIntegrationTest(type: Test) { | ||
for (TaskContainer taskList : subprojects.tasks) { | ||
def subProjectIntegrationTask = taskList.findByName('integrationTest') | ||
|
||
if (subProjectIntegrationTask != null) { | ||
|
@@ -506,14 +583,14 @@ task releaseIntegrationTest(type: Test){ | |
} | ||
} | ||
|
||
task releaseReferenceTest(type: Test, dependsOn : [ | ||
task releaseReferenceTest(type: Test, dependsOn: [ | ||
':ethereum:core:referenceTests', | ||
':ethereum:rlp:referenceTests', | ||
':ethereum:trie:referenceTests' | ||
]){ | ||
]) { | ||
} | ||
|
||
task releaseAcceptanceTest(type: Test, dependsOn : ':acceptance-tests:acceptanceTest') {} | ||
task releaseAcceptanceTest(type: Test, dependsOn: ':acceptance-tests:acceptanceTest') {} | ||
|
||
release { | ||
preTagCommitMessage = '[Gradle Release Plugin] - pre tag commit: ' | ||
|
@@ -533,11 +610,9 @@ release { | |
} | ||
} | ||
|
||
apply plugin: 'com.jfrog.bintray' | ||
|
||
bintray { | ||
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') | ||
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY') | ||
user = bintrayUser | ||
key = bintrayKey | ||
|
||
filesSpec { | ||
from distTar.destinationDir.path | ||
|
@@ -546,21 +621,9 @@ bintray { | |
} | ||
|
||
publish = true | ||
override = version.endsWith('SNAPSHOT') | ||
|
||
pkg { | ||
repo = 'pegasys-repo' | ||
name = 'pantheon' | ||
userOrg = 'consensys' | ||
licenses = ['Apache-2.0'] | ||
websiteUrl = 'https://github.com/PegaSysEng/pantheon' | ||
issueTrackerUrl = 'https://github.com/PegaSysEng/pantheon/issues' | ||
vcsUrl = 'https://github.com/PegaSysEng/pantheon.git' | ||
|
||
version { | ||
name = project.version | ||
released = new Date() | ||
} | ||
} | ||
pkg = bintrayPackage | ||
} | ||
|
||
afterReleaseBuild.dependsOn bintrayUpload | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(a) do we really want each sob jar to be it's own maven group? Since they are all needed in pantheon and only used in pantheon and can't be severed from pantheon (except for two cases: metrics and plugins api) wouldn't one group make more sense? Could we all put them in to one group and let the artifact name do the work?
(b) regardless of (a) should the group name include something like "internal" or "unstable" to make it clear it's not a stable API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything in
tech.pegasys.pantheon
makes sense to me.Including 'internal' probably makes sense. We may need to find a way to override some of this info on a per-package basis (eg would be nice if metrics wasn't marked internal) but starting with everything internal and then some migrating out if/when we work out how to do that makes sense to me.