Skip to content

Commit

Permalink
Bug 1815939 - Clean up AC autopublish code in Fenix and Focus
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielluong authored and mergify[bot] committed Feb 22, 2023
1 parent 30ab88c commit 54b7c6d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 61 deletions.
8 changes: 3 additions & 5 deletions fenix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,14 @@ To set the raptor manifest flag in Nightly, Beta and Release variants, add the f
raptorEnabled
```
### Auto-publication workflow for android-components and application-services
### Auto-publication workflow for application-services and glean
If you're making changes to these projects and want to test them in Fenix, auto-publication workflow is the fastest, most reliable
way to do that.
In `local.properties`, specify a relative path to your local `android-components` and/or `application-services` projects. E.g.:
- `autoPublish.android-components.dir=../firefox-android/android-components`
In `local.properties`, specify a relative path to your local `glean` and/or `application-services` projects. E.g.:
- `autoPublish.glean.dir=../glean`
- `autoPublish.application-services.dir=../application-services`
*Note that the Android Components project was already migrated to the new [firefox-android](https://github.com/mozilla-mobile/firefox-android) repository. Therefore, this auto publication workflow won't be neccessary for Android Components once Fenix is integrated in the new repository as well.*
Once these flags are set, your Fenix builds will include any local modifications present in these projects.
See a [demo of auto-publication workflow in action](https://www.youtube.com/watch?v=qZKlBzVvQGc).
Expand Down
14 changes: 0 additions & 14 deletions fenix/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -848,20 +848,6 @@ if (gradle.hasProperty('localProperties.dependencySubstitutions.geckoviewTopsrcd
apply from: "${topsrcdir}/substitute-local-geckoview.gradle"
}

def acSrcDir = null
if (gradle.hasProperty('localProperties.autoPublish.android-components.dir')) {
acSrcDir = gradle.getProperty('localProperties.autoPublish.android-components.dir')
} else if (gradle.hasProperty('localProperties.branchBuild.android-components.dir')) {
acSrcDir = gradle.getProperty('localProperties.branchBuild.android-components.dir')
}
if (acSrcDir) {
if (acSrcDir.startsWith("/")) {
apply from: "${acSrcDir}/substitute-local-ac.gradle"
} else {
apply from: "../${acSrcDir}/substitute-local-ac.gradle"
}
}

def appServicesSrcDir = null
if (gradle.hasProperty('localProperties.autoPublish.application-services.dir')) {
appServicesSrcDir = gradle.getProperty('localProperties.autoPublish.application-services.dir')
Expand Down
16 changes: 0 additions & 16 deletions fenix/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ def runCmd(cmd, workingDir, successMessage, captureStdout=true) {

Properties localProperties = null
String settingAppServicesPath = "autoPublish.application-services.dir"
String settingAndroidComponentsPath = "autoPublish.android-components.dir"
String settingGleanPath = "autoPublish.glean.dir"

if (file('local.properties').canRead()) {
Expand Down Expand Up @@ -165,21 +164,6 @@ if (localProperties != null) {
log("Disabled auto-publication of application-services. Enable it by settings '$settingAppServicesPath' in local.properties")
}

String androidComponentsLocalPath = localProperties.getProperty(settingAndroidComponentsPath)

if (androidComponentsLocalPath != null) {
log("Enabling automatic publication of android-components from: $androidComponentsLocalPath")
// As above, hacks to execute .py files on Windows.
def publishAcCmd = [];
if (System.properties['os.name'].toLowerCase().contains('windows')) {
publishAcCmd << "py";
}
publishAcCmd << "./automation/publish_to_maven_local_if_modified.py";
runCmd(publishAcCmd, androidComponentsLocalPath, "Published android-components for local development.", false)
} else {
log("Disabled auto-publication of android-components. Enable it by settings '$settingAndroidComponentsPath' in local.properties")
}

String gleanLocalPath = localProperties.getProperty(settingGleanPath)

if (gleanLocalPath != null) {
Expand Down
8 changes: 3 additions & 5 deletions focus-android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,14 @@ Nightly, Beta and Release variants are getting published to Google Play and ther
debuggable
```
### Auto-publication workflow for android-components and application-services
### Auto-publication workflow for application-services and glean
If you're making changes to these projects and want to test them in Focus, auto-publication workflow is the fastest, most reliable
way to do that.

In `local.properties`, specify a relative path to your local `android-components` and/or `application-services` projects. E.g.:
- `autoPublish.android-components.dir=../firefox-android/android-components`
In `local.properties`, specify a relative path to your local `glean` and/or `application-services` projects. E.g.:
- `autoPublish.glean.dir=../glean`
- `autoPublish.application-services.dir=../application-services`

*Note that the Android Components project was already migrated to the new [firefox-android](https://github.com/mozilla-mobile/firefox-android) repository. Therefore, this auto publication workflow won't be neccessary for Android Components once Focus is integrated in the new repository as well.*
Once these flags are set, your Focus builds will include any local modifications present in these projects.

See a [demo of auto-publication workflow in action](https://www.youtube.com/watch?v=qZKlBzVvQGc).
Expand Down
5 changes: 0 additions & 5 deletions focus-android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -629,11 +629,6 @@ if (project.hasProperty("coverage")) {
}
}

if (gradle.hasProperty('localProperties.autoPublish.android-components.dir')) {
ext.acSrcDir = gradle."localProperties.autoPublish.android-components.dir"
apply from: "../${acSrcDir}/substitute-local-ac.gradle"
}

if (gradle.hasProperty('localProperties.autoPublish.application-services.dir')) {
ext.appServicesSrcDir = gradle."localProperties.autoPublish.application-services.dir"
apply from: "../${appServicesSrcDir}/build-scripts/substitute-local-appservices.gradle"
Expand Down
16 changes: 0 additions & 16 deletions focus-android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ def runCmd(cmd, workingDir, successMessage, captureStdout=true) {

Properties localProperties = null
String settingAppServicesPath = "autoPublish.application-services.dir"
String settingAndroidComponentsPath = "autoPublish.android-components.dir"
String settingGleanPath = "autoPublish.glean.dir"

if (file('local.properties').canRead()) {
Expand Down Expand Up @@ -163,21 +162,6 @@ if (localProperties != null) {
log("Disabled auto-publication of application-services. Enable it by settings '$settingAppServicesPath' in local.properties")
}

String androidComponentsLocalPath = localProperties.getProperty(settingAndroidComponentsPath)

if (androidComponentsLocalPath != null) {
log("Enabling automatic publication of android-components from: $androidComponentsLocalPath")
// As above, hacks to execute .py files on Windows.
def publishAcCmd = [];
if (System.properties['os.name'].toLowerCase().contains('windows')) {
publishAcCmd << "py";
}
publishAcCmd << "./automation/publish_to_maven_local_if_modified.py";
runCmd(publishAcCmd, androidComponentsLocalPath, "Published android-components for local development.", false)
} else {
log("Disabled auto-publication of android-components. Enable it by settings '$settingAndroidComponentsPath' in local.properties")
}

String gleanLocalPath = localProperties.getProperty(settingGleanPath)

if (gleanLocalPath != null) {
Expand Down

0 comments on commit 54b7c6d

Please sign in to comment.