@@ -8,44 +8,69 @@ from there.
88With support from the upstream project, it's possible to do this in a single step using
99our auto-publishing workflow.
1010
11- ## rust.targets
11+ # Using the auto-publishing workflow
12+
13+ mozilla-central has support for automatically publishing and including a local development version of application-services in the build.
14+ This is supported for most of the Android targets available in mozilla-central including Fenix - this
15+ doc will focus on Fenix, but the same general process is used for all. The workflow is:
16+
17+ ## Pre-requisites:
18+ 1 . Ensure you have a regular [ build of application-services working] ( ../building.md ) .
19+ 1 . Disable the gradle cache in mozilla-central - edit ` ./gradle.properties ` , comment out ` org.gradle.configuration-cache=true `
20+ 1 . Ensure you have a regular build of Fenix from mozilla-central testable in Android Studio or an emulator.
21+
22+ ## Setup 2 x ` local.properties `
23+
24+ Edit (or create) the file ` local.properties ` in each of the repos:
25+
26+ ### app-services
27+
28+ In the root of the app-services repo:
29+
30+ Please be sure you have read [ our guide to building Fenix] ( ../building.md#building-for-fenix ) and successfully built
31+ using the instructions there. In particular, this may lead you to adding ` sdk.dir ` and ` ndk.dir ` properties, and/or
32+ set environment variables ` ANDROID_SDK_ROOT ` and ` ANDROID_HOME ` .
33+
34+ In addition to those instructions, you will need:
35+
36+ #### rust.targets
1237
1338Both the auto-publishing and manual workflows can be sped up significantly by
1439using the ` rust.targets ` property which limits which architectures the Rust
15- code gets build against. You can set this property by creating/editing the
16- ` local.properties ` file in the repository root and adding a line like
40+ code gets build against. Adding a line like
1741` rust.targets=x86,linux-x86-64 ` . The trick is knowing which targets to put in
1842that comma separated list:
1943
20- - Use ` x86 ` for running the app on most emulators (in rare cases, when you have a 64-bit emulator, you'll want ` x86_64 ` )
44+ - Use ` x86 ` for running the app on most emulators on Intel hardware (in rare cases, when you have a 64-bit emulator, you'll want ` x86_64 ` ).
45+ - Use ` arm64 ` for emulators running on Apple Silicon Macs.
2146 - If you're running the ` android-components ` or ` fenix ` unit tests, then you'll need the architecture of your machine:
2247 - OSX running Intel chips: ` darwin-x86-64 `
2348 - OSX running M1 chips: ` darwin-aarch64 `
2449 - Linux: ` linux-x86-64 `
2550
26- ## Using the auto-publishing workflow
51+ eg, on a Mac your ` local.properties ` file will have a single line, ` rust.targets=darwin-aarch64,arm64 `
2752
28- mozilla-central has support for automatically publishing and including a local development version of application-services in the build.
29- This is supported for most of the Android targets available in mozilla-central including Fenix - this
30- doc will focus on Fenix, but the same general process is used for all. The workflow is:
53+ ### mozilla-central
3154
32- 1 . Ensure you have a regular build of Fenix working from mozilla-central and that you've done a ` ./mach build `
33- 1 . Ensure you have a regular [ build of application-services working] ( ../building.md ) .
34- 1 . Edit (or create) the file ` local.properties ` - this can be in the root of the mozilla-central checkout,
35- or in the project specific directory (eg, ` mobile/android/fenix ` ) and tell it where to
36- find your local checkout of application-services, by adding a line like:
55+ ` local.properties ` can be in the root of the mozilla-central checkout,
56+ or in the project specific directory (eg, ` mobile/android/fenix ` ) and you tell it where to
57+ find your local checkout of application-services by adding a line like:
58+
59+ ` autoPublish.application-services.dir=path/to/your/checkout/of/application-services `
60+
61+ Note that the path can be absolute or relative from ` local.properties ` . For example, if ` application-services `
62+ and ` mozilla-central ` are at the same level, and you are using a ` local.properties ` in the root of mozilla-central,
63+ the relative path would be ` ../application-services `
3764
38- ` autoPublish.application-services.dir=path/to/ your/checkout/of/application-services `
65+ ## Build and test your Fenix again.
3966
40- Note that the path can be absolute or relative from ` local.properties ` . For example, if ` application-services `
41- and ` mozilla-central ` are at the same level, and you are using a ` local.properties ` in the root of mozilla-central,
42- the relative path would be ` ../application-services `
43- 1 . Build your target normally - eg, in Android Studio. or using ` gradle `
67+ After configuring as described above, build and test your Fenix again.
4468
4569If all goes well, this should automatically build your checkout of ` application-services ` , publish it
4670to a local maven repository, and configure the consuming project to install it from there instead of
4771from our published releases.
4872
73+ # Other notes
4974### Using Windows/WSL
5075
5176Good luck! This implies you are also building mozilla-central in a Windows/WSL environment;
0 commit comments