2022-02-12 10:06:18 -05:00
|
|
|
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.*
|
|
|
|
import org.gradle.api.tasks.testing.logging.TestLogEvent.*
|
2022-12-14 15:36:09 -05:00
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
2022-02-12 10:06:18 -05:00
|
|
|
|
2022-11-30 12:03:01 -05:00
|
|
|
// library version is defined in gradle.properties
|
|
|
|
val libraryVersion: String by project
|
|
|
|
|
2022-02-12 10:06:18 -05:00
|
|
|
plugins {
|
2024-03-28 12:28:42 -04:00
|
|
|
id("org.jetbrains.kotlin.jvm")
|
|
|
|
id("org.gradle.java-library")
|
|
|
|
id("org.gradle.maven-publish")
|
|
|
|
id("org.gradle.signing")
|
2022-04-05 22:17:12 -04:00
|
|
|
|
|
|
|
// Custom plugin to generate the native libs and bindings file
|
|
|
|
id("org.bitcoindevkit.plugins.generate-jvm-bindings")
|
2022-02-12 10:06:18 -05:00
|
|
|
}
|
|
|
|
|
2024-03-28 12:28:42 -04:00
|
|
|
// repositories {
|
|
|
|
// mavenCentral()
|
|
|
|
// }
|
2022-09-13 13:33:36 -04:00
|
|
|
|
2022-02-12 10:06:18 -05:00
|
|
|
java {
|
2023-06-05 10:35:23 -04:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
|
|
targetCompatibility = JavaVersion.VERSION_11
|
2022-02-12 10:06:18 -05:00
|
|
|
withSourcesJar()
|
2022-03-17 15:46:13 -05:00
|
|
|
withJavadocJar()
|
2022-02-12 10:06:18 -05:00
|
|
|
}
|
|
|
|
|
2023-10-27 14:13:44 -04:00
|
|
|
// This block ensures that the tests that require access to a blockchain are not
|
|
|
|
// run if the -P excludeConnectedTests flag is passed to gradle.
|
|
|
|
// This ensures our CI runs are not fickle by not requiring access to testnet.
|
|
|
|
// This is a workaround until we have a proper regtest setup for the CI.
|
|
|
|
// Note that the command in the CI is ./gradlew test -P excludeConnectedTests
|
|
|
|
tasks.test {
|
|
|
|
if (project.hasProperty("excludeConnectedTests")) {
|
|
|
|
exclude("**/LiveWalletTest.class")
|
|
|
|
exclude("**/LiveTxBuilderTest.class")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-10-25 15:25:16 -05:00
|
|
|
testing {
|
|
|
|
suites {
|
|
|
|
val test by getting(JvmTestSuite::class) {
|
|
|
|
useKotlinTest("1.6.10")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-02-12 10:06:18 -05:00
|
|
|
|
2023-10-25 15:25:16 -05:00
|
|
|
tasks.withType<Test> {
|
2022-02-12 10:06:18 -05:00
|
|
|
testLogging {
|
|
|
|
events(PASSED, SKIPPED, FAILED, STANDARD_OUT, STANDARD_ERROR)
|
|
|
|
exceptionFormat = FULL
|
|
|
|
showExceptions = true
|
|
|
|
showStackTraces = true
|
2023-10-25 15:25:16 -05:00
|
|
|
showCauses = true
|
2022-02-12 10:06:18 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
|
|
|
|
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7")
|
2024-01-24 13:44:55 -06:00
|
|
|
implementation("net.java.dev.jna:jna:5.14.0")
|
2022-02-12 10:06:18 -05:00
|
|
|
api("org.slf4j:slf4j-api:1.7.30")
|
2024-02-08 16:02:15 -05:00
|
|
|
|
|
|
|
// testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.1")
|
|
|
|
// testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.1")
|
|
|
|
// testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.8.2")
|
2022-02-12 10:06:18 -05:00
|
|
|
testImplementation("ch.qos.logback:logback-classic:1.2.3")
|
|
|
|
testImplementation("ch.qos.logback:logback-core:1.2.3")
|
|
|
|
}
|
|
|
|
|
|
|
|
afterEvaluate {
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
create<MavenPublication>("maven") {
|
|
|
|
groupId = "org.bitcoindevkit"
|
|
|
|
artifactId = "bdk-jvm"
|
2022-11-30 12:03:01 -05:00
|
|
|
version = libraryVersion
|
2022-02-12 10:06:18 -05:00
|
|
|
|
|
|
|
from(components["java"])
|
|
|
|
pom {
|
|
|
|
name.set("bdk-jvm")
|
|
|
|
description.set("Bitcoin Dev Kit Kotlin language bindings.")
|
|
|
|
url.set("https://bitcoindevkit.org")
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name.set("APACHE 2.0")
|
|
|
|
url.set("https://github.com/bitcoindevkit/bdk/blob/master/LICENSE-APACHE")
|
|
|
|
}
|
|
|
|
license {
|
|
|
|
name.set("MIT")
|
|
|
|
url.set("https://github.com/bitcoindevkit/bdk/blob/master/LICENSE-MIT")
|
|
|
|
}
|
|
|
|
}
|
2024-03-27 09:30:59 -04:00
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id.set("bdkdevelopers")
|
|
|
|
name.set("Bitcoin Dev Kit Developers")
|
|
|
|
email.set("dev@bitcoindevkit.org")
|
|
|
|
}
|
|
|
|
}
|
2022-02-12 10:06:18 -05:00
|
|
|
scm {
|
|
|
|
connection.set("scm:git:github.com/bitcoindevkit/bdk-ffi.git")
|
|
|
|
developerConnection.set("scm:git:ssh://github.com/bitcoindevkit/bdk-ffi.git")
|
|
|
|
url.set("https://github.com/bitcoindevkit/bdk-ffi/tree/master")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
signing {
|
2022-08-31 09:41:52 -04:00
|
|
|
val signingKeyId: String? by project
|
|
|
|
val signingKey: String? by project
|
|
|
|
val signingPassword: String? by project
|
|
|
|
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
|
2022-02-12 10:06:18 -05:00
|
|
|
sign(publishing.publications)
|
|
|
|
}
|
2022-12-14 15:36:09 -05:00
|
|
|
|
|
|
|
// This task dependency ensures that we build the bindings
|
|
|
|
// binaries before running the tests
|
|
|
|
tasks.withType<KotlinCompile> {
|
|
|
|
dependsOn("buildJvmLib")
|
2023-06-05 10:35:23 -04:00
|
|
|
|
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = "11"
|
|
|
|
}
|
2022-12-14 15:36:09 -05:00
|
|
|
}
|