Migrate jvm module Gradle build script to Kotlin DSL

This commit is contained in:
thunderbiscuit 2022-02-12 10:06:18 -05:00
parent 25f5bd26b4
commit 95ef8eb3de
No known key found for this signature in database
GPG Key ID: 88253696EB836462
2 changed files with 90 additions and 83 deletions

View File

@ -1,83 +0,0 @@
plugins {
id 'org.jetbrains.kotlin.jvm'
id 'java-library'
id 'maven-publish'
id 'signing'
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
test {
testLogging {
events "PASSED", "SKIPPED", "FAILED", "STANDARD_OUT", "STANDARD_ERROR"
}
}
dependencies {
implementation platform('org.jetbrains.kotlin:kotlin-bom')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "net.java.dev.jna:jna:5.8.0"
api "org.slf4j:slf4j-api:1.7.30"
testImplementation "junit:junit:4.13.2"
testImplementation "ch.qos.logback:logback-classic:1.2.3"
testImplementation "ch.qos.logback:logback-core:1.2.3"
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.java
groupId = 'org.bitcoindevkit'
artifactId = 'bdk-jvm'
version = '0.3.2'
pom {
name = 'bdk-jvm'
description = 'Bitcoin Dev Kit Kotlin language bindings.'
url = "https://bitcoindevkit.org"
licenses {
license {
name = "APACHE"
url = "https://github.com/bitcoindevkit/bdk/blob/master/LICENSE-APACHE"
}
license {
name = "MIT"
url = "https://github.com/bitcoindevkit/bdk/blob/master/LICENSE-MIT"
}
}
developers {
developer {
id = 'notmandatory'
name = 'Steve Myers'
email = 'notmandatory@noreply.github.org'
}
developer {
id = 'artfuldev'
name = 'Sudarsan Balaji'
email = 'sudarsan.balaji@artfuldev.com'
}
}
scm {
connection = 'scm:git:github.com/bitcoindevkit/bdk-ffi.git'
developerConnection = 'scm:git:ssh://github.com/bitcoindevkit/bdk-ffi.git'
url = 'https://github.com/bitcoindevkit/bdk-ffi/tree/master'
}
}
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications
}

90
jvm/build.gradle.kts Normal file
View File

@ -0,0 +1,90 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.*
import org.gradle.api.tasks.testing.logging.TestLogEvent.*
plugins {
id("org.jetbrains.kotlin.jvm")
id("java-library")
id("maven-publish")
id("signing")
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events(PASSED, SKIPPED, FAILED, STANDARD_OUT, STANDARD_ERROR)
exceptionFormat = FULL
showExceptions = true
showCauses = true
showStackTraces = true
}
}
dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7")
implementation("net.java.dev.jna:jna:5.8.0")
api("org.slf4j:slf4j-api:1.7.30")
testImplementation("junit:junit:4.13.2")
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"
version = "0.2.2"
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")
}
}
developers {
developer {
id.set("notmandatory")
name.set("Steve Myers")
email.set("notmandatory@noreply.github.org")
}
developer {
id.set("artfuldev")
name.set("Sudarsan Balaji")
email.set("sudarsan.balaji@artfuldev.com")
}
}
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 {
useGpgCmd()
sign(publishing.publications)
}