diff --git a/README.md b/README.md index f70e2d8..15daaf7 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,24 @@ Note: The lack of an explicit Gradle task is not a typo. A default task is confi Tip: On macOS and Linux, Gradle is invoked with `./gradlew`. On Windows, Gradle is invoked with `gradlew`. + +# Included builds +To simplify implementation of SDK features in conjunction with changes to the app, a Gradle [Included Build](https://docs.gradle.org/current/userguide/composite_builds.html) can be configured. + +1. Check out the SDK to a directory path of `../zcash-android-sdk` relative to the root of this app's repo. For example: + + parent/ + zcash-android-wallet/ + zcash-android-sdk/ + +1. Verify that the `zcash-android-sdk` builds correctly on its own +1. Build `zcash-android-wallet`, setting the Gradle property `IS_SDK_INCLUDED_BUILD=true` + +There are some limitations of included builds: +1. Properties from `zcash-android-wallet` will override those set in `zcash-android-sdk` with the same name +1. Modules in each project cannot share the same name. For this reason, build-conventions have different names in each repo (`zcash-android-sdk/build-conventions` vs `secant-android-wallet/build-convention`) +1. Kotlin and KSP versions will need to be coordinated between the two projects, because KSP is tightly coupled to the Kotlin version + # Contributing Contributions are very much welcomed! Please read our [Contributing Guidelines](/CONTRIBUTING.md) and [Code of Conduct](/CONDUCT.md). Our backlog has many Issues tagged with the `good first issue` label. Please fork the repo and make a pull request for us to review. diff --git a/gradle.properties b/gradle.properties index 5ee762e..3149fb1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,4 +20,7 @@ android.builder.sdkDownload=true # Optionally configures test orchestrator. While it provides isolated tests, it also nearly doubles # the time it takes for test to run. -isUseTestOrchestrator=false \ No newline at end of file +isUseTestOrchestrator=false + +# Toggles between using the SDK Maven artifact versus an included build +IS_SDK_INCLUDED_BUILD=false \ No newline at end of file diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index b1f5fb9..0000000 --- a/settings.gradle +++ /dev/null @@ -1,21 +0,0 @@ -pluginManagement { - repositories { - gradlePluginPortal() - } - - plugins { - id("com.github.ben-manes.versions") version("0.39.0") apply(false) - } -} - -dependencyResolutionManagement { - repositories { - google() - mavenCentral() - maven { url "https://jitpack.io" } - jcenter() - } -} - -rootProject.name="Zcash Wallet" -include ":app", ":qrecycler", ":feedback", ":mnemonic", ":lockbox" \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..2adcfc8 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,36 @@ +pluginManagement { + repositories { + gradlePluginPortal() + } + + plugins { + id("com.github.ben-manes.versions") version("0.39.0") apply(false) + } +} + +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + maven("https://jitpack.io") + jcenter() + } +} + +rootProject.name="ecc-wallet" +include(":app") +include(":qrecycler") +include(":feedback") +include(":mnemonic") +include(":lockbox") + +if (extra["IS_SDK_INCLUDED_BUILD"].toString().toBoolean()) { + // Currently assume the SDK is up one level with a hardcoded directory name + // If this becomes problematic, `IS_SDK_INCLUDED_BUILD` could be turned into a path + // instead. + includeBuild("../zcash-android-sdk") { + dependencySubstitution { + substitute(module("cash.z.ecc.android:zcash-android-sdk")).using(project(":sdk-lib")) + } + } +}