From 5a852df6cc413dd48ea13143f56c3eaed77edf1a Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Sun, 1 Sep 2024 10:19:44 -0700 Subject: [PATCH] test-support: add new module for test data and utilities --- core/build.gradle | 2 ++ settings-debian.gradle | 3 +++ settings.gradle | 3 +++ test-support/build.gradle | 22 ++++++++++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 test-support/build.gradle diff --git a/core/build.gradle b/core/build.gradle index f76d89289..02247d2fc 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -14,6 +14,8 @@ dependencies { api 'com.google.protobuf:protobuf-javalite:4.27.3' implementation 'org.slf4j:slf4j-api:2.0.13' implementation 'net.jcip:jcip-annotations:1.0' + + testImplementation project(':bitcoinj-test-support') testImplementation 'junit:junit:4.13.2' testImplementation 'org.easymock:easymock:5.4.0' testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2' diff --git a/settings-debian.gradle b/settings-debian.gradle index e7b64c810..b4fa5c838 100644 --- a/settings-debian.gradle +++ b/settings-debian.gradle @@ -19,6 +19,9 @@ if (!JavaVersion.current().isJava11Compatible()) { rootProject.name = 'bitcoinj-parent' +include 'test-support' +project(':test-support').name = 'bitcoinj-test-support' + include 'core' project(':core').name = 'bitcoinj-core' diff --git a/settings.gradle b/settings.gradle index 264929a57..93d503f3a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,6 +17,9 @@ if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) { throw new GradleScriptException("bitcoinj build requires Java 17 or later", null) } +include 'test-support' +project(':test-support').name = 'bitcoinj-test-support' + include 'core' project(':core').name = 'bitcoinj-core' diff --git a/test-support/build.gradle b/test-support/build.gradle new file mode 100644 index 000000000..2149f62af --- /dev/null +++ b/test-support/build.gradle @@ -0,0 +1,22 @@ +plugins { + id 'java-library' +} + +dependencies { + api project(':bitcoinj-core') +} + +tasks.withType(JavaCompile) { + options.compilerArgs.addAll(['--release', '8']) + options.compilerArgs << '-Xlint:deprecation' + options.encoding = 'UTF-8' +} + +ext.moduleName = 'org.bitcoinj.test-support' + +jar { + inputs.property("moduleName", moduleName) + manifest { + attributes 'Automatic-Module-Name': moduleName + } +}