diff --git a/core/build.gradle b/core/build.gradle index 6f61f55bf..948d9b40f 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -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' diff --git a/examples-kotlin/build.gradle b/examples-kotlin/build.gradle index 0436336b7..9e4d74947 100644 --- a/examples-kotlin/build.gradle +++ b/examples-kotlin/build.gradle @@ -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' diff --git a/examples/build.gradle b/examples/build.gradle index 74a31917f..1d0f47e8b 100644 --- a/examples/build.gradle +++ b/examples/build.gradle @@ -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' diff --git a/integration-test/build.gradle b/integration-test/build.gradle index 174668331..bf271f498 100644 --- a/integration-test/build.gradle +++ b/integration-test/build.gradle @@ -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*' diff --git a/tools/build.gradle b/tools/build.gradle index e05868152..c5638f479 100644 --- a/tools/build.gradle +++ b/tools/build.gradle @@ -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' diff --git a/wallettemplate/build.gradle b/wallettemplate/build.gradle index 148ee74de..c44f50906 100644 --- a/wallettemplate/build.gradle +++ b/wallettemplate/build.gradle @@ -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 { diff --git a/wallettool/build.gradle b/wallettool/build.gradle index 5bd3fee12..d87028d7c 100644 --- a/wallettool/build.gradle +++ b/wallettool/build.gradle @@ -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"