build/mobile/robocop/Makefile.in
author Nick Alexander <nalexander@mozilla.com>
Wed, 29 Apr 2015 21:40:21 -0700
changeset 241855 0ae19cd0a1f76a041b2b063278478e57a71f74aa
parent 241704 556e96942c272122d11573c180f8db4fc4bb6dfc
child 241856 3c3f5eb8b3d6edf133fc0493864cad73d9842785
permissions -rw-r--r--
Bug 1160030 - Use TEST_HARNESS_FILES to install Robocop test files. r=froydnj

# 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/.

mobile-tests := mobile/android/base/tests
TESTPATH     := $(topsrcdir)/$(mobile-tests)
dir-tests    := $(DEPTH)/$(mobile-tests)

ANDROID_APK_NAME := robocop-debug

ANDROID_EXTRA_JARS += \
  $(srcdir)/robotium-solo-4.3.1.jar \
  $(NULL)

ANDROID_ASSETS_DIR := $(TESTPATH)/assets

_JAVA_HARNESS := \
  Actions.java \
  Assert.java \
  Driver.java \
  Element.java \
  FennecInstrumentationTestRunner.java \
  FennecNativeActions.java \
  FennecMochitestAssert.java \
  FennecTalosAssert.java \
  FennecNativeDriver.java \
  FennecNativeElement.java \
  RoboCopException.java \
  RobocopShare1.java \
  RobocopShare2.java \
  RobocopUtils.java \
  PaintedSurface.java \
  StructuredLogger.java \
  $(NULL)

java-harness := $(addprefix $(srcdir)/,$(_JAVA_HARNESS))
java-tests   := \
  $(wildcard $(TESTPATH)/*.java) \
  $(wildcard $(TESTPATH)/components/*.java) \
  $(wildcard $(TESTPATH)/helpers/*.java)

PP_TARGETS += manifest
manifest := $(srcdir)/AndroidManifest.xml.in
manifest_TARGET := export
manifest_FLAGS += \
  -DMOZ_ANDROID_SHARED_ID='$(ANDROID_PACKAGE_NAME).sharedID' \
  -DMOZ_ANDROID_SHARED_ACCOUNT_TYPE='$(ANDROID_PACKAGE_NAME)_sync' \
  $(NULL)

ANDROID_MANIFEST_FILE := $(CURDIR)/AndroidManifest.xml

# Install robocop configs and helper
INSTALL_TARGETS += robocop
robocop_TARGET  := export
robocop_DEST    := $(CURDIR)
robocop_FILES   := \
  $(TESTPATH)/robocop.ini \
  $(TESTPATH)/robocop_autophone.ini \
  $(NULL)
robocop-deps := $(notdir $(robocop_FILES))

GARBAGE += \
  AndroidManifest.xml \
  $(robocop-deps) \
  $(testconstants-dep) \
  $(NULL)

JAVAFILES += \
  $(java-harness) \
  $(java-tests) \
  $(robocop-deps) \
  $(testconstants-dep) \
  $(NULL)

include $(topsrcdir)/config/rules.mk

tools:: $(ANDROID_APK_NAME).apk

GENERATED_DIRS += $(dir-tests)

# The test APK needs to know the contents of the target APK while not
# being linked against them.  This is a best effort to avoid getting
# out of sync with base's build config.
jars_dir := $(DEPTH)/mobile/android/base
stumbler_jars_dir := $(DEPTH)/mobile/android/stumbler
JAVA_BOOTCLASSPATH := $(JAVA_BOOTCLASSPATH):$(subst $(NULL) ,:,$(wildcard $(jars_dir)/*.jar)):$(subst $(NULL) ,:,$(wildcard $(stumbler_jars_dir)/*.jar)):$(ANDROID_COMPAT_LIB)
# We also want to re-compile classes.dex when the associated base
# content changes.
classes.dex: $(wildcard $(jars_dir)/*.jar)
classes.dex: $(wildcard $(stumbler_jars_dir)/*.jar)