bug 747540: fix dependencies for java build

This commit is contained in:
Joey Armstrong 2013-01-25 15:22:13 -05:00
Родитель b60977be36
Коммит 7a30d49506
10 изменённых файлов: 97 добавлений и 26 удалений

Просмотреть файл

@ -42,11 +42,15 @@ GARBAGE += \
AndroidManifest.xml \
classes.dex \
sutAgentAndroid.apk \
sutAgentAndroid.ap_ \
sutAgentAndroid-unsigned-unaligned.apk \
sutAgentAndroid-unaligned.apk \
$(NULL)
GARBAGE_DIRS += res classes network-libs
GARBAGE_DIRS += network-libs
EXTRA_JARS = $(srcdir)/network-libs/commons-net-2.0.jar:$(srcdir)/network-libs/jmdns.jar
JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar:$(EXTRA_JARS)
include $(topsrcdir)/config/rules.mk
@ -57,26 +61,20 @@ include $(topsrcdir)/config/android-common.mk
tools:: sutAgentAndroid.apk
classes.dex: $(JAVAFILES)
$(NSINSTALL) -D classes
$(JAVAC) $(JAVAC_FLAGS) -d classes $(addprefix $(srcdir)/,$(JAVAFILES))
$(DX) --dex --output=$@ classes $(subst :, ,$(EXTRA_JARS))
sutAgentAndroid.ap_: $(srcdir)/AndroidManifest.xml
$(AAPT) package -f -M $(srcdir)/AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -F $@
$(AAPT) package -f -M $< -I $(ANDROID_SDK)/android.jar -S res -F $@
sutAgentAndroid-unsigned-unaligned.apk: sutAgentAndroid.ap_ classes.dex
$(APKBUILDER) $@ -v $(APKBUILDER_FLAGS) -z sutAgentAndroid.ap_ -f classes.dex
sutAgentAndroid-unaligned.apk: sutAgentAndroid-unsigned-unaligned.apk
cp sutAgentAndroid-unsigned-unaligned.apk $@
cp $< $@
ifdef JARSIGNER
$(JARSIGNER) $@
endif
sutAgentAndroid.apk: sutAgentAndroid-unaligned.apk
$(ZIPALIGN) -f -v 4 sutAgentAndroid-unaligned.apk $@
export::
$(NSINSTALL) -D res
@(cd $(srcdir)/res && tar $(TAR_CREATE_FLAGS) - *) | (cd $(DEPTH)/build/mobile/sutagent/android/res && tar -xf -)

Просмотреть файл

@ -33,7 +33,7 @@ GARBAGE += \
FenCP.apk \
$(NULL)
GARBAGE_DIRS += res classes network-libs
GARBAGE_DIRS += network-libs
JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar
@ -45,7 +45,6 @@ include $(topsrcdir)/config/android-common.mk
tools:: FenCP.apk
classes.dex: $(JAVAFILES)
$(NSINSTALL) -D classes
$(JAVAC) $(JAVAC_FLAGS) -d classes $(addprefix $(srcdir)/,$(JAVAFILES))
$(DX) --dex --output=$@ classes
@ -63,8 +62,3 @@ endif
FenCP.apk: FenCP-unaligned.apk
$(ZIPALIGN) -f -v 4 FenCP-unaligned.apk $@
export::
$(NSINSTALL) -D res
@(cd $(srcdir)/res && tar $(TAR_CREATE_FLAGS) - *) | (cd $(DEPTH)/build/mobile/sutagent/android/fencp/res && tar -xf -)

Просмотреть файл

@ -33,7 +33,7 @@ GARBAGE += \
FfxCP.apk \
$(NULL)
GARBAGE_DIRS += res classes network-libs
GARBAGE_DIRS += network-libs
JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar
@ -45,7 +45,6 @@ include $(topsrcdir)/config/android-common.mk
tools:: FfxCP.apk
classes.dex: $(JAVAFILES)
$(NSINSTALL) -D classes
$(JAVAC) $(JAVAC_FLAGS) -d classes $(addprefix $(srcdir)/,$(JAVAFILES))
$(DX) --dex --output=$@ classes
@ -63,8 +62,3 @@ endif
FfxCP.apk: FfxCP-unaligned.apk
$(ZIPALIGN) -f -v 4 FfxCP-unaligned.apk $@
export::
$(NSINSTALL) -D res
@(cd $(srcdir)/res && tar $(TAR_CREATE_FLAGS) - *) | (cd $(DEPTH)/build/mobile/sutagent/android/ffxcp/res && tar -xf -)

Просмотреть файл

