Skip to content

Better Gradle build files#41

Open
thunderbiscuit wants to merge 4 commits intobitcoindevkit:masterfrom
thunderbiscuit:post-release
Open

Better Gradle build files#41
thunderbiscuit wants to merge 4 commits intobitcoindevkit:masterfrom
thunderbiscuit:post-release

Conversation

@thunderbiscuit
Copy link
Member

@thunderbiscuit thunderbiscuit commented Feb 13, 2026

This PR does a few things:

  1. Clean up the Gradle build files (tons of easy wins, unused plugins, old code that was used with the previous publishing plugin that could be cleaned up)
  2. Brings in a new publishing plugin, gradle-maven-publish-plugin. This is currently the best, most actively maintained plugin to publish on the new Central Portal. I have used it for the regtest-toolbox 0.1.0 release and it worked great. This PR doesn't add a publishing workflow to our CI (a maintainer still needs to trigger the release manually), but releasing should be much easier than before using this plugin.
  3. Updates the readme.

Copy link
Member Author

@thunderbiscuit thunderbiscuit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments for reviewers.


plugins {
id("org.jetbrains.kotlin.jvm") version "2.1.10"
id("application")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an unused plugin.


dependencies {
implementation(project(":lib"))
testImplementation(kotlin("test"))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were no tests in this module.


plugins {
id("org.jetbrains.kotlin.jvm")
id("org.gradle.java-library")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an unused plugin.

id("org.gradle.java-library")
id("org.gradle.maven-publish")
id("org.gradle.signing")
id("com.vanniktech.maven.publish")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two are replaced by the vannitech plugin.

id("org.jetbrains.dokka-javadoc")
}

group = "org.bitcoindevkit"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had those in other files initially because of the super old plugin we used for publishing, which we don't use anymore anyway. Bringing those here cleans up the weird locations for the versions.

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two lines are now handled by the vannitech plugin.

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
tasks.withType<KotlinCompile> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the new way to declare compiler options.

}
}

testing {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was never needed.

}
}

signing {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed anymore, as if you publish to your local maven the vanniteck plugin doesn't require signature in the first place if your keys are not set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant