From 168fbaa3c1341e99af8adb4598479074eff1b43a Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Sat, 5 Aug 2023 14:51:26 +0200 Subject: [PATCH] apitest: Move build configuration to its own build.gradle --- apitest/build.gradle | 99 ++++++++++++++++++++++++++++++++++++++++++ build.gradle | 101 ------------------------------------------- 2 files changed, 99 insertions(+), 101 deletions(-) diff --git a/apitest/build.gradle b/apitest/build.gradle index 1a0dabb93c1..e99e51b4570 100644 --- a/apitest/build.gradle +++ b/apitest/build.gradle @@ -1,3 +1,102 @@ plugins { id 'bisq.java-conventions' } + +mainClassName = 'bisq.apitest.ApiTestMain' + +// The external dao-setup.gradle file contains tasks to install and clean dao-setup +// files downloaded from +// https://github.com/bisq-network/bisq/raw/master/docs/dao-setup.zip +// These tasks are not run by the default build, but they can can be run during +// full or partial builds, or by themselves. +// To run the regular clean + build + test (non api), and install dao-setup files: +// ./gradlew clean build :apitest:installDaoSetup +// To install or re-install dao-setup file only: +// ./gradlew :apitest:installDaoSetup -x test +// To clean installed dao-setup files: +// ./gradlew :apitest:cleanDaoSetup -x test +apply from: 'dao-setup.gradle' + +// We have to disable the :apitest 'test' task by default because we do not want +// to interfere with normal builds. To run JUnit tests in this subproject: +// Run a normal build and install dao-setup files first, then run: +// 'gradle :apitest:test -DrunApiTests=true' +test.enabled = System.getProperty("runApiTests") == "true" + +sourceSets { + main { + resources { + exclude 'dao-setup' + exclude 'dao-setup.zip' + } + } +} + +test { + outputs.upToDateWhen { false } // Don't use previously cached test outputs. + testLogging { + showStackTraces = true // Show full stack traces in the console. + exceptionFormat = "full" + // Show passed & failed tests, and anything printed to stderr by the tests in the console. + // Do not show skipped tests in the console; they are shown in the html report. + events "passed", "failed", "standardError" + } + + afterSuite { desc, result -> + if (!desc.parent) { + println("${result.resultType} " + + "[${result.testCount} tests, " + + "${result.successfulTestCount} passed, " + + "${result.failedTestCount} failed, " + + "${result.skippedTestCount} skipped] html report contains skipped test info") + + // Show report link if all tests passed in case you want to see more detail, stdout, skipped, etc. + if (result.resultType == TestResult.ResultType.SUCCESS) { + DirectoryReport htmlReport = getReports().getHtml() + String reportUrl = new org.gradle.internal.logging.ConsoleRenderer() + .asClickableFileUrl(htmlReport.getEntryPoint()) + println("REPORT " + reportUrl) + } + } + } +} + +dependencies { + implementation enforcedPlatform(project(':platform')) + implementation project(':proto') + implementation project(':common') + implementation project(':core') + implementation project(':seednode') + implementation project(':desktop') + implementation project(':daemon') + implementation project(':cli') + annotationProcessor libs.lombok + compileOnly libs.javax.annotation + compileOnly libs.lombok + implementation libs.logback.classic + implementation libs.logback.core + implementation libs.google.gson + implementation libs.google.guava + implementation libs.jopt + implementation libs.apache.commons.lang3 + implementation libs.slf4j.api + implementation(libs.bitcoinj) { + exclude(module: 'bcprov-jdk15on') + exclude(module: 'guava') + exclude(module: 'jsr305') + exclude(module: 'okhttp') + exclude(module: 'okio') + exclude(module: 'slf4j-api') + } + implementation(libs.grpc.protobuf) { + exclude(module: 'animal-sniffer-annotations') + exclude(module: 'guava') + } + implementation(libs.grpc.stub) { + exclude(module: 'animal-sniffer-annotations') + exclude(module: 'guava') + } + testAnnotationProcessor libs.lombok + testCompileOnly libs.lombok + testRuntimeOnly libs.javax.annotation +} diff --git a/build.gradle b/build.gradle index 5e26b534f1e..933f3e2d93c 100644 --- a/build.gradle +++ b/build.gradle @@ -90,107 +90,6 @@ configure([project(':cli'), } } -configure(project(':apitest')) { - mainClassName = 'bisq.apitest.ApiTestMain' - - // The external dao-setup.gradle file contains tasks to install and clean dao-setup - // files downloaded from - // https://github.com/bisq-network/bisq/raw/master/docs/dao-setup.zip - // These tasks are not run by the default build, but they can can be run during - // full or partial builds, or by themselves. - // To run the regular clean + build + test (non api), and install dao-setup files: - // ./gradlew clean build :apitest:installDaoSetup - // To install or re-install dao-setup file only: - // ./gradlew :apitest:installDaoSetup -x test - // To clean installed dao-setup files: - // ./gradlew :apitest:cleanDaoSetup -x test - apply from: 'dao-setup.gradle' - - // We have to disable the :apitest 'test' task by default because we do not want - // to interfere with normal builds. To run JUnit tests in this subproject: - // Run a normal build and install dao-setup files first, then run: - // 'gradle :apitest:test -DrunApiTests=true' - test.enabled = System.getProperty("runApiTests") == "true" - - sourceSets { - main { - resources { - exclude 'dao-setup' - exclude 'dao-setup.zip' - } - } - } - - test { - outputs.upToDateWhen { false } // Don't use previously cached test outputs. - testLogging { - showStackTraces = true // Show full stack traces in the console. - exceptionFormat = "full" - // Show passed & failed tests, and anything printed to stderr by the tests in the console. - // Do not show skipped tests in the console; they are shown in the html report. - events "passed", "failed", "standardError" - } - - afterSuite { desc, result -> - if (!desc.parent) { - println("${result.resultType} " + - "[${result.testCount} tests, " + - "${result.successfulTestCount} passed, " + - "${result.failedTestCount} failed, " + - "${result.skippedTestCount} skipped] html report contains skipped test info") - - // Show report link if all tests passed in case you want to see more detail, stdout, skipped, etc. - if (result.resultType == TestResult.ResultType.SUCCESS) { - DirectoryReport htmlReport = getReports().getHtml() - String reportUrl = new org.gradle.internal.logging.ConsoleRenderer() - .asClickableFileUrl(htmlReport.getEntryPoint()) - println("REPORT " + reportUrl) - } - } - } - } - - dependencies { - implementation enforcedPlatform(project(':platform')) - implementation project(':proto') - implementation project(':common') - implementation project(':core') - implementation project(':seednode') - implementation project(':desktop') - implementation project(':daemon') - implementation project(':cli') - annotationProcessor libs.lombok - compileOnly libs.javax.annotation - compileOnly libs.lombok - implementation libs.logback.classic - implementation libs.logback.core - implementation libs.google.gson - implementation libs.google.guava - implementation libs.jopt - implementation libs.apache.commons.lang3 - implementation libs.slf4j.api - implementation(libs.bitcoinj) { - exclude(module: 'bcprov-jdk15on') - exclude(module: 'guava') - exclude(module: 'jsr305') - exclude(module: 'okhttp') - exclude(module: 'okio') - exclude(module: 'slf4j-api') - } - implementation(libs.grpc.protobuf) { - exclude(module: 'animal-sniffer-annotations') - exclude(module: 'guava') - } - implementation(libs.grpc.stub) { - exclude(module: 'animal-sniffer-annotations') - exclude(module: 'guava') - } - testAnnotationProcessor libs.lombok - testCompileOnly libs.lombok - testRuntimeOnly libs.javax.annotation - } -} - if (hasProperty('buildScan')) { buildScan { termsOfServiceUrl = 'https://gradle.com/terms-of-service'