-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite docs on how to use local glean plugin in m-c #3033
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
This file was deleted.
Oops, something went wrong.
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,52 @@ | ||
# Working on unreleased Glean code in mozilla-central | ||
|
||
> **Note**: This guide is for mozilla-central Android builds. If you only need to replace the Glean Rust parts, refer to [Developing with a local Glean build](https://firefox-source-docs.mozilla.org/toolkit/components/glean/dev/local_glean.html) in the Firefox Source Docs. | ||
|
||
> **Note**: This guide only refers to building Fenix. It should work similarly for Focus Android. | ||
|
||
## Preparation | ||
|
||
This guide assumes you are already setup to build the mozilla-central repository for Android. | ||
Refer to [Getting Set Up To Work On The Firefox Codebase](https://firefox-source-docs.mozilla.org/setup/index.html) for more. | ||
|
||
Clone the Glean SDK repositories: | ||
|
||
```sh | ||
git clone https://github.com/mozilla/glean | ||
``` | ||
|
||
## Cargo build targets | ||
|
||
By default when building Fenix using gradle, the rust-android plugin will compile Glean for every possible platform, | ||
which might end up in build failures. | ||
You can customize which targets are built in `glean/local.properties` | ||
([more information](https://github.com/ncalexan/rust-android-gradle/blob/HEAD/README.md#specifying-local-targets)): | ||
|
||
``` | ||
# For physical devices: | ||
rust.targets=arm | ||
|
||
# For unit tests: | ||
# rust.targets=darwin # Or linux-*, windows-* (* = x86/x64) | ||
|
||
# For emulator only: | ||
rust.targets=x86 | ||
``` | ||
|
||
## Substituting projects | ||
|
||
Fenix has custom build logic for dealing with composite builds, | ||
so you should be able to configure it by simply adding the path to the Glean repository in the correct `local.properties` file: | ||
|
||
In `mozilla-central/mobile/android/fenix/local.properties`: | ||
|
||
```groovy | ||
autoPublish.glean.dir=../../../../glean | ||
``` | ||
|
||
Make sure to use the correct path pointing to your Glean checkout. | ||
|
||
> **Note**: This substitution-based approach will not work for testing updates to the Glean Gradle plugin or `glean_parser` as shipped in the Glean Gradle Plugin. | ||
> | ||
> See [Replacing the Glean Gradle plugin in mozilla-central](gradle-plugin-in-mc.md). | ||
> For replacing `glean_parser` in a local build, see [Substituting `glean_parser`](glean-parser-substitution.md). |
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,35 @@ | ||
# Replacing the Glean Gradle plugin in mozilla-central | ||
|
||
> **Note**: If you only need to replace the `glean_parser` Python parts used in the build see [Substituting `glean_parser`](glean-parser-substitution.md). | ||
> The approached documented in this chapter is only necessary if you changed `GleanGradlePlugin.groovy`. | ||
|
||
If you need to replace the Glean Gradle Plugin used by any component in mozilla-central, follow these steps: | ||
|
||
1. In your Glean repository increment the version number in `.buildconfig.yml` to something unused: | ||
|
||
```yaml | ||
libraryVersion: 70.0.0 | ||
``` | ||
|
||
1. Build the Glean Gradle plugin and publish the plugin locally: | ||
|
||
``` | ||
./gradlew glean-gradle-plugin:publishToMavenLocal | ||
``` | ||
|
||
1. In your `mozilla-central` checkout, add the following line in `mobile/android/fenix/settings.gradle` file in the `pluginManagement` block: | ||
|
||
```gradle | ||
mavenLocal() | ||
``` | ||
|
||
1. Use the new version number where the plugin is imported in `mobile/android/fenix/build.gradle`: | ||
|
||
``` | ||
classpath "org.mozilla.telemetry:glean-gradle-plugin:70.0.0" | ||
``` | ||
|
||
This might need to be applied to the top-level `build.gradle` and other `build.gradle` files under `mobile/android` to apply to all components. | ||
|
||
|
||
Building Fenix will now use your locally published Glean Gradle Plugin. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing requirement of needing to have maven installed locally to serve the package. I think you can get it from
homebrew
🤔