2012-05-21 04:12:37 -07: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 06:09:41 -08:00
|
|
|
|
2012-08-04 11:26:44 -07:00
|
|
|
DEPTH = @DEPTH@
|
2011-12-22 06:09:41 -08:00
|
|
|
topsrcdir = @top_srcdir@
|
|
|
|
srcdir = @srcdir@
|
|
|
|
VPATH = @srcdir@
|
2013-03-19 12:34:59 -07:00
|
|
|
|
|
|
|
mobile-tests := mobile/android/base/tests
|
|
|
|
TESTPATH := $(topsrcdir)/$(mobile-tests)
|
|
|
|
dir-tests := $(DEPTH)/$(mobile-tests)
|
2011-12-22 06:09:41 -08:00
|
|
|
|
|
|
|
include $(DEPTH)/config/autoconf.mk
|
|
|
|
|
2013-06-20 11:50:28 -07:00
|
|
|
ANDROID_APK_NAME := robocop-debug
|
|
|
|
|
2013-02-23 14:42:33 -08:00
|
|
|
ROBOTIUM_PATH = $(srcdir)/robotium-solo-3.6.jar
|
2011-12-22 06:09:41 -08:00
|
|
|
|
|
|
|
JAVAFILES = \
|
|
|
|
R.java \
|
2013-03-19 12:34:59 -07:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
RES_FILES = \
|
|
|
|
res/values/strings.xml \
|
|
|
|
$(NULL)
|
2011-12-22 06:09:41 -08:00
|
|
|
|
|
|
|
_JAVA_HARNESS = \
|
2011-12-30 12:57:34 -08:00
|
|
|
Actions.java \
|
|
|
|
Assert.java \
|
2011-12-22 06:09:41 -08:00
|
|
|
Driver.java \
|
|
|
|
Element.java \
|
2012-09-12 04:56:31 -07:00
|
|
|
FennecInstrumentationTestRunner.java \
|
2011-12-30 12:57:34 -08:00
|
|
|
FennecNativeActions.java \
|
2012-02-02 07:09:26 -08:00
|
|
|
FennecMochitestAssert.java \
|
|
|
|
FennecTalosAssert.java \
|
2011-12-30 12:57:34 -08:00
|
|
|
FennecNativeDriver.java \
|
2011-12-22 06:09:41 -08:00
|
|
|
FennecNativeElement.java \
|
|
|
|
RoboCopException.java \
|
2013-03-21 18:43:04 -07:00
|
|
|
RobocopUtils.java \
|
2012-03-06 12:08:45 -08:00
|
|
|
PaintedSurface.java \
|
2011-12-30 12:57:34 -08:00
|
|
|
$(NULL)
|
2011-12-22 06:09:41 -08:00
|
|
|
|
2013-03-19 12:34:59 -07: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 06:09:41 -08:00
|
|
|
|
2013-03-19 12:34:59 -07:00
|
|
|
MOCHITEST_ROBOCOP_FILES := \
|
2012-03-07 13:58:31 -08:00
|
|
|
$(wildcard $(TESTPATH)/*.html) \
|
2013-02-26 04:46:02 -08:00
|
|
|
$(wildcard $(TESTPATH)/*.jpg) \
|
2012-03-07 13:58:31 -08:00
|
|
|
$(wildcard $(TESTPATH)/*.sjs) \
|
2013-05-10 19:45:58 -07:00
|
|
|
$(wildcard $(TESTPATH)/test*.js) \
|
|
|
|
$(wildcard $(TESTPATH)/robocop*.js) \
|
2013-06-05 19:29:44 -07:00
|
|
|
$(wildcard $(TESTPATH)/*.xml) \
|
2012-03-07 13:58:31 -08:00
|
|
|
$(NULL)
|
2011-12-30 12:57:34 -08:00
|
|
|
|
2011-12-22 06:09:41 -08:00
|
|
|
GARBAGE += \
|
|
|
|
AndroidManifest.xml \
|
2013-03-19 12:34:59 -07:00
|
|
|
$(java-tests-dep) \
|
|
|
|
$(_JAVA_HARNESS) \
|
2011-12-22 06:09:41 -08:00
|
|
|
classes.dex \
|
2013-06-20 11:50:28 -07:00
|
|
|
$(ANDROID_APK_NAME).ap_ \
|
|
|
|
$(ANDROID_APK_NAME)-unsigned-unaligned.apk \
|
|
|
|
$(ANDROID_APK_NAME)-unaligned.apk \
|
|
|
|
$(ANDROID_APK_NAME).apk \
|
2013-03-19 12:34:59 -07:00
|
|
|
$(robocop-deps) \
|
2011-12-22 06:09:41 -08: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 12:34:59 -07:00
|
|
|
GENERATED_DIRS_tools = classes $(dir-tests)
|
2013-01-03 10:12:36 -08:00
|
|
|
|
2013-06-20 11:50:28 -07:00
|
|
|
tools:: $(ANDROID_APK_NAME).apk
|
2011-12-22 06:09:41 -08:00
|
|
|
|
2013-06-20 11:50:28 -07:00
|
|
|
classes.dex: $(ANDROID_APK_NAME).ap_
|
2013-03-19 12:34:59 -07: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 07:45:29 -08:00
|
|
|
$(DX) --dex --output=$@ classes $(ROBOTIUM_PATH) $(ANDROID_COMPT_LIB)
|
2011-12-22 06:09:41 -08:00
|
|
|
|
2013-06-20 11:50:28 -07:00
|
|
|
$(ANDROID_APK_NAME).ap_: AndroidManifest.xml $(TESTPATH)/assets/*
|
2013-03-19 12:34:59 -07:00
|
|
|
$(AAPT) package -f -M $< -I $(ANDROID_SDK)/android.jar -I . -S res -A $(TESTPATH)/assets -F $@ -J ./
|
2011-12-22 06:09:41 -08:00
|
|
|
|
2013-06-20 11:50:28 -07: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 11:39:50 -07:00
|
|
|
|
2013-06-20 11:50:28 -07:00
|
|
|
$(ANDROID_APK_NAME).apk: $(ANDROID_APK_NAME)-unaligned.apk
|
|
|
|
$(ZIPALIGN) -f -v 4 $< $@
|
2013-05-20 11:39:50 -07:00
|
|
|
|
2013-03-19 12:34:59 -07: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) $< > $@
|