forked from mozilla/application-services
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support and docs for an auto-publish based local dev workflow.
Our docs currently recommend two ways of building consuming apps against local changes to this repo: an automated-but-perpetually-buggy composite build workflow, and a reliable-but-tedious manual workflow of publishing to a local maven repo. This commit removes them both and replaces them with something similar to the workflow used by android-components: some scripting to automate publishing to and consuming from a local maven repo.
- Loading branch information
Showing
10 changed files
with
185 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// This script is designed to be used by consuming apps that want to support locally-published | ||
// development versions of application-services components. A build that `apply from`'s this script | ||
// will be configured to look for development versions published to the local maven repository. | ||
// | ||
// There is a companion gradle command `autoPublishForLocalDevelopment` that can be used to publish | ||
// the local development versions that are targetted by this script. | ||
|
||
logger.lifecycle("[local-appservices] adjusting ${project} to use locally published application-services modules") | ||
|
||
// Inject mavenLocal repository. This is where we're expected to publish modules. | ||
repositories { | ||
mavenLocal() | ||
} | ||
|
||
configurations.all { config -> | ||
if (config.isCanBeResolved()) { | ||
config.resolutionStrategy { strategy -> | ||
dependencySubstitution { | ||
all { dependency -> | ||
// We only care about substituting for a module, not a project. | ||
if (!(dependency.requested instanceof ModuleComponentSelector)) { | ||
return | ||
} | ||
|
||
// For every org.mozilla.appservices.* module, substitute its version for one | ||
// formatted like `0.0.1-SNAPSHOT-*`. This syntax will pick the latest such version | ||
// published locally by the `autoPublishForLocalDevelopment` command. | ||
def group = dependency.requested.group | ||
if (group == 'org.mozilla.appservices') { | ||
def name = dependency.requested.module | ||
dependency.useTarget([group: group, name: name, version: '[0.0.1-SNAPSHOT,0.0.1[']) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.