From 83a39c0f19300a2a3d1e668ac6ea84b433ba8791 Mon Sep 17 00:00:00 2001 From: Jon Harris Date: Wed, 23 Jun 2021 10:20:30 +0100 Subject: [PATCH] fix(#1721): Update build.gradle files to work with gradle 7 --- common/build.gradle | 30 ++++----- core/build.gradle | 32 ++++----- .../core/builders/ConstraintChainBuilder.java | 1 - custom/build.gradle | 2 +- orchestrator/build.gradle | 65 ++++++++++--------- output/build.gradle | 31 +++++---- playground/build.gradle | 18 ++--- profile/build.gradle | 48 +++++++------- 8 files changed, 117 insertions(+), 110 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index 3f0962f77..e90759d9a 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -27,30 +27,30 @@ repositories { } dependencies { - compile "org.apache.commons:commons-lang3:${COMMONS_LANG3_VERSION}" - compile "com.fasterxml.jackson.core:jackson-core:${JACKSON_VERSION}" - compile "com.fasterxml.jackson.core:jackson-annotations:${JACKSON_VERSION}" - compile "com.fasterxml.jackson.core:jackson-databind:${JACKSON_VERSION}" - compile group: "com.google.inject", name: "guice", version: "${GUICE_VERSION}" + implementation "org.apache.commons:commons-lang3:${COMMONS_LANG3_VERSION}" + implementation "com.fasterxml.jackson.core:jackson-core:${JACKSON_VERSION}" + implementation "com.fasterxml.jackson.core:jackson-annotations:${JACKSON_VERSION}" + implementation "com.fasterxml.jackson.core:jackson-databind:${JACKSON_VERSION}" + implementation group: "com.google.inject", name: "guice", version: "${GUICE_VERSION}" constraints { - compile('com.google.guava:guava:30.0-jre') { + implementation('com.google.guava:guava:30.0-jre') { because 'Versions prior to 30.0 are impacted by CVE-2020-8908' } - compile('com.google.guava:guava:30.0-android') { + implementation('com.google.guava:guava:30.0-android') { because 'Versions prior to 30.0 are impacted by CVE-2020-8908' } } implementation "org.threeten:threeten-extra:${THREE_TEN_VERSION}" - testCompile "org.junit.jupiter:junit-jupiter-api:${JUNIT_JUPITER_VERSION}" - testCompile "junit:junit:${JUNIT_4_VERSION}" - testCompile "org.junit.platform:junit-platform-runner:${JUNIT_PLATFORM_RUNNER_VERSION}" - testCompile "org.junit.vintage:junit-vintage-engine:${JUNIT_JUPITER_VERSION}" - testCompile "org.hamcrest:java-hamcrest:${HAMCREST_VERSION}" - testCompile "org.junit.jupiter:junit-jupiter-params:${JUNIT_JUPITER_VERSION}" - testCompile "org.mockito:mockito-all:${MOCKITO_VERSION}" - testCompile "org.junit.jupiter:junit-jupiter-engine:${JUNIT_JUPITER_VERSION}" + testImplementation "org.junit.jupiter:junit-jupiter-api:${JUNIT_JUPITER_VERSION}" + testImplementation "junit:junit:${JUNIT_4_VERSION}" + testImplementation "org.junit.platform:junit-platform-runner:${JUNIT_PLATFORM_RUNNER_VERSION}" + testImplementation "org.junit.vintage:junit-vintage-engine:${JUNIT_JUPITER_VERSION}" + testImplementation "org.hamcrest:java-hamcrest:${HAMCREST_VERSION}" + testImplementation "org.junit.jupiter:junit-jupiter-params:${JUNIT_JUPITER_VERSION}" + testImplementation "org.mockito:mockito-all:${MOCKITO_VERSION}" + testImplementation "org.junit.jupiter:junit-jupiter-engine:${JUNIT_JUPITER_VERSION}" testImplementation("org.junit.jupiter:junit-jupiter:${JUNIT_JUPITER_VERSION}") } diff --git a/core/build.gradle b/core/build.gradle index 224354c45..c9aba5d03 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -15,11 +15,11 @@ */ dependencies { - compile project(":common") + implementation project(":common") - compile "com.google.inject:guice:${GUICE_VERSION}" - compile "dk.brics.automaton:automaton:${AUTOMATON_VERSION}" - compile "org.apache.commons:commons-csv:${COMMONS_CSV_VERSION}" + implementation "com.google.inject:guice:${GUICE_VERSION}" + implementation "dk.brics.automaton:automaton:${AUTOMATON_VERSION}" + implementation "org.apache.commons:commons-csv:${COMMONS_CSV_VERSION}" implementation "com.github.javafaker:javafaker:${FAKER_VERSION}" implementation ('org.yaml:snakeyaml') { version { @@ -28,24 +28,24 @@ dependencies { } constraints { - compile('com.google.guava:guava:30.0-jre') { + implementation('com.google.guava:guava:30.0-jre') { because 'Versions prior to 30.0 are impacted by CVE-2020-8908' } - compile('com.google.guava:guava:30.0-android') { + implementation('com.google.guava:guava:30.0-android') { because 'Versions prior to 30.0 are impacted by CVE-2020-8908' } } - testCompile project(":common").sourceSets.test.output - testCompile "org.junit.jupiter:junit-jupiter-api:${JUNIT_JUPITER_VERSION}" - testCompile "junit:junit:${JUNIT_4_VERSION}" - testCompile "org.junit.platform:junit-platform-runner:${JUNIT_PLATFORM_RUNNER_VERSION}" - testCompile "org.junit.vintage:junit-vintage-engine:${JUNIT_JUPITER_VERSION}" - testCompile "org.hamcrest:java-hamcrest:${HAMCREST_VERSION}" - testCompile "org.junit.jupiter:junit-jupiter-params:${JUNIT_JUPITER_VERSION}" - testCompile "com.shazam:shazamcrest:${SHAZAMCREST_VERSION}" - testCompile "org.mockito:mockito-all:${MOCKITO_VERSION}" - testCompile "org.junit.jupiter:junit-jupiter-engine:${JUNIT_JUPITER_VERSION}" + testImplementation project(":common").sourceSets.test.output + testImplementation "org.junit.jupiter:junit-jupiter-api:${JUNIT_JUPITER_VERSION}" + testImplementation "junit:junit:${JUNIT_4_VERSION}" + testImplementation "org.junit.platform:junit-platform-runner:${JUNIT_PLATFORM_RUNNER_VERSION}" + testImplementation "org.junit.vintage:junit-vintage-engine:${JUNIT_JUPITER_VERSION}" + testImplementation "org.hamcrest:java-hamcrest:${HAMCREST_VERSION}" + testImplementation "org.junit.jupiter:junit-jupiter-params:${JUNIT_JUPITER_VERSION}" + testImplementation "com.shazam:shazamcrest:${SHAZAMCREST_VERSION}" + testImplementation "org.mockito:mockito-all:${MOCKITO_VERSION}" + testImplementation "org.junit.jupiter:junit-jupiter-engine:${JUNIT_JUPITER_VERSION}" testImplementation("org.junit.jupiter:junit-jupiter:${JUNIT_JUPITER_VERSION}") } diff --git a/core/src/test/java/com/scottlogic/datahelix/generator/core/builders/ConstraintChainBuilder.java b/core/src/test/java/com/scottlogic/datahelix/generator/core/builders/ConstraintChainBuilder.java index 87335089e..8240070e1 100644 --- a/core/src/test/java/com/scottlogic/datahelix/generator/core/builders/ConstraintChainBuilder.java +++ b/core/src/test/java/com/scottlogic/datahelix/generator/core/builders/ConstraintChainBuilder.java @@ -16,7 +16,6 @@ package com.scottlogic.datahelix.generator.core.builders; -import com.scottlogic.datahelix.generator.common.SetUtils; import com.scottlogic.datahelix.generator.common.profile.Field; import com.scottlogic.datahelix.generator.common.util.NumberUtils; import com.scottlogic.datahelix.generator.core.profile.constraints.Constraint; diff --git a/custom/build.gradle b/custom/build.gradle index 32c8ffd35..e3a5a9bc7 100644 --- a/custom/build.gradle +++ b/custom/build.gradle @@ -11,5 +11,5 @@ repositories { } dependencies { - testCompile group: 'junit', name: 'junit', version: '4.13.1' + testImplementation group: 'junit', name: 'junit', version: '4.13.1' } diff --git a/orchestrator/build.gradle b/orchestrator/build.gradle index 93e1d1133..c810a6a9f 100644 --- a/orchestrator/build.gradle +++ b/orchestrator/build.gradle @@ -16,7 +16,7 @@ plugins { id "java" - id "de.gliderpilot.semantic-release" version "1.4.0" + id "de.gliderpilot.semantic-release" version "1.4.2" id "application" id "nebula.deb" version "8.0.3" } @@ -30,33 +30,37 @@ repositories { } dependencies { - compile project(":profile") - compile project(":core") - compile project(":output") - compile project(":common") - compile project(":custom") - - compile group: "info.picocli", name: "picocli", version: "${PICOCLI_VERSION}" - compile group: "com.google.code.gson", name: "gson", version: "${GSON_VERSION}" - - testCompile project(":common").sourceSets.test.output - testCompile "org.hamcrest:java-hamcrest:${HAMCREST_VERSION}" - testCompile "org.junit.jupiter:junit-jupiter-api:${JUNIT_JUPITER_VERSION}" - testCompile "org.junit.platform:junit-platform-runner:${JUNIT_PLATFORM_RUNNER_VERSION}" - testCompile "org.junit.vintage:junit-vintage-engine:${JUNIT_JUPITER_VERSION}" - testCompile "org.junit.jupiter:junit-jupiter-params:${JUNIT_JUPITER_VERSION}" - testCompile "io.cucumber:cucumber-junit:${CUCUMBER_VERSION}" - testCompile "io.cucumber:cucumber-java:${CUCUMBER_VERSION}" - testCompile "io.cucumber:cucumber-java8:${CUCUMBER_VERSION}" - testCompile "io.cucumber:gherkin:${GHERKIN_VERSION}" - testCompile "io.cucumber:cucumber-picocontainer:${CUCUMBER_PICOCONTAINER_VERSION}" - testCompile "org.mockito:mockito-all:${MOCKITO_VERSION}" - testCompile "com.shazam:shazamcrest:${SHAZAMCREST_VERSION}" - testCompile "org.junit.jupiter:junit-jupiter-engine:${JUNIT_JUPITER_VERSION}" - testCompile group: "junit", name: "junit", version: "${JUNIT_4_VERSION}" - - testCompile project(':core').sourceSets.test.output - testCompile project(':profile').sourceSets.test.output + implementation project(":profile") + implementation project(":core") + implementation project(":output") + implementation project(":common") + implementation project(":custom") + + implementation group: "info.picocli", name: "picocli", version: "${PICOCLI_VERSION}" + implementation group: "com.google.code.gson", name: "gson", version: "${GSON_VERSION}" + + implementation group: "com.google.inject", name: "guice", version: "${GUICE_VERSION}" + implementation "com.fasterxml.jackson.core:jackson-core:${JACKSON_VERSION}" + implementation "com.fasterxml.jackson.core:jackson-databind:${JACKSON_VERSION}" + + testImplementation project(":common").sourceSets.test.output + testImplementation "org.hamcrest:java-hamcrest:${HAMCREST_VERSION}" + testImplementation "org.junit.jupiter:junit-jupiter-api:${JUNIT_JUPITER_VERSION}" + testImplementation "org.junit.platform:junit-platform-runner:${JUNIT_PLATFORM_RUNNER_VERSION}" + testImplementation "org.junit.vintage:junit-vintage-engine:${JUNIT_JUPITER_VERSION}" + testImplementation "org.junit.jupiter:junit-jupiter-params:${JUNIT_JUPITER_VERSION}" + testImplementation "io.cucumber:cucumber-junit:${CUCUMBER_VERSION}" + testImplementation "io.cucumber:cucumber-java:${CUCUMBER_VERSION}" + testImplementation "io.cucumber:cucumber-java8:${CUCUMBER_VERSION}" + testImplementation "io.cucumber:gherkin:${GHERKIN_VERSION}" + testImplementation "io.cucumber:cucumber-picocontainer:${CUCUMBER_PICOCONTAINER_VERSION}" + testImplementation "org.mockito:mockito-all:${MOCKITO_VERSION}" + testImplementation "com.shazam:shazamcrest:${SHAZAMCREST_VERSION}" + testImplementation "org.junit.jupiter:junit-jupiter-engine:${JUNIT_JUPITER_VERSION}" + testImplementation group: "junit", name: "junit", version: "${JUNIT_4_VERSION}" + + testImplementation project(':core').sourceSets.test.output + testImplementation project(':profile').sourceSets.test.output testImplementation("org.junit.jupiter:junit-jupiter:${JUNIT_JUPITER_VERSION}") @@ -92,8 +96,9 @@ task fatJar(type: Jar) { attributes 'Main-Class': 'com.scottlogic.datahelix.generator.orchestrator.App' } baseName = 'datahelix' - from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } with jar + duplicatesStrategy = 'warn' archiveName = "${baseName}.${extension}" } @@ -128,7 +133,7 @@ jar { } application { - mainClassName = 'com.scottlogic.datahelix.generator.orchestrator.App' + mainClass.set('com.scottlogic.datahelix.generator.orchestrator.App') } project.ext.ghToken = project.hasProperty('ghToken') ? project.getProperty('ghToken') : System.getenv('GH_TOKEN') ?: null diff --git a/output/build.gradle b/output/build.gradle index 73c0ba660..e3d834fb9 100644 --- a/output/build.gradle +++ b/output/build.gradle @@ -15,29 +15,32 @@ */ dependencies { - compile project(':common') + implementation project(':common') - compile "org.apache.commons:commons-csv:${COMMONS_CSV_VERSION}" - compile "com.google.inject:guice:${GUICE_VERSION}" + implementation "org.apache.commons:commons-csv:${COMMONS_CSV_VERSION}" + implementation "com.google.inject:guice:${GUICE_VERSION}" + implementation "com.fasterxml.jackson.core:jackson-core:${JACKSON_VERSION}" + implementation "com.fasterxml.jackson.core:jackson-annotations:${JACKSON_VERSION}" + implementation "com.fasterxml.jackson.core:jackson-databind:${JACKSON_VERSION}" constraints { - compile('com.google.guava:guava:30.0-jre') { + implementation('com.google.guava:guava:30.0-jre') { because 'Versions prior to 30.0 are impacted by CVE-2020-8908' } - compile('com.google.guava:guava:30.0-android') { + implementation('com.google.guava:guava:30.0-android') { because 'Versions prior to 30.0 are impacted by CVE-2020-8908' } } - testCompile project(":common").sourceSets.test.output - testCompile "org.junit.jupiter:junit-jupiter-api:${JUNIT_JUPITER_VERSION}" - testCompile "junit:junit:${JUNIT_4_VERSION}" - testCompile "org.junit.platform:junit-platform-runner:${JUNIT_PLATFORM_RUNNER_VERSION}" - testCompile "org.junit.vintage:junit-vintage-engine:${JUNIT_JUPITER_VERSION}" - testCompile "org.hamcrest:java-hamcrest:${HAMCREST_VERSION}" - testCompile "org.junit.jupiter:junit-jupiter-params:${JUNIT_JUPITER_VERSION}" - testCompile "org.mockito:mockito-all:${MOCKITO_VERSION}" - testCompile "org.junit.jupiter:junit-jupiter-engine:${JUNIT_JUPITER_VERSION}" + testImplementation project(":common").sourceSets.test.output + testImplementation "org.junit.jupiter:junit-jupiter-api:${JUNIT_JUPITER_VERSION}" + testImplementation "junit:junit:${JUNIT_4_VERSION}" + testImplementation "org.junit.platform:junit-platform-runner:${JUNIT_PLATFORM_RUNNER_VERSION}" + testImplementation "org.junit.vintage:junit-vintage-engine:${JUNIT_JUPITER_VERSION}" + testImplementation "org.hamcrest:java-hamcrest:${HAMCREST_VERSION}" + testImplementation "org.junit.jupiter:junit-jupiter-params:${JUNIT_JUPITER_VERSION}" + testImplementation "org.mockito:mockito-all:${MOCKITO_VERSION}" + testImplementation "org.junit.jupiter:junit-jupiter-engine:${JUNIT_JUPITER_VERSION}" testImplementation("org.junit.jupiter:junit-jupiter:${JUNIT_JUPITER_VERSION}") } diff --git a/playground/build.gradle b/playground/build.gradle index 2f06a96e3..35135b9d7 100644 --- a/playground/build.gradle +++ b/playground/build.gradle @@ -11,20 +11,20 @@ repositories { } dependencies { - testCompile "org.seleniumhq.selenium:selenium-java:${SELENIUM_VERSION}" - testCompile "org.junit.jupiter:junit-jupiter-api:${JUNIT_JUPITER_VERSION}" - testCompile "junit:junit:${JUNIT_4_VERSION}" - testCompile "org.junit.platform:junit-platform-runner:${JUNIT_PLATFORM_RUNNER_VERSION}" - testCompile "org.junit.vintage:junit-vintage-engine:${JUNIT_JUPITER_VERSION}" - testCompile "org.junit.jupiter:junit-jupiter-params:${JUNIT_JUPITER_VERSION}" - testCompile "org.junit.jupiter:junit-jupiter-engine:${JUNIT_JUPITER_VERSION}" + testImplementation "org.seleniumhq.selenium:selenium-java:${SELENIUM_VERSION}" + testImplementation "org.junit.jupiter:junit-jupiter-api:${JUNIT_JUPITER_VERSION}" + testImplementation "junit:junit:${JUNIT_4_VERSION}" + testImplementation "org.junit.platform:junit-platform-runner:${JUNIT_PLATFORM_RUNNER_VERSION}" + testImplementation "org.junit.vintage:junit-vintage-engine:${JUNIT_JUPITER_VERSION}" + testImplementation "org.junit.jupiter:junit-jupiter-params:${JUNIT_JUPITER_VERSION}" + testImplementation "org.junit.jupiter:junit-jupiter-engine:${JUNIT_JUPITER_VERSION}" testImplementation("org.junit.jupiter:junit-jupiter:${JUNIT_JUPITER_VERSION}") constraints { - compile('com.google.guava:guava:30.0-jre') { + implementation('com.google.guava:guava:30.0-jre') { because 'Versions prior to 30.0 are impacted by CVE-2020-8908' } - compile('com.google.guava:guava:30.0-android') { + implementation('com.google.guava:guava:30.0-android') { because 'Versions prior to 30.0 are impacted by CVE-2020-8908' } } diff --git a/profile/build.gradle b/profile/build.gradle index c08de8d72..5165adc7d 100644 --- a/profile/build.gradle +++ b/profile/build.gradle @@ -18,18 +18,18 @@ * This file was generated by the Gradle "init" task. */ dependencies { - compile project(":common") - compile project(":custom") - compile project(":core") - compile group: "org.apache.commons", name: "commons-csv", version: "${COMMONS_CSV_VERSION}" - compile group: "commons-io", name: "commons-io", version: "${COMMONS_IO_VERSION}" - compile group: "com.google.inject", name: "guice", version: "${GUICE_VERSION}" - compile "com.worldturner.medeia:medeia-validator-jackson:${MEDEIA_VALIDATOR_JACKSON_VERSION}" - compile "org.leadpony.justify:justify:${LEADPONY_JUSTIFY_VERSION}" - compile "org.glassfish:javax.json:${GLASSFISH_VERSION}" - compile "com.fasterxml.jackson.core:jackson-core:${JACKSON_VERSION}" - compile "com.fasterxml.jackson.core:jackson-annotations:${JACKSON_VERSION}" - compile "com.fasterxml.jackson.core:jackson-databind:${JACKSON_VERSION}" + implementation project(":common") + implementation project(":custom") + implementation project(":core") + implementation group: "org.apache.commons", name: "commons-csv", version: "${COMMONS_CSV_VERSION}" + implementation group: "commons-io", name: "commons-io", version: "${COMMONS_IO_VERSION}" + implementation group: "com.google.inject", name: "guice", version: "${GUICE_VERSION}" + implementation "com.worldturner.medeia:medeia-validator-jackson:${MEDEIA_VALIDATOR_JACKSON_VERSION}" + implementation "org.leadpony.justify:justify:${LEADPONY_JUSTIFY_VERSION}" + implementation "org.glassfish:javax.json:${GLASSFISH_VERSION}" + implementation "com.fasterxml.jackson.core:jackson-core:${JACKSON_VERSION}" + implementation "com.fasterxml.jackson.core:jackson-annotations:${JACKSON_VERSION}" + implementation "com.fasterxml.jackson.core:jackson-databind:${JACKSON_VERSION}" implementation "com.github.javafaker:javafaker:${FAKER_VERSION}" implementation ('org.yaml:snakeyaml') { version { @@ -38,28 +38,28 @@ dependencies { } constraints { - compile('com.google.guava:guava:30.0-jre') { + implementation('com.google.guava:guava:30.0-jre') { because 'Versions prior to 30.0 are impacted by CVE-2020-8908' } - compile('com.google.guava:guava:30.0-android') { + implementation('com.google.guava:guava:30.0-android') { because 'Versions prior to 30.0 are impacted by CVE-2020-8908' } } - testCompile project(":common").sourceSets.test.output - testCompile "org.junit.jupiter:junit-jupiter-api:${JUNIT_JUPITER_VERSION}" - testCompile "junit:junit:${JUNIT_4_VERSION}" - testCompile "org.junit.platform:junit-platform-runner:${JUNIT_PLATFORM_RUNNER_VERSION}" - testCompile "org.junit.vintage:junit-vintage-engine:${JUNIT_JUPITER_VERSION}" - testCompile "org.hamcrest:java-hamcrest:${HAMCREST_VERSION}" - testCompile "org.junit.jupiter:junit-jupiter-params:${JUNIT_PLATFORM_RUNNER_VERSION}" - testCompile "org.junit.jupiter:junit-jupiter-engine:${JUNIT_JUPITER_VERSION}" - testCompile "com.shazam:shazamcrest:${SHAZAMCREST_VERSION}" + testImplementation project(":common").sourceSets.test.output + testImplementation "org.junit.jupiter:junit-jupiter-api:${JUNIT_JUPITER_VERSION}" + testImplementation "junit:junit:${JUNIT_4_VERSION}" + testImplementation "org.junit.platform:junit-platform-runner:${JUNIT_PLATFORM_RUNNER_VERSION}" + testImplementation "org.junit.vintage:junit-vintage-engine:${JUNIT_JUPITER_VERSION}" + testImplementation "org.hamcrest:java-hamcrest:${HAMCREST_VERSION}" + testImplementation "org.junit.jupiter:junit-jupiter-params:${JUNIT_PLATFORM_RUNNER_VERSION}" + testImplementation "org.junit.jupiter:junit-jupiter-engine:${JUNIT_JUPITER_VERSION}" + testImplementation "com.shazam:shazamcrest:${SHAZAMCREST_VERSION}" testImplementation "org.mockito:mockito-junit-jupiter:${MOCKITO_JUNIT_JUPITER_VERSION}" testImplementation("org.junit.jupiter:junit-jupiter:${JUNIT_JUPITER_VERSION}") testImplementation "org.threeten:threeten-extra:${THREE_TEN_VERSION}" - testCompile project(":core").sourceSets.test.output + testImplementation project(":core").sourceSets.test.output implementation('org.jetbrains.kotlin:kotlin-stdlib') { version {