diff --git a/.gitignore b/.gitignore index e869293..80f5549 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ bdk.kt libbdkffi.dylib /.idea .DS_Store +/examples/data/ diff --git a/README.md b/README.md index a5c9c9b..aa0ebb1 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,20 @@ sdk install java 17.0.2-tem ```sh bash ./scripts/build-.sh ``` +## Run example files + +The `examples` module show different samples of how some of the APIs can be used. You can run the examples after building as stated above. The gradle task to run is by convention the file name of the example file. + +```shell +cd bdk-jvm +./gradlew MultisigTransaction +``` + +You can also list the application tasks. (All examples grouped under application) +```shell +cd bdk-jvm +./gradlew tasks --group application +``` ## How to publish to your local Maven repo diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts index f52e4d1..7ba74a0 100644 --- a/examples/build.gradle.kts +++ b/examples/build.gradle.kts @@ -1,7 +1,8 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { - kotlin("jvm") version "2.1.10" + id("org.jetbrains.kotlin.jvm") version "2.1.10" + id("application") } group = "org.bitcoindevkit" @@ -32,3 +33,17 @@ tasks.withType { jvmTarget.set(JvmTarget.JVM_11) } } + +tasks.register("WalletSetupBip32") { + group = "application" + description = "Runs the main function in the WalletSetupBip32 example" + mainClass.set("org.bitcoindevkit.WalletSetupBip32Kt") + classpath = sourceSets["main"].runtimeClasspath +} + +tasks.register("MultisigTransaction") { + group = "application" + description = "Runs the main function in the MultisigTransaction example" + mainClass.set("org.bitcoindevkit.MultisigTransactionKt") + classpath = sourceSets["main"].runtimeClasspath +}