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

ANDROID_APK_NAME := background-junit3-debug

PP_TARGETS        += manifest
manifest          := $(srcdir)/AndroidManifest.xml.in
manifest_TARGET   := AndroidManifest.xml
manifest_FLAGS    += \
  -DANDROID_BACKGROUND_TARGET_PACKAGE_NAME='$(ANDROID_PACKAGE_NAME)' \
  -DANDROID_BACKGROUND_APP_DISPLAYNAME='$(MOZ_APP_DISPLAYNAME) Background Tests' \
  -DMOZ_ANDROID_SHARED_ID='$(ANDROID_PACKAGE_NAME).sharedID' \
  -DMOZ_ANDROID_SHARED_ACCOUNT_TYPE='$(ANDROID_PACKAGE_NAME)_sync' \
  $(NULL)
ANDROID_MANIFEST_FILE := $(CURDIR)/AndroidManifest.xml

GARBAGE += AndroidManifest.xml

include $(srcdir)/android-services-files.mk

# BACKGROUND_TESTS_{JAVA,RES}_FILES are defined in android-services-files.mk.
JAVAFILES := $(BACKGROUND_TESTS_JAVA_FILES)

# 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
JAVA_BOOTCLASSPATH := $(JAVA_BOOTCLASSPATH):$(subst $(NULL) ,:,$(wildcard $(JARS_DIR)/*.jar))
# We also want to re-compile classes.dex when the associated base
# content changes.
classes.dex: $(wildcard $(JARS_DIR)/*.jar)

tools:: $(ANDROID_APK_NAME).apk

include $(topsrcdir)/config/rules.mk
