Skip to content

Commit

Permalink
migrate extra properties, buildScan and allprojects configuration to …
Browse files Browse the repository at this point in the history
…Kotlin DSL (#123)
  • Loading branch information
aaschmid committed Dec 24, 2019
1 parent 48b5561 commit 709351a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 27 deletions.
23 changes: 23 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,27 @@ plugins {
id("com.github.kt3k.coveralls") version "2.9.0"
}

val isBuildOnJenkins by extra(System.getenv().getOrDefault("BUILD_TAG", "").startsWith("jenkins-"))
println("buildOnJenkins = $isBuildOnJenkins for current build.")

val skipSpotBugs by extra(hasProperty("skipSpotBugs"))
println("Using skipSpotBugs = $skipSpotBugs for current build.")

// set default junit versions if not set via command line
val junit4Version by extra(findProperty("junit4Version")?.toString() ?: "4.12")
println("Using JUnit4 version $junit4Version for current build.")
val junitJupiterVersion by extra(findProperty("junitJupiterVersion")?.toString() ?: "5.5.2")
println("Using JUnit Jupiter version $junitJupiterVersion for current build.")

buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}

allprojects {
repositories {
mavenCentral()
}
}

apply(from = "legacy.build.gradle")
27 changes: 0 additions & 27 deletions legacy.build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
ext {
isBuildOnJenkins = System.env["BUILD_TAG"]?.startsWith("jenkins-") ?: false
skipSpotBugs = hasProperty("skipSpotBugs")
println("Using skipSpotBugs = ${skipSpotBugs} for current build.")

if (!hasProperty("junit4Version")) { // set default junit version if not set via command line
junit4Version = "4.12"
}
println("Using JUnit4 version ${junit4Version} for current build.")

if (!hasProperty("junitJupiterVersion")) { // set default junit version if not set via command line
junitJupiterVersion = "5.5.2"
}
println("Using JUnit Jupiter version ${junitJupiterVersion} for current build.")
}

buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}

allprojects {
repositories {
mavenCentral()
}
}

subprojects {
apply(plugin: "jacoco")
apply(plugin: "java-library")
Expand Down

0 comments on commit 709351a

Please sign in to comment.