Skip to content
Permalink
Browse files

Upgrade to Gradle 5.4.1

  • Loading branch information...
adammurdoch committed Apr 30, 2019
1 parent f4cb76f commit edac41b8fb0a1f289dec4236b88b1c03f065f640
@@ -5,10 +5,11 @@ object Versions {
val JUNIT = "4.12"
val JSR305 = "3.0.2"
val SLF4J = "1.7.16"
val SPOCK_CORE = "1.1-groovy-2.4"
val SPOCK_CORE = "1.2-groovy-2.5"
val TYPESAFE_CONFIG = "1.2.1"
val CGLIB = "3.2.7"
val OBJENESIS = "2.6"
val GROOVY = "2.5.4"
}

object Libraries {
@@ -23,4 +24,5 @@ object Libraries {
val TYPESAFE_CONFIG = "com.typesafe:config:${Versions.TYPESAFE_CONFIG}"
val CGLIB = "cglib:cglib-nodep:${Versions.CGLIB}"
val OBJENESIS = "org.objenesis:objenesis:${Versions.OBJENESIS}"
val GROOVY = "org.codehaus.groovy:groovy:${Versions.GROOVY}"
}
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
@@ -3,9 +3,6 @@ plugins {
}

dependencies {
constraints {
testImplementation("org.codehaus.groovy:groovy-all:2.4.15")
}
api(project(":sample-discovery"))
api(Libraries.JUNIT)
compileOnly(Libraries.JSR305)
@@ -15,6 +12,7 @@ dependencies {
testImplementation(Libraries.SPOCK_CORE)
testImplementation(Libraries.CGLIB)
testImplementation(Libraries.OBJENESIS)
testImplementation(Libraries.GROOVY)
}

// Add samples as inputs for testing
@@ -15,7 +15,7 @@ class SampleTest {
static class WithTemporaryFolderRule extends SampleTestCases {

public TemporaryFolder temporaryFolder = new TemporaryFolder()
public Sample sample = Sample.from("src/test/samples/gradle")
Sample sample = Sample.from("src/test/samples/gradle")
.into(temporaryFolder)
.withDefaultSample("basic-sample")

@@ -27,6 +27,11 @@ class SampleTest {
@Rule
public Sample sample = Sample.from("src/test/samples/gradle")
.withDefaultSample("basic-sample")

@Override
Sample getSample() {
return this.sample
}
}

static class WithExplicitTemporaryFolder extends SampleTestCases {
@@ -36,9 +41,16 @@ class SampleTest {
public Sample sample = Sample.from("src/test/samples/gradle")
.intoTemporaryFolder(temporaryFolder.getRoot())
.withDefaultSample("basic-sample")

@Override
Sample getSample() {
return this.sample
}
}

static abstract class SampleTestCases {
abstract Sample getSample()

@Test
void "copies default sample"() {
File sampleDir = sample.dir
@@ -62,9 +62,11 @@ class IncrementalReverseTask extends DefaultTask {

// START SNIPPET out-of-date-inputs
inputs.outOfDate { change ->
println "out of date: ${change.file.name}"
def targetFile = new File(outputDir, change.file.name)
targetFile.text = change.file.text.reverse()
if (change.file.file) {
println "out of date: ${change.file.name}"
def targetFile = new File(outputDir, change.file.name)
targetFile.text = change.file.text.reverse()
}
}
// END SNIPPET out-of-date-inputs

@@ -10,4 +10,5 @@ dependencies {
implementation(Libraries.COMMONS_LANG3)
implementation(Libraries.TYPESAFE_CONFIG)
testImplementation(Libraries.SPOCK_CORE)
testImplementation(Libraries.GROOVY)
}

0 comments on commit edac41b

Please sign in to comment.
You can’t perform that action at this time.