Skip to content

Commit

Permalink
Remove bitcoind's dependency to root build-logic module
Browse files Browse the repository at this point in the history
We can't depend on Bisq 2's build-logic module to be able to reuse the
wallets library in Bisq 1.
  • Loading branch information
alvasw committed Sep 20, 2024
1 parent 5f17bb0 commit 19b2287
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 0 deletions.
11 changes: 11 additions & 0 deletions wallets/bitcoind/build-logic/commons/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
plugins {
`kotlin-dsl`
}

repositories {
gradlePluginPortal()
}

dependencies {
implementation(libs.protobuf.gradle.plugin)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
plugins {
`java-library`
}

repositories {
mavenCentral()
maven {
url = uri("https://jitpack.io")
}
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}

tasks {
test {
useJUnitPlatform()
}
}

val versionCatalog = extensions.getByType<VersionCatalogsExtension>().named("libs")
dependencies {
versionCatalog.findLibrary("google-guava").ifPresent {
implementation(it)
}

versionCatalog.findLibrary("lombok").ifPresent {
compileOnly(it)
annotationProcessor(it)
testAnnotationProcessor(it)
testCompileOnly(it)
}

versionCatalog.findLibrary("slf4j-api").ifPresent {
implementation(it)
}

versionCatalog.findLibrary("logback-core").ifPresent {
implementation(it)
}
versionCatalog.findLibrary("logback-classic").ifPresent {
implementation(it)
}

versionCatalog.findLibrary("junit-jupiter").ifPresent {
testImplementation(it)
}

versionCatalog.findLibrary("assertj-core").ifPresent {
testImplementation(it)
}

versionCatalog.findLibrary("mockito").ifPresent {
testImplementation(it)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
plugins {
java
}

sourceSets {
create("integrationTest") {
compileClasspath += sourceSets.main.get().output
runtimeClasspath += sourceSets.main.get().output
}
}

val integrationTestImplementation by configurations.getting {
extendsFrom(configurations.implementation.get())
}

val integrationTestRuntimeOnly by configurations.getting
configurations["integrationTestRuntimeOnly"].extendsFrom(configurations.runtimeOnly.get())

val versionCatalog = extensions.getByType<VersionCatalogsExtension>().named("libs")
dependencies {
versionCatalog.findLibrary("lombok").ifPresent {
"integrationTestAnnotationProcessor"(it)
"integrationTestCompileOnly"(it)
}

versionCatalog.findLibrary("slf4j-api").ifPresent {
"integrationTestImplementation"(it)
}

versionCatalog.findLibrary("logback-core").ifPresent {
"integrationTestImplementation"(it)
}
versionCatalog.findLibrary("logback-classic").ifPresent {
"integrationTestImplementation"(it)
}

versionCatalog.findLibrary("junit-jupiter").ifPresent {
"integrationTestImplementation"(it)
}

versionCatalog.findLibrary("assertj-core").ifPresent {
"integrationTestImplementation"(it)
}
}

tasks.register<Test>("integrationTest") {
description = "Runs integration tests."
group = "verification"

testClassesDirs = sourceSets["integrationTest"].output.classesDirs
classpath = sourceSets["integrationTest"].runtimeClasspath
shouldRunAfter("test")

useJUnitPlatform()

testLogging {
events("passed")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id("bisq.java-conventions")
}
1 change: 1 addition & 0 deletions wallets/bitcoind/build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencyResolutionManagement {
}
}

include("commons")
include("bitcoin-core-binaries")
include("gradle-tasks")

Expand Down

0 comments on commit 19b2287

Please sign in to comment.