Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Migrate project-level Gradle build script to Kotlin DSL #10

Merged
merged 5 commits into from Mar 1, 2022

Conversation

thunderbiscuit
Copy link
Collaborator

@thunderbiscuit thunderbiscuit commented Feb 11, 2022

Description

Migrating the Gradle build scripts to Kotlin DSL.

Fixes #9

Notes to the reviewers

I have not tested the publishing workflow.

All Submissions:

  • I've signed all my commits

@thunderbiscuit
Copy link
Collaborator Author

thunderbiscuit commented Feb 12, 2022

I have migrated all 3 build scripts. A few notes:

  1. I'm keen on Gradle and over time I want to make sure I understand all our plugins and the configurations we use, as well as how we can make our build scripts better. This PR however is just a straight port of the Groovy DSL scripts.
  2. I removed the withJavadocJar() config in the jvm build file because it currently only produced an empty jar.
  3. I have not tested the nexus publishing task, but I did test the publishToLocalMaven task for the Android library and it worked well.
  4. @notmandatory can I ask how you currently pass the username and password through the findProperty() method? I just want to make sure I find it using my val ossrhUsername: String? by project line. (aka is it defined in your home gradle.properties, or as a environment variable, or passed as a command line argument? Reading the docs I think it could come from many places. In any case I do think my line should pick it up, but let me know if it's not working and I can adjust. I'm also looking at this article to try and figure out how to do it best.

@notmandatory
Copy link
Member

I'm currently using gradle.properties to get the publishing authentication info. Some more details here: https://github.com/bitcoindevkit/bdk-kotlin#how-to-publish

@thunderbiscuit
Copy link
Collaborator Author

thunderbiscuit commented Feb 15, 2022

The face when you realize your question is answered right there in the readme and now everyone knows you didn't read it meticulously:

face

I have tested in a local repo and indeed the current code will fetch the username and password correctly from global properties. I'll mark this PR as ready for review.

@notmandatory
Copy link
Member

I merged the two pending PRs so now this one needs a rebase. Then I'll give it a test and otherwise LGTM.

@thunderbiscuit
Copy link
Collaborator Author

It was a weird rebase but I think I got it. The issue was that you had made changes to files I had deleted, so I just needed to delete them again.

@notmandatory notmandatory modified the milestones: 0.3.0, 0.4.0 Feb 28, 2022
implementation("net.java.dev.jna:jna:5.8.0")
api("org.slf4j:slf4j-api:1.7.30")
testImplementation("junit:junit:4.13.2")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.8.2")
Copy link
Member

Choose a reason for hiding this comment

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

For some reason I had to add this dependency for the ./gradlew :jvm:test command to work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same with the migration to the new API! This PR was initially made against the older version of bdk-ffi and so it was working, but when I worked on updating the tests in a different PR I also found I needed to add this junit-vintage-engine. Thanks for fixing!

Copy link
Member

@notmandatory notmandatory left a comment

Choose a reason for hiding this comment

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

ACK 933af8c

I tested a staging publish and it worked so a full (non-test) publish should work too.

@notmandatory notmandatory merged commit 9e35866 into bitcoindevkit:master Mar 1, 2022
@thunderbiscuit thunderbiscuit deleted the kotlin-dsl branch March 1, 2022 13:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Proposition: migrate build scripts to Kotlin DSL
2 participants