build.gradle: use tasks.withType() to apply options to tests as well

This commit is contained in:
Andreas Schildbach 2024-08-29 22:56:59 +02:00
parent 94bb527447
commit 34c1e4b708
7 changed files with 33 additions and 40 deletions

View File

@ -39,17 +39,16 @@ if (GradleVersion.current().compareTo(gradleVersionTargetJVM) > 0) {
sourceCompatibility = 8
targetCompatibility = 8
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.compilerArgs.addAll(['--release', '8'])
options.compilerArgs << '-Xlint:deprecation'
options.encoding = 'UTF-8'
}
javadoc.options.encoding = 'UTF-8'
// Uncomment the following line to see all the JavaDoc warnings
//javadoc.options.addStringOption('Xmaxwarns', '10000')
compileJava {
options.compilerArgs.addAll(['--release', '8'])
options.compilerArgs << '-Xlint:deprecation'
}
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:4.27.3'

View File

@ -12,11 +12,10 @@ compileKotlin {
}
sourceCompatibility = 17
compileJava.options.release = 17
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'
compileJava {
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.release = 17
options.compilerArgs << '-Xlint:deprecation'
}
javadoc.options.encoding = 'UTF-8'

View File

@ -9,11 +9,10 @@ dependencies {
}
sourceCompatibility = 17
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'
compileJava {
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs.addAll(['--release', '17'])
options.compilerArgs << '-Xlint:deprecation'
}
javadoc.options.encoding = 'UTF-8'

View File

@ -19,15 +19,14 @@ dependencies {
}
sourceCompatibility = 17
compileJava.options.release = 17
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'
compileJava {
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.release = 17
options.compilerArgs << '-Xlint:deprecation'
}
javadoc.options.encoding = 'UTF-8'
test {
useJUnitPlatform()
exclude 'org/bitcoinj/core/PeerTest*'

View File

@ -9,15 +9,14 @@ dependencies {
}
sourceCompatibility = 17
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'
compileJava {
tasks.withType(JavaCompile) {
options.compilerArgs.addAll(['--release', '17'])
options.compilerArgs << '-Xlint:deprecation'
options.encoding = 'UTF-8'
}
javadoc.options.encoding = 'UTF-8'
task build_checkpoints(type: JavaExec) {
description = 'Create checkpoint files to use with CheckpointManager.'
main = 'org.bitcoinj.tools.BuildCheckpoints'

View File

@ -21,15 +21,14 @@ javafx {
}
sourceCompatibility = 17
compileJava.options.release = 17
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'
compileJava {
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.release = 17
options.compilerArgs << '-Xlint:deprecation'
}
javadoc.options.encoding = 'UTF-8'
mainClassName = 'wallettemplate.Main'
test {

View File

@ -32,15 +32,14 @@ dependencies {
}
sourceCompatibility = 17
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'
compileJava {
tasks.withType(JavaCompile) {
options.compilerArgs.addAll(['--release', '17'])
options.compilerArgs << '-Xlint:deprecation'
options.encoding = 'UTF-8'
}
javadoc.options.encoding = 'UTF-8'
mainClassName = "org.bitcoinj.wallettool.WalletTool"
applicationName = "wallet-tool"