Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 30 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,9 @@ allprojects {
}

subprojects {
// To support nativeTest, we are migrating away from all subprojects using Spock by default
def spockLess = ["consensusj-jrpc", "consensusj-jrpc-echod"]
boolean useSpock = !spockLess.contains(it.name)

dependencies {
implementation "org.slf4j:slf4j-api:${slf4jVersion}"

testImplementation platform("org.junit:junit-bom:${junitJupiterVersion}")

if (useSpock) {
testImplementation "org.apache.groovy:groovy:${groovyVersion}"
testImplementation("org.spockframework:spock-core:${spockVersion}") {
exclude module: "groovy-all"
}

testRuntimeOnly "org.junit.platform:junit-platform-launcher"
testRuntimeOnly "net.bytebuddy:byte-buddy:1.17.7"
// allows Spock to mock classes (in addition to interfaces)
testRuntimeOnly "org.objenesis:objenesis:3.4"
// Allow Spock to mock classes with constructor arguments
testRuntimeOnly "org.slf4j:slf4j-jdk14:${slf4jVersion}" // Runtime implementation of slf4j
}
}

configurations.configureEach {
Expand Down Expand Up @@ -122,8 +103,36 @@ subprojects {
options.noTimestamp = true
}

tasks.withType(Test).configureEach {
useJUnitPlatform() // We're using Spock 2 and JUnit 5
// To support nativeTest, we are migrating away from having all subprojects use Spock by default
def spockLess = ["consensusj-jrpc", "consensusj-jrpc-echod"]
boolean useSpock = !spockLess.contains(it.name)

testing {
suites {
configureEach {
useJUnitJupiter()
dependencies {
implementation platform("org.junit:junit-bom:${junitJupiterVersion}")

implementation "org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}"
runtimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}"

runtimeOnly "org.slf4j:slf4j-jdk14:${slf4jVersion}"

annotationProcessor "com.uber.nullaway:nullaway:${nullAwayVersion}"

if (useSpock) {
implementation "org.apache.groovy:groovy:${groovyVersion}"
implementation("org.spockframework:spock-core:${spockVersion}") {
exclude module: "groovy-all"
}

runtimeOnly "net.bytebuddy:byte-buddy:1.17.7" // Lets Spock mock classes (in addition to interfaces)
runtimeOnly "org.objenesis:objenesis:3.4" // Lets Spock mock classes with constructor arguments
}
}
}
}
}
}

Expand Down
4 changes: 0 additions & 4 deletions cj-btc-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ dependencies {

// Add SLF4J runtime adapter for JDK logging for GraalVM native-image build of bitcoin CLI tool
nativeToolImplementation "org.slf4j:slf4j-jdk14:${slf4jVersion}"

testImplementation "org.apache.groovy:groovy:${groovyVersion}"

testRuntimeOnly "org.slf4j:slf4j-jdk14:${slf4jVersion}"
}

testing {
Expand Down
13 changes: 0 additions & 13 deletions consensusj-jrpc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,6 @@ tasks.withType(JavaCompile) {

testing {
suites {
configureEach {
useJUnitJupiter()
dependencies {
implementation platform("org.junit:junit-bom:${junitJupiterVersion}")

implementation "org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}"
runtimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}"

runtimeOnly "org.slf4j:slf4j-jdk14:${slf4jVersion}"

annotationProcessor "com.uber.nullaway:nullaway:${nullAwayVersion}"
}
}
integrationTest(JvmTestSuite) {
dependencies {
implementation project()
Expand Down
3 changes: 0 additions & 3 deletions consensusj-jsonrpc-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ dependencies {
api 'commons-cli:commons-cli:1.11.0'

implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-toml:${jacksonVersion}"

testImplementation "org.apache.groovy:groovy:${groovyVersion}"
testRuntimeOnly "org.slf4j:slf4j-jdk14:${slf4jVersion}"
}

jar {
Expand Down
8 changes: 0 additions & 8 deletions consensusj-jsonrpc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,7 @@ dependencies {

testImplementation project(':cj-btc-jsonrpc')

testImplementation "org.apache.groovy:groovy:${groovyVersion}"
testImplementation ("org.apache.groovy:groovy-json:${groovyVersion}") {
transitive = false
}

testRuntimeOnly "org.slf4j:slf4j-jdk14:${slf4jVersion}"

annotationProcessor "com.uber.nullaway:nullaway:${nullAwayVersion}"
testAnnotationProcessor "com.uber.nullaway:nullaway:${nullAwayVersion}"
errorprone "com.google.errorprone:error_prone_core:${errorProneVersion}"
}

Expand Down
Loading