From 01e4ffed1f1163063e2ced39cbcaea161e794486 Mon Sep 17 00:00:00 2001 From: thunderbiscuit Date: Fri, 18 Oct 2024 11:29:11 -0400 Subject: [PATCH] chore: use simpler gradle configurations --- bitcoin-ffi-jvm/.gitignore | 1 + bitcoin-ffi-jvm/build.gradle.kts | 18 ------------- bitcoin-ffi-jvm/lib/build.gradle.kts | 31 +++-------------------- bitcoin-ffi-jvm/settings.gradle.kts | 21 ++++++++------- scripts/uniffi_bindgen_generate_kotlin.sh | 2 +- 5 files changed, 18 insertions(+), 55 deletions(-) delete mode 100644 bitcoin-ffi-jvm/build.gradle.kts diff --git a/bitcoin-ffi-jvm/.gitignore b/bitcoin-ffi-jvm/.gitignore index 1b6985c..fe2e0cc 100644 --- a/bitcoin-ffi-jvm/.gitignore +++ b/bitcoin-ffi-jvm/.gitignore @@ -3,3 +3,4 @@ # Ignore Gradle build output directory build +bitcoin.kt diff --git a/bitcoin-ffi-jvm/build.gradle.kts b/bitcoin-ffi-jvm/build.gradle.kts deleted file mode 100644 index 98c3110..0000000 --- a/bitcoin-ffi-jvm/build.gradle.kts +++ /dev/null @@ -1,18 +0,0 @@ -buildscript { - repositories { - google() - } - dependencies { - classpath("com.android.tools.build:gradle:7.1.2") - } -} - -// library version is defined in gradle.properties -val libraryVersion: String by project - -// These properties are required here so that the nexus publish-plugin -// finds a staging profile with the correct group (group is otherwise set as "") -// and knows whether to publish to a SNAPSHOT repository or not -// https://github.com/gradle-nexus/publish-plugin#applying-the-plugin -group = "org.bitcoindevkit" -version = libraryVersion diff --git a/bitcoin-ffi-jvm/lib/build.gradle.kts b/bitcoin-ffi-jvm/lib/build.gradle.kts index 2d141a7..44ede3c 100644 --- a/bitcoin-ffi-jvm/lib/build.gradle.kts +++ b/bitcoin-ffi-jvm/lib/build.gradle.kts @@ -5,29 +5,15 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED import org.gradle.api.tasks.testing.logging.TestLogEvent.STANDARD_ERROR import org.gradle.api.tasks.testing.logging.TestLogEvent.STANDARD_OUT -// library version is defined in gradle.properties -val libraryVersion: String by project +group = "org.bitcoindevkit.bitcoinffi" +version = "0.1.3-SNAPSHOT" plugins { - // Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin. - id("org.jetbrains.kotlin.jvm") version "1.7.10" - - // Apply the java-library plugin for API and implementation separation. - id("java-library") - id("maven-publish") + id("org.jetbrains.kotlin.jvm") version "2.0.10" + id("org.gradle.maven-publish") id("org.jlleitschuh.gradle.ktlint") version "11.6.1" } -repositories { - // Use Maven Central for resolving dependencies. - mavenCentral() -} - -java { - withSourcesJar() - withJavadocJar() -} - dependencies { // Use the Kotlin JUnit 5 integration. testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") @@ -35,18 +21,9 @@ dependencies { // Use the JUnit 5 integration. testImplementation("org.junit.jupiter:junit-jupiter-engine:5.9.1") - // // This dependency is exported to consumers, that is to say found on their compile classpath. - // api("org.apache.commons:commons-math3:3.6.1") - - // // This dependency is used internally, and not exposed to consumers on their own compile classpath. - // implementation("com.google.guava:guava:31.1-jre") // Align versions of all Kotlin components implementation(platform("org.jetbrains.kotlin:kotlin-bom")) - // Use the Kotlin JDK 8 standard library. - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") - implementation("net.java.dev.jna:jna:5.12.0") } diff --git a/bitcoin-ffi-jvm/settings.gradle.kts b/bitcoin-ffi-jvm/settings.gradle.kts index 6acec05..f148b54 100644 --- a/bitcoin-ffi-jvm/settings.gradle.kts +++ b/bitcoin-ffi-jvm/settings.gradle.kts @@ -1,11 +1,14 @@ -/* - * This file was generated by the Gradle 'init' task. - * - * The settings file is used to specify which projects to include in your build. - * - * Detailed information about configuring a multi-project build in Gradle can be found - * in the user manual at https://docs.gradle.org/7.6/userguide/multi_project_builds.html - */ - rootProject.name = "bitcoin-ffi-jvm" include("lib") + +pluginManagement { + repositories { + gradlePluginPortal() + } +} + +dependencyResolutionManagement { + repositories { + mavenCentral() + } +} diff --git a/scripts/uniffi_bindgen_generate_kotlin.sh b/scripts/uniffi_bindgen_generate_kotlin.sh index 03e2497..ec48c34 100755 --- a/scripts/uniffi_bindgen_generate_kotlin.sh +++ b/scripts/uniffi_bindgen_generate_kotlin.sh @@ -30,4 +30,4 @@ fi mkdir -p "$PROJECT_DIR"/lib/src/main/kotlin/"$PACKAGE_DIR" || exit 1 $UNIFFI_BINDGEN_BIN generate src/bitcoin.udl --language kotlin -o "$TARGET_DIR" || exit 1 -cp "$TARGET_DIR"/"$PACKAGE_DIR"/bitcoin.kt "$PROJECT_DIR"/lib/src/main/kotlin/"$PACKAGE_DIR"/bitcoinffi.kt || exit 1 +cp "$TARGET_DIR"/"$PACKAGE_DIR"/bitcoin.kt "$PROJECT_DIR"/lib/src/main/kotlin/"$PACKAGE_DIR"/bitcoin.kt || exit 1