2021-09-08 21:46:47 +02:00
|
|
|
import org.gradle.util.GradleVersion
|
|
|
|
|
2019-04-04 22:14:51 +02:00
|
|
|
plugins {
|
2020-02-29 20:57:33 +01:00
|
|
|
id 'java-library'
|
2019-04-04 22:14:51 +02:00
|
|
|
id 'com.google.protobuf'
|
2021-04-26 15:36:28 +02:00
|
|
|
id 'maven-publish'
|
2019-04-04 22:14:51 +02:00
|
|
|
id 'eclipse'
|
|
|
|
}
|
2018-03-06 21:13:17 +01:00
|
|
|
|
2021-10-10 12:09:32 +02:00
|
|
|
version = '0.17-SNAPSHOT'
|
2018-03-06 21:13:17 +01:00
|
|
|
|
|
|
|
dependencies {
|
2022-11-14 00:36:16 +01:00
|
|
|
api 'org.bouncycastle:bcprov-jdk15to18:1.72'
|
2022-04-01 18:06:08 +02:00
|
|
|
api 'com.google.guava:guava:31.1-android'
|
2023-01-29 21:59:16 +01:00
|
|
|
api 'com.google.protobuf:protobuf-javalite:3.21.12'
|
2022-02-17 22:34:14 +01:00
|
|
|
implementation 'org.slf4j:slf4j-api:1.7.36'
|
2018-03-06 21:13:17 +01:00
|
|
|
implementation 'net.jcip:jcip-annotations:1.0'
|
2021-12-14 11:45:39 +01:00
|
|
|
testImplementation 'junit:junit:4.13.2'
|
2023-01-29 21:52:41 +01:00
|
|
|
testImplementation 'org.easymock:easymock:5.1.0'
|
2022-11-14 00:50:12 +01:00
|
|
|
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.14.0'
|
2022-02-17 22:34:14 +01:00
|
|
|
testImplementation 'org.slf4j:slf4j-jdk14:1.7.36'
|
2022-11-14 00:52:11 +01:00
|
|
|
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.11'
|
2021-12-14 15:57:01 +01:00
|
|
|
testImplementation 'org.hamcrest:hamcrest-library:2.2'
|
2022-08-18 22:00:12 +02:00
|
|
|
testImplementation 'pl.pragmatists:JUnitParams:1.1.1'
|
2018-03-06 21:13:17 +01:00
|
|
|
}
|
|
|
|
|
2021-09-08 21:46:47 +02:00
|
|
|
sourceCompatibility = 8
|
|
|
|
targetCompatibility = 8
|
2018-10-31 11:12:49 +01:00
|
|
|
compileJava.options.encoding = 'UTF-8'
|
|
|
|
compileTestJava.options.encoding = 'UTF-8'
|
2019-07-26 17:11:08 +02:00
|
|
|
javadoc.options.encoding = 'UTF-8'
|
2022-02-12 02:17:41 +01:00
|
|
|
// Uncomment the following line to see all the JavaDoc warnings
|
|
|
|
//javadoc.options.addStringOption('Xmaxwarns', '10000')
|
2018-03-06 21:13:17 +01:00
|
|
|
|
2021-09-08 21:46:47 +02:00
|
|
|
compileJava {
|
|
|
|
options.compilerArgs.addAll(['--release', '8'])
|
2022-04-18 19:42:38 +02:00
|
|
|
options.compilerArgs << '-Xlint:deprecation'
|
2021-09-08 21:46:47 +02:00
|
|
|
}
|
|
|
|
|
2018-07-27 14:10:10 +02:00
|
|
|
protobuf {
|
2019-02-23 22:52:01 +01:00
|
|
|
protoc {
|
2023-01-29 21:59:16 +01:00
|
|
|
artifact = 'com.google.protobuf:protoc:3.21.12'
|
2019-02-23 22:52:01 +01:00
|
|
|
}
|
2019-10-08 20:47:25 +02:00
|
|
|
generateProtoTasks {
|
|
|
|
all().each { task ->
|
|
|
|
task.builtins {
|
|
|
|
java {
|
|
|
|
option "lite"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-07-27 14:10:10 +02:00
|
|
|
generatedFilesBaseDir = new File(projectDir, '/src') // workaround for '$projectDir/src'
|
|
|
|
}
|
|
|
|
|
2021-12-28 20:11:33 +01:00
|
|
|
tasks.withType(Test) {
|
2019-03-15 12:09:05 +01:00
|
|
|
exclude 'org/bitcoinj/net/discovery/DnsDiscoveryTest*'
|
2019-02-15 15:54:28 +01:00
|
|
|
testLogging {
|
|
|
|
events "failed"
|
|
|
|
exceptionFormat "full"
|
|
|
|
}
|
2018-03-06 21:13:17 +01:00
|
|
|
}
|
|
|
|
|
2021-12-28 20:11:33 +01:00
|
|
|
// Test with default Java toolchain
|
|
|
|
test {
|
|
|
|
doFirst {
|
|
|
|
logger.lifecycle("Testing with default toolchain")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def gradleVersionToolchains = GradleVersion.version("6.7")
|
|
|
|
|
|
|
|
if (GradleVersion.current().compareTo(gradleVersionToolchains) > 0) {
|
|
|
|
// If the Gradle Java Toolchains feature is available, run tests on older JDKs
|
|
|
|
System.err.println "Adding 'testOnJdk8' task, because ${GradleVersion.current()}"
|
|
|
|
|
|
|
|
task('testOnJdk8', type: Test) {
|
|
|
|
doFirst {
|
|
|
|
logger.lifecycle("Testing with JDK ${javaLauncher.get().metadata.javaRuntimeVersion}")
|
|
|
|
}
|
|
|
|
javaLauncher = javaToolchains.launcherFor {
|
|
|
|
languageVersion = JavaLanguageVersion.of(8)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Activate if `testJdk8` is `true` in `gradle.properties` or `-PtestJdk8=true` is on command-line
|
|
|
|
if (Boolean.valueOf(findProperty('testJdk8'))) {
|
|
|
|
check.dependsOn testOnJdk8
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-05 00:07:33 +02:00
|
|
|
ext.moduleName = 'org.bitcoinj.core'
|
|
|
|
|
|
|
|
jar {
|
|
|
|
inputs.property("moduleName", moduleName)
|
|
|
|
manifest {
|
|
|
|
attributes 'Automatic-Module-Name': moduleName
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-06 21:13:17 +01:00
|
|
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
|
|
classifier = 'javadoc'
|
|
|
|
from javadoc.destinationDir
|
|
|
|
}
|
|
|
|
|
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
|
|
classifier = 'sources'
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives sourcesJar
|
|
|
|
archives javadocJar
|
|
|
|
}
|
2021-10-06 00:20:33 +02:00
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
mavenJava(MavenPublication) {
|
|
|
|
artifactId = 'bitcoinj-core'
|
|
|
|
from components.java
|
|
|
|
artifact sourcesJar
|
|
|
|
artifact javadocJar
|
|
|
|
|
|
|
|
pom {
|
|
|
|
description = 'A Java Bitcoin library'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|