@ -0,0 +1,37 @@
# -*- 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 RES_FILES #{
res-dep := .deps-copy-java-res
GENERATED_DIRS += res
GARBAGE += $(res-dep)
export:: $(res-dep)
res-dep-preqs := \
$(addprefix $(srcdir)/,$(RES_FILES)) \
$(call mkdir_deps,res) \
$(if $(IS_LANGUAGE_REPACK),FORCE) \
$(NULL)
# nop-build: only copy res/ files when needed
$(res-dep): $(res-dep-preqs)
$(call copy_dir,$(srcdir)/res,$(CURDIR)/res)
@$(TOUCH) $@
endif #}
ifdef JAVAFILES #{
GENERATED_DIRS += classes
endif #}
INCLUDED_JAVA_BUILD_MK := 1
endif #} INCLUDED_JAVA_BUILD_MK

Просмотреть файл

@ -112,3 +112,6 @@ topORerr =$(if $(topsrcdir),$(topsrcdir),$(error topsrcdir is not defined))
ifdef USE_AUTOTARGETS_MK # mkdir_deps
include $(topORerr)/config/makefiles/autotargets.mk
endif
## copy(src, dst): recursive copy
copy_dir = (cd $(1)/. && $(TAR) $(TAR_CREATE_FLAGS_QUIET) - .) | (cd $(2)/. && tar -xf -)

Просмотреть файл

@ -1100,6 +1100,10 @@ else
normalizepath = $(1)
endif
ifneq (,$(value JAVAFILES)$(value RESFILES))
include $(topsrcdir)/config/makefiles/java-build.mk
endif
_srcdir = $(call normalizepath,$(srcdir))
ifdef JAVA_SOURCEPATH
SP = $(subst $(SPACE),$(SEP),$(call normalizepath,$(strip $(JAVA_SOURCEPATH))))

Просмотреть файл

@ -72,8 +72,6 @@ GARBAGE += \
R.java \
$(NULL)
GARBAGE_DIRS += classes res
# Bug 567884 - Need a way to find appropriate icons during packaging
ifeq ($(MOZ_APP_NAME),fennec)
ICON_PATH = $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/content/fennec_48x48.png
@ -134,7 +132,6 @@ include $(topsrcdir)/config/android-common.mk
# Note that we're going to set up a dependency directly between embed_android.dex and the java files
# Instead of on the .class files, since more than one .class file might be produced per .java file
classes.dex: $(JAVAFILES) $(PROCESSEDJAVAFILES) R.java
$(NSINSTALL) -D classes
$(JAVAC) $(JAVAC_FLAGS) -d classes $(addprefix $(srcdir)/,$(JAVAFILES)) $(PROCESSEDJAVAFILES) R.java
$(DX) --dex --output=$@ classes

Просмотреть файл

@ -0,0 +1,37 @@
# -*- 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 RES_FILES #{
res-dep := .deps-copy-java-res
GENERATED_DIRS += res
GARBAGE += $(res-dep)
export:: $(res-dep)
res-dep-preqs := \
$(addprefix $(srcdir)/,$(RES_FILES)) \
$(call mkdir_deps,res) \
$(if $(IS_LANGUAGE_REPACK),FORCE) \
$(NULL)
# nop-build: only copy res/ files when needed
$(res-dep): $(res-dep-preqs)
$(call copy_dir,$(srcdir)/res,$(CURDIR)/res)
@$(TOUCH) $@
endif #}
ifdef JAVAFILES #{
GENERATED_DIRS += classes
endif #}
INCLUDED_JAVA_BUILD_MK := 1
endif #} INCLUDED_JAVA_BUILD_MK

Просмотреть файл

@ -112,3 +112,6 @@ topORerr =$(if $(topsrcdir),$(topsrcdir),$(error topsrcdir is not defined))
ifdef USE_AUTOTARGETS_MK # mkdir_deps
include $(topORerr)/config/makefiles/autotargets.mk
endif
## copy(src, dst): recursive copy
copy_dir = (cd $(1)/. && $(TAR) $(TAR_CREATE_FLAGS_QUIET) - .) | (cd $(2)/. && tar -xf -)

Просмотреть файл

@ -1100,6 +1100,10 @@ else
normalizepath = $(1)
endif
ifneq (,$(value JAVAFILES)$(value RESFILES))
include $(topsrcdir)/config/makefiles/java-build.mk
endif
_srcdir = $(call normalizepath,$(srcdir))
ifdef JAVA_SOURCEPATH
SP = $(subst $(SPACE),$(SEP),$(call normalizepath,$(strip $(JAVA_SOURCEPATH))))