mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 1626336 - Remove MOZ_GECKOVIEW_JAR
. r=agi,geckoview-reviewers
While we're here we remove some Gradle Fennec-isms that are no longer needed. Differential Revision: https://phabricator.services.mozilla.com/D87334
This commit is contained in:
parent
02dffea93c
commit
851257343a
69
build.gradle
69
build.gradle
@ -120,15 +120,9 @@ ext.geckoBinariesOnlyIf = { task ->
|
||||
return false
|
||||
}
|
||||
|
||||
// Multi-l10n builds set `AB_CD=multi`, which isn't a valid locale. This
|
||||
// causes the
|
||||
//
|
||||
// |mach build| > |mach gradle| >
|
||||
// |mach build mobile/android/base/generated_android_code_and_resources| >
|
||||
// AndroidManifest.xml > strings.xml > multi/brand.dtd
|
||||
//
|
||||
// dependency chain to fail, since multi isn't a real locale. To avoid
|
||||
// this, if Gradle is invoked with AB_CD=multi, we don't invoke Make at all.
|
||||
// Multi-l10n builds set `AB_CD=multi`, which isn't a valid locale. To
|
||||
// avoid failures, if Gradle is invoked with AB_CD=multi, we don't invoke
|
||||
// Make at all.
|
||||
if ('multi' == System.env.AB_CD) {
|
||||
rootProject.logger.lifecycle("Skipping task ${task.path} because: AB_CD=multi")
|
||||
return false
|
||||
@ -157,12 +151,6 @@ class MachExec extends Exec {
|
||||
}
|
||||
}
|
||||
|
||||
// Why |mach build mobile/android/base/...| and |mach build faster|? |mach
|
||||
// build faster| generates dependentlibs.list, which in turn depends on compiled
|
||||
// code. That causes a circular dependency between Java compilation/JNI wrapper
|
||||
// generation/native code compilation. So we have the special target for
|
||||
// Android-specific generated code, and the |mach build faster| target for all
|
||||
// the stuff that goes into the omnijar.
|
||||
task machBuildFaster(type: MachExec) {
|
||||
onlyIf rootProject.ext.geckoBinariesOnlyIf
|
||||
|
||||
@ -183,42 +171,31 @@ task machBuildFaster(type: MachExec) {
|
||||
errorOutput = standardOutput
|
||||
}
|
||||
|
||||
def createMachStagePackageTask(name) {
|
||||
return task(name, type: MachExec) {
|
||||
onlyIf rootProject.ext.geckoBinariesOnlyIf
|
||||
task machStagePackage(type: MachExec) {
|
||||
onlyIf rootProject.ext.geckoBinariesOnlyIf
|
||||
|
||||
dependsOn rootProject.machBuildFaster
|
||||
dependsOn rootProject.machBuildFaster
|
||||
|
||||
workingDir "${topobjdir}"
|
||||
workingDir "${topobjdir}"
|
||||
|
||||
// We'd prefer this to be a `mach` invocation, but `mach build
|
||||
// mobile/android/installer/stage-package` doesn't work as expected.
|
||||
commandLine mozconfig.substs.GMAKE
|
||||
args '-C'
|
||||
args "${topobjdir}/mobile/android/installer"
|
||||
args 'stage-package'
|
||||
// We'd prefer this to be a `mach` invocation, but `mach build
|
||||
// mobile/android/installer/stage-package` doesn't work as expected.
|
||||
commandLine mozconfig.substs.GMAKE
|
||||
args '-C'
|
||||
args "${topobjdir}/mobile/android/installer"
|
||||
args 'stage-package'
|
||||
|
||||
outputs.file "${topobjdir}/dist/fennec/assets/${mozconfig.substs.ANDROID_CPU_ARCH}/libxul.so"
|
||||
outputs.file "${topobjdir}/dist/fennec/lib/${mozconfig.substs.ANDROID_CPU_ARCH}/libmozglue.so"
|
||||
|
||||
// Force running `stage-package`.
|
||||
outputs.upToDateWhen { false }
|
||||
|
||||
// `path` is like `:machStagePackage`.
|
||||
standardOutput = new TaggedLogOutputStream("${path}>", logger)
|
||||
errorOutput = standardOutput
|
||||
}
|
||||
}
|
||||
|
||||
createMachStagePackageTask("machStagePackageForFennec").with {
|
||||
outputs.file "${topobjdir}/dist/fennec/assets/omni.ja"
|
||||
}
|
||||
|
||||
createMachStagePackageTask("machStagePackageForGeckoview").with {
|
||||
args 'MOZ_GECKOVIEW_JAR=1'
|
||||
outputs.file "${topobjdir}/dist/geckoview/assets/omni.ja"
|
||||
// Avoid races between stage-package invocations.
|
||||
mustRunAfter tasks["machStagePackageForFennec"]
|
||||
|
||||
outputs.file "${topobjdir}/dist/geckoview/assets/${mozconfig.substs.ANDROID_CPU_ARCH}/libxul.so"
|
||||
outputs.file "${topobjdir}/dist/geckoview/lib/${mozconfig.substs.ANDROID_CPU_ARCH}/libmozglue.so"
|
||||
|
||||
// Force running `stage-package`.
|
||||
outputs.upToDateWhen { false }
|
||||
|
||||
// `path` is like `:machStagePackage`.
|
||||
standardOutput = new TaggedLogOutputStream("${path}>", logger)
|
||||
errorOutput = standardOutput
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
|
@ -8,11 +8,10 @@ installer:
|
||||
@$(MAKE) -C mobile/android/installer installer
|
||||
|
||||
package:
|
||||
# Setting MOZ_GECKOVIEW_JAR makes the installer generate a separate GeckoView JAR
|
||||
@$(MAKE) MOZ_GECKOVIEW_JAR=1 -C mobile/android/installer
|
||||
@$(MAKE) -C mobile/android/installer
|
||||
|
||||
stage-package:
|
||||
$(MAKE) MOZ_GECKOVIEW_JAR=1 -C mobile/android/installer stage-package
|
||||
$(MAKE) -C mobile/android/installer stage-package
|
||||
|
||||
deb: package
|
||||
@$(MAKE) -C mobile/android/installer deb
|
||||
|
@ -146,12 +146,8 @@ class SyncLibsAndUpdateGeneration extends DefaultTask {
|
||||
}
|
||||
|
||||
ext.configureVariantWithGeckoBinaries = { variant ->
|
||||
// :app needs the full Fennec omni.ja, whereas other projects need the
|
||||
// GeckoView-specific omni.ja.
|
||||
def omnijarDir = { "${topobjdir}/dist/${it}" }("app".equals(project.name) ? "fennec" : "geckoview")
|
||||
// All projects take the same Gecko libraries, which (for historical
|
||||
// reasons) are in "fennec".
|
||||
def distDir = "${topobjdir}/dist/fennec"
|
||||
def omnijarDir = "${topobjdir}/dist/geckoview"
|
||||
def distDir = "${topobjdir}/dist/geckoview"
|
||||
|
||||
def syncOmnijarFromDistDir = task("syncOmnijarFromDistDirFor${variant.name.capitalize()}", type: Sync) {
|
||||
onlyIf {
|
||||
@ -208,15 +204,9 @@ ext.configureVariantWithGeckoBinaries = { variant ->
|
||||
// moz.build system, which can be re-entrant. Official builds are driven by
|
||||
// the moz.build system and should never be re-entrant in this way.
|
||||
if (!mozconfig.substs.MOZILLA_OFFICIAL) {
|
||||
if ("app".equals(project.name)) {
|
||||
syncOmnijarFromDistDir.dependsOn rootProject.machStagePackageForFennec
|
||||
syncLibsFromDistDir.dependsOn rootProject.machStagePackageForFennec
|
||||
syncAssetsFromDistDir.dependsOn rootProject.machStagePackageForFennec
|
||||
} else {
|
||||
syncOmnijarFromDistDir.dependsOn rootProject.machStagePackageForGeckoview
|
||||
syncLibsFromDistDir.dependsOn rootProject.machStagePackageForGeckoview
|
||||
syncAssetsFromDistDir.dependsOn rootProject.machStagePackageForGeckoview
|
||||
}
|
||||
syncOmnijarFromDistDir.dependsOn rootProject.machStagePackage
|
||||
syncLibsFromDistDir.dependsOn rootProject.machStagePackage
|
||||
syncAssetsFromDistDir.dependsOn rootProject.machStagePackage
|
||||
}
|
||||
|
||||
def assetGenTask = tasks.findByName("generate${variant.name.capitalize()}Assets")
|
||||
|
@ -42,12 +42,7 @@ ifdef MOZ_ARTIFACT_BUILDS
|
||||
DEFINES += -DMOZ_ARTIFACT_BUILDS=1
|
||||
endif
|
||||
|
||||
ifdef MOZ_GECKOVIEW_JAR
|
||||
# Generate a GeckoView-specific omni.ja under dist/geckoview/omni.ja,
|
||||
# alongside the full omni.ja used by Fennec under dist/fennec/omni.ja.
|
||||
DEFINES += -DMOZ_GECKOVIEW_JAR=1
|
||||
MOZ_PKG_DIR = geckoview
|
||||
endif
|
||||
|
||||
ifdef MOZ_ANDROID_FAT_AAR_ARCHITECTURES
|
||||
DEFINES += -DMOZ_ANDROID_FAT_AAR_ARCHITECTURES=1
|
||||
|
@ -24,13 +24,7 @@
|
||||
@BINPATH@/hyphenation/*
|
||||
@BINPATH@/localization/*
|
||||
|
||||
; We want fennec/lib for both Fennec and GeckoView, so we turn
|
||||
; geckoview/lib into fennec/lib.
|
||||
#ifndef MOZ_GECKOVIEW_JAR
|
||||
[lib destdir="lib/@ANDROID_CPU_ARCH@"]
|
||||
#else
|
||||
[lib destdir="../fennec/lib/@ANDROID_CPU_ARCH@"]
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_CLANG_RT_ASAN_LIB
|
||||
@BINPATH@/@MOZ_CLANG_RT_ASAN_LIB@
|
||||
@ -139,7 +133,6 @@
|
||||
|
||||
; [Default Preferences]
|
||||
; All the pref files must be part of base to prevent migration bugs
|
||||
#ifdef MOZ_GECKOVIEW_JAR
|
||||
#ifndef MOZ_ANDROID_FAT_AAR_ARCHITECTURES
|
||||
@BINPATH@/@ANDROID_CPU_ARCH@/greprefs.js
|
||||
@BINPATH@/@PREF_DIR@/@ANDROID_CPU_ARCH@/geckoview-prefs.js
|
||||
@ -147,10 +140,6 @@
|
||||
@BINPATH@/*/greprefs.js
|
||||
@BINPATH@/@PREF_DIR@/*/geckoview-prefs.js
|
||||
#endif # !MOZ_ANDROID_FAT_AAR_ARCHITECTURES
|
||||
#else
|
||||
@BINPATH@/@ANDROID_CPU_ARCH@/greprefs.js
|
||||
@BINPATH@/@PREF_DIR@/mobile.js
|
||||
#endif # MOZ_GECKOVIEW_JAR
|
||||
@BINPATH@/@PREF_DIR@/channel-prefs.js
|
||||
@BINPATH@/defaults/autoconfig/prefcalls.js
|
||||
|
||||
@ -214,12 +203,7 @@
|
||||
@BINPATH@/chrome/geckoview@JAREXT@
|
||||
@BINPATH@/chrome/geckoview.manifest
|
||||
|
||||
#ifdef MOZ_GECKOVIEW_JAR
|
||||
@BINPATH@/components/GeckoView.manifest
|
||||
#else
|
||||
@BINPATH@/chrome/chrome@JAREXT@
|
||||
@BINPATH@/chrome/chrome.manifest
|
||||
#endif
|
||||
|
||||
; Remote control protocol
|
||||
#ifdef ENABLE_MARIONETTE
|
||||
|
@ -98,16 +98,6 @@ class MachCommands(MachCommandBase):
|
||||
|
||||
return ret
|
||||
|
||||
@SubCommand('android', 'generate-fennec-jni-wrappers',
|
||||
"""Generate Fennec-specific JNI wrappers used when building
|
||||
Firefox for Android.""")
|
||||
@CommandArgument('args', nargs=argparse.REMAINDER)
|
||||
def android_generate_fennec_jni_wrappers(self, args):
|
||||
ret = self.gradle(
|
||||
self.substs['GRADLE_ANDROID_GENERATE_FENNEC_JNI_WRAPPERS_TASKS'] + args, verbose=True)
|
||||
|
||||
return ret
|
||||
|
||||
@SubCommand('android', 'api-lint',
|
||||
"""Run Android api-lint.
|
||||
REMOVED/DEPRECATED: Use 'mach lint --linter android-api-lint'.""")
|
||||
|
@ -83,7 +83,7 @@ GARBAGE += $(addsuffix .log,$(MOCHITESTS) reftest crashtest jstestbrowser)
|
||||
REMOTE_CPPUNITTESTS = \
|
||||
$(PYTHON3) -u $(topsrcdir)/testing/remotecppunittests.py \
|
||||
--xre-path=$(DEPTH)/dist/bin \
|
||||
--localLib=$(DEPTH)/dist/fennec \
|
||||
--localLib=$(DEPTH)/dist/geckoview \
|
||||
--deviceIP=${TEST_DEVICE} \
|
||||
$(TEST_PATH) $(EXTRA_TEST_ARGS)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user