From 28a3cd1028612b3b577768519d11fa6fbcda6f09 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 14 Oct 2021 16:57:01 +0000 Subject: Issue #1053 - First pass Android defines and remove Android Annotation processors, some Andoid packaging stuff, Eclipse IDE support et al. --- config/android-common.mk | 51 ------------- config/external/nss/Makefile.in | 9 --- config/makefiles/java-build.mk | 159 ---------------------------------------- config/rules.mk | 7 -- 4 files changed, 226 deletions(-) delete mode 100644 config/android-common.mk delete mode 100644 config/makefiles/java-build.mk (limited to 'config') diff --git a/config/android-common.mk b/config/android-common.mk deleted file mode 100644 index a54f20b88e..0000000000 --- a/config/android-common.mk +++ /dev/null @@ -1,51 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -# Ensure ANDROID_SDK is defined before including this file. -# We use common android defaults for boot class path and java version. -ifndef ANDROID_SDK - $(error ANDROID_SDK must be defined before including android-common.mk) -endif - -# DEBUG_JARSIGNER always debug signs. -DEBUG_JARSIGNER=$(PYTHON) $(abspath $(topsrcdir)/mobile/android/debug_sign_tool.py) \ - --keytool=$(KEYTOOL) \ - --jarsigner=$(JARSIGNER) \ - $(NULL) - -# RELEASE_JARSIGNER release signs if possible. -ifdef MOZ_SIGN_CMD -RELEASE_JARSIGNER := $(MOZ_SIGN_CMD) -f jar -else -RELEASE_JARSIGNER := $(DEBUG_JARSIGNER) -endif - -# $(1) is the full path to input: foo-debug-unsigned-unaligned.apk. -# $(2) is the full path to output: foo.apk. -# Use this like: $(call RELEASE_SIGN_ANDROID_APK,foo-debug-unsigned-unaligned.apk,foo.apk) -# -# The |zip -d| there to handle re-signing previously signed APKs. Gradle -# produces signed, unaligned APK files, but this expects unsigned, unaligned -# APK files. The |zip -d| discards any existing signature, turning a signed, -# unaligned APK into an unsigned, unaligned APK. Sadly |zip -q| doesn't -# silence a warning about "nothing to do" so we pipe to /dev/null. -RELEASE_SIGN_ANDROID_APK = \ - cp $(1) $(2)-unaligned.apk && \ - ($(ZIP) -d $(2)-unaligned.apk 'META-INF/*' > /dev/null || true) && \ - $(RELEASE_JARSIGNER) $(2)-unaligned.apk && \ - $(ZIPALIGN) -f -v 4 $(2)-unaligned.apk $(2) && \ - $(RM) $(2)-unaligned.apk - -# For Android, we default to 1.7 -ifndef JAVA_VERSION - JAVA_VERSION = 1.7 -endif - -JAVAC_FLAGS = \ - -target $(JAVA_VERSION) \ - -source $(JAVA_VERSION) \ - -encoding UTF8 \ - -g:source,lines \ - -Werror \ - $(NULL) diff --git a/config/external/nss/Makefile.in b/config/external/nss/Makefile.in index 7289e57f4c..f01426d512 100644 --- a/config/external/nss/Makefile.in +++ b/config/external/nss/Makefile.in @@ -193,15 +193,6 @@ DEFAULT_GMAKE_FLAGS += \ CPU_ARCH='$(TARGET_CPU)' \ $(NULL) -# Android has pthreads integrated into -lc, so OS_PTHREAD is set to nothing -ifeq ($(OS_TARGET), Android) -DEFAULT_GMAKE_FLAGS += \ - OS_RELEASE='2.6' \ - OS_PTHREAD= \ - $(NULL) - -DEFAULT_GMAKE_FLAGS += ARCHFLAG='$(filter-out -W%,$(CFLAGS)) -DCHECK_FORK_GETPID $(addprefix -DANDROID_VERSION=,$(ANDROID_VERSION)) -include $(topsrcdir)/security/manager/android_stub.h' -endif endif ifdef WRAP_LDFLAGS diff --git a/config/makefiles/java-build.mk b/config/makefiles/java-build.mk deleted file mode 100644 index bf667ac446..0000000000 --- a/config/makefiles/java-build.mk +++ /dev/null @@ -1,159 +0,0 @@ -# -*- makefile -*- -# vim:set ts=8 sw=8 sts=8 noet: -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this file, -# You can obtain one at http://mozilla.org/MPL/2.0/. - -ifndef INCLUDED_JAVA_BUILD_MK #{ - -ifdef JAVAFILES #{ -GENERATED_DIRS += classes - -export:: classes -classes: $(call mkdir_deps,classes) -endif #} JAVAFILES - -default_bootclasspath_jars := \ - $(ANDROID_SDK)/android.jar \ - $(NULL) - -default_classpath_jars := \ - $(NULL) - -# Turn a possibly empty list of JAR files into a Java classpath, like a.jar:b.jar. -# Arg 1: Possibly empty list of JAR files. -define classpath_template -$(subst $(NULL) ,:,$(strip $(1))) -endef - -ifdef ANDROID_APK_NAME #{ -$(if $(ANDROID_APK_PACKAGE),,$(error Missing ANDROID_APK_PACKAGE with ANDROID_APK_NAME)) - -android_res_dirs := $(or $(ANDROID_RES_DIRS),$(srcdir)/res) -_ANDROID_RES_FLAG := $(addprefix -S ,$(android_res_dirs)) -_ANDROID_ASSETS_FLAG := $(if $(ANDROID_ASSETS_DIRS),$(addprefix -A ,$(ANDROID_ASSETS_DIRS))) -android_manifest := $(or $(ANDROID_MANIFEST_FILE),AndroidManifest.xml) - -GENERATED_DIRS += classes generated - -generated_r_java := generated/$(subst .,/,$(ANDROID_APK_PACKAGE))/R.java - -classes.dex: $(call mkdir_deps,classes) -classes.dex: $(generated_r_java) -classes.dex: $(ANDROID_APK_NAME).ap_ -classes.dex: $(default_classpath_jars) $(ANDROID_CLASSPATH_JARS) -classes.dex: $(default_bootclasspath_jars) $(ANDROID_BOOTCLASSPATH_JARS) $(ANDROID_EXTRA_JARS) -classes.dex: $(JAVAFILES) - $(JAVAC) $(JAVAC_FLAGS) -d classes $(filter %.java,$^) \ - $(addprefix -bootclasspath ,$(call classpath_template,$(default_bootclasspath_jars) $(ANDROID_BOOTCLASSPATH_JARS))) \ - $(addprefix -classpath ,$(call classpath_template,$(default_classpath_jars) $(ANDROID_CLASSPATH_JARS) $(ANDROID_EXTRA_JARS))) - $(DX) --dex --output=$@ classes $(ANDROID_EXTRA_JARS) - -# R.java and $(ANDROID_APK_NAME).ap_ are both produced by aapt. To -# save an aapt invocation, we produce them both at the same time. The -# trailing semi-colon defines an empty recipe; defining no recipe at -# all causes Make to treat the target differently, in a way that -# defeats our dependencies. - -$(generated_r_java): .aapt.deps ; -$(ANDROID_APK_NAME).ap_: .aapt.deps ; - -# This uses the fact that Android resource directories list all -# resource files one subdirectory below the parent resource directory. -android_res_files := $(wildcard $(addsuffix /*,$(wildcard $(addsuffix /*,$(android_res_dirs))))) - -# An extra package like org.example.app generates dependencies like: -# generated/org/example/app/R.java: .aapt.deps ; -# classes.dex: generated/org/example/app/R.java -# GARBAGE: generated/org/example/app/R.java -$(foreach extra_package,$(ANDROID_EXTRA_PACKAGES), \ - $(eval generated/$(subst .,/,$(extra_package))/R.java: .aapt.deps ;) \ - $(eval classes.dex: generated/$(subst .,/,$(extra_package))/R.java) \ - $(eval GARBAGE: generated/$(subst .,/,$(extra_package))/R.java) \ -) - -# aapt flag -m: 'make package directories under location specified by -J'. -# The --extra-package list is colon separated. -.aapt.deps: $(android_manifest) $(android_res_files) $(wildcard $(ANDROID_ASSETS_DIRS)) - @$(TOUCH) $@ - $(AAPT) package -f -M $< -I $(ANDROID_SDK)/android.jar $(_ANDROID_RES_FLAG) $(_ANDROID_ASSETS_FLAG) \ - --custom-package $(ANDROID_APK_PACKAGE) \ - --non-constant-id \ - --auto-add-overlay \ - $(if $(ANDROID_EXTRA_PACKAGES),--extra-packages $(subst $(NULL) ,:,$(strip $(ANDROID_EXTRA_PACKAGES)))) \ - $(if $(ANDROID_EXTRA_RES_DIRS),$(addprefix -S ,$(ANDROID_EXTRA_RES_DIRS))) \ - -m \ - -J ${@D}/generated \ - -F $(ANDROID_APK_NAME).ap_ - -$(ANDROID_APK_NAME)-unsigned-unaligned.apk: $(ANDROID_APK_NAME).ap_ classes.dex - cp $< $@ - $(ZIP) -0 $@ classes.dex - -$(ANDROID_APK_NAME)-unaligned.apk: $(ANDROID_APK_NAME)-unsigned-unaligned.apk - cp $< $@ - $(DEBUG_JARSIGNER) $@ - -$(ANDROID_APK_NAME).apk: $(ANDROID_APK_NAME)-unaligned.apk - $(ZIPALIGN) -f 4 $< $@ - -GARBAGE += \ - $(generated_r_java) \ - classes.dex \ - $(ANDROID_APK_NAME).ap_ \ - $(ANDROID_APK_NAME)-unsigned-unaligned.apk \ - $(ANDROID_APK_NAME)-unaligned.apk \ - $(ANDROID_APK_NAME).apk \ - $(NULL) - -# Include Android specific java flags, instead of what's in rules.mk. -include $(topsrcdir)/config/android-common.mk -endif #} ANDROID_APK_NAME - - -ifdef JAVA_JAR_TARGETS #{ -# Arg 1: Output target name with .jar suffix, like jars/jarfile.jar. -# Intermediate class files are generated in jars/jarfile-classes. -# Arg 2: Java sources list. We use VPATH and $^ so sources can be -# relative to $(srcdir) or $(CURDIR). -# Arg 3: List of extra jars to link against. We do not use VPATH so -# jars must be relative to $(CURDIR). -# Arg 4: Additional JAVAC_FLAGS. - -# Note: Proguard fails when stale .class files corresponding to -# removed inner classes are present in the object directory. These -# stale class files get packaged into the .jar file, which then gets -# processed by Proguard. To work around this, we always delete any -# existing jarfile-classes directory and start fresh. - -define java_jar_template -$(1): $(2) $(3) $(default_bootclasspath_jars) $(default_classpath_jars) - $$(REPORT_BUILD) - @$$(RM) -rf $(1:.jar=)-classes - @$$(NSINSTALL) -D $(1:.jar=)-classes - @$$(if $$(filter-out .,$$(@D)),$$(NSINSTALL) -D $$(@D)) - $$(JAVAC) $$(JAVAC_FLAGS)\ - $(4)\ - -d $(1:.jar=)-classes\ - $(addprefix -bootclasspath ,$(call classpath_template,$(default_bootclasspath_jars)))\ - $(addprefix -classpath ,$(call classpath_template,$(default_classpath_jars) $(3)))\ - $$(filter %.java,$$^) - $$(JAR) cMf $$@ -C $(1:.jar=)-classes . - -GARBAGE += $(1) - -GARBAGE_DIRS += $(1:.jar=)-classes -endef - -$(foreach jar,$(JAVA_JAR_TARGETS),\ - $(if $($(jar)_DEST),,$(error Missing $(jar)_DEST))\ - $(if $($(jar)_JAVAFILES) $($(jar)_PP_JAVAFILES),,$(error Must provide at least one of $(jar)_JAVAFILES and $(jar)_PP_JAVAFILES))\ - $(eval $(call java_jar_template,$($(jar)_DEST),$($(jar)_JAVAFILES) $($(jar)_PP_JAVAFILES),$($(jar)_EXTRA_JARS),$($(jar)_JAVAC_FLAGS)))\ -) -endif #} JAVA_JAR_TARGETS - - -INCLUDED_JAVA_BUILD_MK := 1 - -endif #} INCLUDED_JAVA_BUILD_MK diff --git a/config/rules.mk b/config/rules.mk index 07b347a94d..840e266ba5 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -1040,13 +1040,6 @@ else normalizepath = $(1) endif -############################################################################### -# Java rules -############################################################################### -ifneq (,$(JAVAFILES)$(ANDROID_RESFILES)$(ANDROID_APKNAME)$(JAVA_JAR_TARGETS)) - include $(MOZILLA_DIR)/config/makefiles/java-build.mk -endif - ############################################################################### # Bunch of things that extend the 'export' rule (in order): ############################################################################### -- cgit v1.2.3