• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Uses the following variables:
2#
3#   LOCAL_INSTRUMENTATION_FOR - specifies the name of the module that produces the APK under test
4#
5
6# Define a variable storing the location of the generated test_config.properties file.
7test_config_dir := $(call local-intermediates-dir)/test_config
8test_config_file := $(test_config_dir)/com/android/tools/test_config.properties
9
10# Indicate that the generated file should be included in the output jar as a java resource.
11LOCAL_JAVA_RESOURCE_FILES += $(test_config_dir):com/android/tools/test_config.properties
12
13# Define variables to be written into the generated test_config.properties file.
14android_merged_manifest := $(strip $(call intermediates-dir-for,APPS,$(LOCAL_INSTRUMENTATION_FOR),,COMMON)/manifest/AndroidManifest.xml)
15android_resource_apk := $(strip $(call apk-location-for,$(LOCAL_INSTRUMENTATION_FOR)))
16
17# Snapshot the written variables so they cannot be polluted before the module is built.
18$(test_config_file): private_android_merged_manifest := $(android_merged_manifest)
19$(test_config_file): private_android_resource_apk := $(android_resource_apk)
20
21# Generate the test_config.properties file. Make it depend on the files to which it points.
22$(test_config_file):$(android_merged_manifest) $(android_resource_apk)
23	$(hide) rm -f $@
24	$(hide) echo "android_merged_manifest=$(private_android_merged_manifest)" >>$@
25	$(hide) echo "android_resource_apk=$(private_android_resource_apk)" >>$@