Skip to content

Commit

Permalink
build.gradle: use tasks.withType() to apply options to tests as well
Browse files Browse the repository at this point in the history
  • Loading branch information
schildbach committed Aug 29, 2024
1 parent 94bb527 commit 34c1e4b
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 40 deletions.
13 changes: 6 additions & 7 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,16 @@ if (GradleVersion.current().compareTo(gradleVersionTargetJVM) > 0) {

sourceCompatibility = 8
targetCompatibility = 8
compileJava.options.encoding = 'UTF-8'
compileTestJava.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 {
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')

protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:4.27.3'
Expand Down
11 changes: 5 additions & 6 deletions examples-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
9 changes: 4 additions & 5 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
11 changes: 5 additions & 6 deletions integration-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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*'
Expand Down
9 changes: 4 additions & 5 deletions tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
11 changes: 5 additions & 6 deletions wallettemplate/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 4 additions & 5 deletions wallettool/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 34c1e4b

Please sign in to comment.