Enable publishing of artifactory build info

This commit is contained in:
Tyler Benson 2017-08-02 14:18:20 -07:00
parent bdd376e994
commit 480b720ed2
2 changed files with 32 additions and 18 deletions

View File

@ -21,6 +21,11 @@ repositories {
jcenter() jcenter()
} }
description = 'dd-trace-java'
// Applied here to allow publishing of artifactory build info
apply from: "${rootDir}/gradle/publish.gradle"
task wrapper(type: Wrapper) { task wrapper(type: Wrapper) {
gradleVersion = '4.0' gradleVersion = '4.0'
} }

View File

@ -16,13 +16,10 @@
// Source: https://github.com/ratpack/ratpack/blob/master/gradle/publish.gradle // Source: https://github.com/ratpack/ratpack/blob/master/gradle/publish.gradle
apply plugin: 'maven' apply plugin: "maven"
apply plugin: "com.jfrog.artifactory" apply plugin: "com.jfrog.artifactory"
apply plugin: "signing" apply plugin: "signing"
apply from: "$rootDir/gradle/version.gradle"
apply from: "${rootDir}/gradle/pom.gradle"
afterEvaluate { afterEvaluate {
assert description: "Project $project.path is published, must have a description" assert description: "Project $project.path is published, must have a description"
} }
@ -33,14 +30,18 @@ tasks.withType(Upload).matching { it.name != "install" }.all {
} }
} }
def isCI = Boolean.parseBoolean("$System.env.CI") if (project.rootProject != project) {
apply from: "$rootDir/gradle/version.gradle"
apply from: "${rootDir}/gradle/pom.gradle"
signing { def isCI = Boolean.parseBoolean("$System.env.CI")
signing {
required = isCI required = isCI
sign configurations.archives sign configurations.archives
} }
configurations { configurations {
configurations { configurations {
all { all {
incoming.afterResolve { incoming.afterResolve {
@ -56,6 +57,7 @@ configurations {
} }
} }
} }
}
} }
def isSnapshot = version.endsWith("-SNAPSHOT") def isSnapshot = version.endsWith("-SNAPSHOT")
@ -63,6 +65,13 @@ def isSnapshot = version.endsWith("-SNAPSHOT")
def forceLocal = project.hasProperty('forceLocal') && forceLocal def forceLocal = project.hasProperty('forceLocal') && forceLocal
artifactoryPublish { task -> artifactoryPublish { task ->
gradle.taskGraph.whenReady { taskGraph ->
def startParameter = project.gradle.startParameter
if (taskGraph.hasTask(task) && startParameter.parallelProjectExecutionEnabled && startParameter.maxWorkerCount > 1) {
throw new IllegalStateException("cannot run " + task + " with --parallel and --max-workers > 1")
}
}
artifactory { artifactory {
publish { publish {
contextUrl = forceLocal ? 'http://localhost:8080/artifactory' : 'https://oss.jfrog.org' contextUrl = forceLocal ? 'http://localhost:8080/artifactory' : 'https://oss.jfrog.org'