2012-05-21 11:12:37 +00:00
|
|
|
# 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/.
|
2011-12-22 14:09:41 +00:00
|
|
|
|
2012-08-04 18:26:44 +00:00
|
|
|
DEPTH = @DEPTH@
|
2011-12-22 14:09:41 +00:00
|
|
|
topsrcdir = @top_srcdir@
|
|
|
|
srcdir = @srcdir@
|
|
|
|
VPATH = @srcdir@
|
2013-03-19 19:34:59 +00:00
|
|
|
|
|
|
|
mobile-tests := mobile/android/base/tests
|
|
|
|
TESTPATH := $(topsrcdir)/$(mobile-tests)
|
|
|
|
dir-tests := $(DEPTH)/$(mobile-tests)
|
2011-12-22 14:09:41 +00:00
|
|
|
|
|
|
|
include $(DEPTH)/config/autoconf.mk
|
|
|
|
|
2013-06-20 18:50:28 +00:00
|
|
|
ANDROID_APK_NAME := robocop-debug
|
|
|
|
|
2013-02-23 22:42:33 +00:00
|
|
|
ROBOTIUM_PATH = $(srcdir)/robotium-solo-3.6.jar
|
2011-12-22 14:09:41 +00:00
|
|
|
|
|
|
|
JAVAFILES = \
|
|
|
|
R.java \
|
2013-03-19 19:34:59 +00:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
RES_FILES = \
|
|
|
|
res/values/strings.xml \
|
|
|
|
$(NULL)
|
2011-12-22 14:09:41 +00:00
|
|
|
|
|
|
|
_JAVA_HARNESS = \
|
2011-12-30 20:57:34 +00:00
|
|
|
Actions.java \
|
|
|
|
Assert.java \
|
2011-12-22 14:09:41 +00:00
|
|
|
Driver.java \
|
|
|
|
Element.java \
|
2012-09-12 11:56:31 +00:00
|
|
|
FennecInstrumentationTestRunner.java \
|
2011-12-30 20:57:34 +00:00
|
|
|
FennecNativeActions.java \
|
2012-02-02 15:09:26 +00:00
|
|
|
FennecMochitestAssert.java \
|
|
|
|
FennecTalosAssert.java \
|
2011-12-30 20:57:34 +00:00
|
|
|
FennecNativeDriver.java \
|
2011-12-22 14:09:41 +00:00
|
|
|
FennecNativeElement.java \
|
|
|
|
RoboCopException.java \
|
2013-03-22 01:43:04 +00:00
|
|
|
RobocopUtils.java \
|
2012-03-06 20:08:45 +00:00
|
|
|
PaintedSurface.java \
|
2011-12-30 20:57:34 +00:00
|
|
|
$(NULL)
|
2011-12-22 14:09:41 +00:00
|
|
|
|
2013-03-19 19:34:59 +00:00
|
|
|
# pre-process harness sources
|
|
|
|
PP_TARGETS += java-harness
|
|
|
|
java-harness := $(addprefix $(srcdir)/,$(addsuffix .in,$(_JAVA_HARNESS)))
|
|
|
|
java-harness-dep := $(addprefix $(CURDIR)/,$(_JAVA_HARNESS))
|
|
|
|
java-harness_PATH := $(CURDIR)
|
|
|
|
|
|
|
|
# pre-process test sources
|
|
|
|
PP_TARGETS += java-tests
|
|
|
|
java-tests-src := $(wildcard $(TESTPATH)/*.java.in)
|
|
|
|
java-tests-dep := $(patsubst $(TESTPATH)/%.java.in,$(dir-tests)/%.java,$(java-tests-src))
|
|
|
|
java-tests := $(java-tests-src)
|
|
|
|
java-tests_PATH := $(dir-tests)
|
|
|
|
|
|
|
|
PP_TARGETS += manifest
|
|
|
|
manifest := $(srcdir)/AndroidManifest.xml.in
|
|
|
|
manifest_TARGET := AndroidManifest.xml
|
|
|
|
|
|
|
|
|
|
|
|
# Install robocop configs and helper
|
|
|
|
INSTALL_TARGETS += robocop
|
|
|
|
robocop_TARGET := libs
|
|
|
|
robocop_DEST := $(CURDIR)
|
|
|
|
robocop_FILES := \
|
|
|
|
$(TESTPATH)/robocop.ini \
|
|
|
|
$(TESTPATH)/robocop_autophone.ini \
|
|
|
|
$(NULL)
|
|
|
|
robocop-deps := $(notdir $(robocop_FILES))
|
2011-12-22 14:09:41 +00:00
|
|
|
|
2013-03-19 19:34:59 +00:00
|
|
|
MOCHITEST_ROBOCOP_FILES := \
|
2012-03-07 21:58:31 +00:00
|
|
|
$(wildcard $(TESTPATH)/*.html) \
|
2013-02-26 12:46:02 +00:00
|
|
|
$(wildcard $(TESTPATH)/*.jpg) \
|
2012-03-07 21:58:31 +00:00
|
|
|
$(wildcard $(TESTPATH)/*.sjs) \
|
2013-05-11 02:45:58 +00:00
|
|
|
$(wildcard $(TESTPATH)/test*.js) \
|
|
|
|
$(wildcard $(TESTPATH)/robocop*.js) \
|
2013-06-06 02:29:44 +00:00
|
|
|
$(wildcard $(TESTPATH)/*.xml) \
|
2012-03-07 21:58:31 +00:00
|
|
|
$(NULL)
|
2011-12-30 20:57:34 +00:00
|
|
|
|
2011-12-22 14:09:41 +00:00
|
|
|
GARBAGE += \
|
|
|
|
AndroidManifest.xml \
|
2013-03-19 19:34:59 +00:00
|
|
|
$(java-tests-dep) \
|
|
|
|
$(_JAVA_HARNESS) \
|
2011-12-22 14:09:41 +00:00
|
|
|
classes.dex \
|
2013-06-20 18:50:28 +00:00
|
|
|
$(ANDROID_APK_NAME).ap_ \
|
|
|
|
$(ANDROID_APK_NAME)-unsigned-unaligned.apk \
|
|
|
|
$(ANDROID_APK_NAME)-unaligned.apk \
|
|
|
|
$(ANDROID_APK_NAME).apk \
|
2013-03-19 19:34:59 +00:00
|
|
|
$(robocop-deps) \
|
2011-12-22 14:09:41 +00:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
DEFINES += \
|
|
|
|
-DANDROID_PACKAGE_NAME=$(ANDROID_PACKAGE_NAME) \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar:$(ROBOTIUM_PATH)
|
|
|
|
|
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
|
|
|
|
# Override rules.mk java flags with the android specific ones
|
|
|
|
include $(topsrcdir)/config/android-common.mk
|
|
|
|
|
2013-03-19 19:34:59 +00:00
|
|
|
GENERATED_DIRS_tools = classes $(dir-tests)
|
2013-01-03 18:12:36 +00:00
|
|
|
|
2013-06-20 18:50:28 +00:00
|
|
|
tools:: $(ANDROID_APK_NAME).apk
|
2011-12-22 14:09:41 +00:00
|
|
|
|
2013-06-20 18:50:28 +00:00
|
|
|
classes.dex: $(ANDROID_APK_NAME).ap_
|
2013-03-19 19:34:59 +00:00
|
|
|
classes.dex: $(robocop-deps)
|
|
|
|
classes.dex: $(java-harness-dep)
|
|
|
|
classes.dex: $(java-tests-dep)
|
|
|
|
$(JAVAC) $(JAVAC_FLAGS) -d classes $(JAVAFILES) $(_JAVA_HARNESS) $(java-tests-dep)
|
2012-11-08 15:45:29 +00:00
|
|
|
$(DX) --dex --output=$@ classes $(ROBOTIUM_PATH) $(ANDROID_COMPT_LIB)
|
2011-12-22 14:09:41 +00:00
|
|
|
|
2013-06-20 18:50:28 +00:00
|
|
|
$(ANDROID_APK_NAME).ap_: AndroidManifest.xml $(TESTPATH)/assets/*
|
2013-03-19 19:34:59 +00:00
|
|
|
$(AAPT) package -f -M $< -I $(ANDROID_SDK)/android.jar -I . -S res -A $(TESTPATH)/assets -F $@ -J ./
|
2011-12-22 14:09:41 +00:00
|
|
|
|
2013-06-20 18:50:28 +00:00
|
|
|
$(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) $@
|
2013-05-20 18:39:50 +00:00
|
|
|
|
2013-06-20 18:50:28 +00:00
|
|
|
$(ANDROID_APK_NAME).apk: $(ANDROID_APK_NAME)-unaligned.apk
|
|
|
|
$(ZIPALIGN) -f -v 4 $< $@
|
2013-05-20 18:39:50 +00:00
|
|
|
|
2013-03-19 19:34:59 +00:00
|
|
|
# PP_java-tests not fully usable here
|
|
|
|
# Intermediate step toward a library rule.
|
|
|
|
$(dir-tests)/%.java: $(TESTPATH)/%.java.in $(call mkdir_deps,$(dir-tests))
|
|
|
|
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $< > $@
|