From ba28806d743faba19e0f0ffa1be12932c7d4d85a Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Sun, 10 Nov 2024 22:12:31 +0000 Subject: [PATCH] gradle: Create bisq.java-integration-tests plugin The bisq.java-integration-tests plugin creates an integrationTest source set that depends on JUnit. The source set inherits the main source set's compile classpath, runtime classpath, and the implementation's source set configuration and runtimeOnly configuration. --- .../groovy/bisq.java-integration-tests.gradle | 26 +++++++++++++++++++ gradle/libs.versions.toml | 1 + gradle/verification-metadata.xml | 22 ++++++++++------ 3 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 build-logic/commons/src/main/groovy/bisq.java-integration-tests.gradle diff --git a/build-logic/commons/src/main/groovy/bisq.java-integration-tests.gradle b/build-logic/commons/src/main/groovy/bisq.java-integration-tests.gradle new file mode 100644 index 0000000000..e6b10b0866 --- /dev/null +++ b/build-logic/commons/src/main/groovy/bisq.java-integration-tests.gradle @@ -0,0 +1,26 @@ +sourceSets { + integrationTest { + compileClasspath += sourceSets.main.output + runtimeClasspath += sourceSets.main.output + } +} + +configurations { + integrationTestImplementation.extendsFrom implementation + integrationTestRuntimeOnly.extendsFrom runtimeOnly +} + +dependencies { + integrationTestImplementation libs.junit.jupiter +} + +tasks.register('integrationTest', Test) { + description = 'Runs integration tests.' + group = 'verification' + + testClassesDirs = sourceSets.integrationTest.output.classesDirs + classpath = sourceSets.integrationTest.runtimeClasspath + shouldRunAfter test + + useJUnitPlatform() +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 350badb0ad..a76638e22c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -99,6 +99,7 @@ jfoenix = { module = "com.jfoenix:jfoenix", version.ref = "jfoenix" } jopt = { module = "net.sf.jopt-simple:jopt-simple", version.ref = "jopt" } jsonrpc4j = { module = "com.github.bisq-network:jsonrpc4j", version.ref = "jsonrpc4j" } +junit-jupiter = { module = 'org.junit.jupiter:junit-jupiter', version.ref = 'junit-jupiter' } junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit-jupiter" } junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit-jupiter" } junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit-jupiter" } diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 8dc60d2673..4ad614144d 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -3247,14 +3247,20 @@ - - - - - - + + + + + + + + + + + + + +