From 0b092b352dc29ce69f6f126eb7857a1243a6ef62 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Tue, 23 Feb 2021 11:46:06 +0100 Subject: Extract testing conventions from Kotlin conventions This change extracts the configuration for test from the Kotlin library conventions. --- .../src/main/kotlin/testing-conventions.gradle.kts | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 simulator/buildSrc/src/main/kotlin/testing-conventions.gradle.kts (limited to 'simulator/buildSrc/src/main/kotlin/testing-conventions.gradle.kts') diff --git a/simulator/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/simulator/buildSrc/src/main/kotlin/testing-conventions.gradle.kts new file mode 100644 index 00000000..5a19bfe0 --- /dev/null +++ b/simulator/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -0,0 +1,38 @@ +import org.gradle.kotlin.dsl.`java-library` +import org.gradle.kotlin.dsl.kotlin +import org.gradle.platform.base.Library + +/* + * Copyright (c) 2021 AtLarge Research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +plugins { + `java-library` +} + +tasks.test { + useJUnitPlatform() +} + +dependencies { + testImplementation("org.junit.jupiter:junit-jupiter-api:${Versions.JUNIT_JUPITER}") + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${Versions.JUNIT_JUPITER}") +} -- cgit v1.2.3 From 90de768b8bfb3acc222f508d2e602ef3b7f1ff91 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Tue, 23 Feb 2021 12:05:59 +0100 Subject: Move dependency versions to gradle.properties This change moves the version of the dependencies from buildSrc to gradle.properties to prevent recompilation when changing dependency versions. --- simulator/buildSrc/src/main/kotlin/testing-conventions.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'simulator/buildSrc/src/main/kotlin/testing-conventions.gradle.kts') diff --git a/simulator/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/simulator/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index 5a19bfe0..22ea7905 100644 --- a/simulator/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/simulator/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -33,6 +33,6 @@ tasks.test { } dependencies { - testImplementation("org.junit.jupiter:junit-jupiter-api:${Versions.JUNIT_JUPITER}") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${Versions.JUNIT_JUPITER}") + testImplementation("org.junit.jupiter:junit-jupiter-api:${versions.junitJupiter}") + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${versions.junitJupiter}") } -- cgit v1.2.3