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

Add Gradle plugin for building libraries #37

Merged
merged 13 commits into from Apr 26, 2022

Conversation

thunderbiscuit
Copy link
Collaborator

@thunderbiscuit thunderbiscuit commented Mar 22, 2022

Description

This PR adds two internal Gradle plugins which live in the buildSrc directory. The purpose of the plugins is to replace the build.sh script by a more idiomatic and customizable workflow using Gradle tasks.

Notes to the reviewers

By default the :android:buildAndroidLib task will build all versions of bdk-android, which currently are the arm64-v8a (for mobile devices) and the x86_64 (for emulators).

Users can opt out of a particular build if they'd like by excluding the task like so:

./gradlew :android:buildAndroidLib --exclude-task buildAndroidX86_64Binary

This PR is open as a discussion piece on the direction I am taking for implementing the next iteration of our build logic.

To test the plugins, first see that the tasks have been added using ./gradlew tasks, which should add the Bitcoindevkit group to the list of Gradle tasks:

gradle

Then run either tasks to build the given library:

./gradlew :jvm:buildJvmLib
./gradlew :android:buildAndroidLib

All Submissions:

  • I've signed all my commits

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

@thunderbiscuit
Copy link
Collaborator Author

thunderbiscuit commented Mar 22, 2022

The plugin adds a number of sub-tasks, but only the aggregate buildJvmLib and buildAndroidLib should be run by the end user.

This ensures they don't show up when using ./gradlew :jvm:tasks. The
only two tasks that will appear in the end will be buildJvmLib and
buildAndroidLib.
@thunderbiscuit thunderbiscuit marked this pull request as ready for review April 12, 2022 18:50
@notmandatory notmandatory added this to the Release 0.6.0 milestone Apr 16, 2022
@notmandatory
Copy link
Member

Looks like this needs a rebase.

@notmandatory notmandatory self-requested a review April 16, 2022 05:37
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.

This is a great improvement, much cleaner to use gradle than build.sh. I tested building and running the jvm and android tests and works great on my linux box (after making the little requested changes). A rebase it also needed I believe. I also think it's ok to remove the build.sh in this PR.

@thunderbiscuit
Copy link
Collaborator Author

Good idea to remove the build shell script. It forces a change in the CI as well but I think it should work. Fixed in latest commit.

@thunderbiscuit thunderbiscuit changed the title Add Gradle plugin MVP for building JVM library Add Gradle plugin MVP for building libraries Apr 17, 2022
@thunderbiscuit thunderbiscuit changed the title Add Gradle plugin MVP for building libraries Add Gradle plugin for building libraries Apr 17, 2022
@thunderbiscuit
Copy link
Collaborator Author

thunderbiscuit commented Apr 17, 2022

I tried resolving the conflicts right into the Github UI instead of rebasing (it offered me the option to do so, which I'd never seen before... first time trying this). Anyway it looks like it worked nicely.

@thunderbiscuit
Copy link
Collaborator Author

thunderbiscuit commented Apr 20, 2022

This PR implicitly removes support for the i686 architecture for bdk-android. See discussion in #52.

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 a9f42dd

Thanks for the fixes! I think this is ready to go let's chat about when to merge.

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.

None yet

2 participants