Bug 1444534 - Pre: Don't generate JNI wrappers for multi-locale builds or single-locale repacks. r=ted.mielczarek
As the comment says, these aren't useful during the final stage of
assembling a multi-locale build (when AB_CD=multi is set -- they're
definitely useful for the initial build, when AB_CD is unset and
implicitly en-US). And single-locale repacks don't do any
compilation, so they're definitely not useful there.
By guarding, we avoid having to be specific about what we're building
in the build invocations that will be moved out of |mach package| and
into different parts of the multi-locale build and single-locale
repack processes.
Subsequent tickets will migrate this whole JNI wrapper generation
mechanism to GENERATED_FILES anyway, moving the JNI wrapper generation
closer to the build steps that need the wrappers and avoiding the
problem entirely: those build steps won't be invoked at all for
multi-locale builds or for single-locale repacks.
MozReview-Commit-ID: Lt2d6uFm5Dq
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -159,16 +159,23 @@ else
# In automation, omni.ja is built only during packaging.
gradle-omnijar:
gradle-targets:
endif
.PHONY: gradle-targets gradle-omnijar
+# Neither multi-locale builds nor single-locale repacks should be
+# generating JNI wrappers. In the future, generating JNI wrappers
+# will be integrated into the build system closer to their use,
+# avoiding these work-arounds.
+ifneq (multi,$(AB_CD))
+ifeq (,$(IS_LANGUAGE_REPACK))
+
# GeneratedJNIWrappers.cpp target also generates
# GeneratedJNIWrappers.h and GeneratedJNINatives.h
# FennecJNIWrappers.cpp target also generates
# FennecJNIWrappers.h and FennecJNINatives.h
# List of build flags used by auto-generated JNI bindings (through the
# @BuildFlag annotation in Java). For example, add a "MOZ_FOO \" line to this
# list to support @BuildFlag(MOZ_FOO).
@@ -217,8 +224,11 @@ libs:: FennecJNIWrappers.cpp
echo '*** Error: The Fennec JNI code has changed ***' && \
echo '* To update generated code in the tree, please run *' && \
echo && \
echo ' make -C $(CURDIR) update-fennec-wrappers' && \
echo && \
echo '* Repeat the build, and check in any changes. *' && \
echo '*****************************************************' && \
exit 1)
+
+endif # ifneq (multi,$(AB_CD))
+endif # ifeq (,$(IS_LANGUAGE_REPACK))