Colin Cross | e05e6df | 2017-11-15 21:35:27 -0800 | [diff] [blame] | 1 | # App prebuilt coming from Soong. |
| 2 | # Extra inputs: |
| 3 | # LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE |
| 4 | |
| 5 | ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) |
| 6 | $(call pretty-error,soong_app_prebuilt.mk may only be used from Soong) |
| 7 | endif |
| 8 | |
| 9 | LOCAL_MODULE_SUFFIX := .apk |
| 10 | LOCAL_BUILT_MODULE_STEM := package.apk |
| 11 | |
| 12 | ####################################### |
| 13 | include $(BUILD_SYSTEM)/base_rules.mk |
| 14 | ####################################### |
| 15 | |
Colin Cross | 75a698b | 2017-12-14 13:19:46 -0800 | [diff] [blame] | 16 | full_classes_jar := $(intermediates.COMMON)/classes.jar |
| 17 | full_classes_pre_proguard_jar := $(intermediates.COMMON)/classes-pre-proguard.jar |
| 18 | full_classes_header_jar := $(intermediates.COMMON)/classes-header.jar |
| 19 | |
| 20 | $(eval $(call copy-one-file,$(LOCAL_SOONG_CLASSES_JAR),$(full_classes_jar))) |
| 21 | $(eval $(call copy-one-file,$(LOCAL_SOONG_CLASSES_JAR),$(full_classes_pre_proguard_jar))) |
| 22 | |
Colin Cross | 20e06d2 | 2018-01-02 13:16:43 -0800 | [diff] [blame^] | 23 | ifdef LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR |
| 24 | $(eval $(call copy-one-file,$(LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR),\ |
| 25 | $(intermediates.COMMON)/jacoco-report-classes.jar)) |
| 26 | $(call add-dependency,$(LOCAL_BUILT_MODULE),\ |
| 27 | $(intermediates.COMMON)/jacoco-report-classes.jar) |
| 28 | endif |
| 29 | |
Colin Cross | 75a698b | 2017-12-14 13:19:46 -0800 | [diff] [blame] | 30 | ifneq ($(TURBINE_DISABLED),false) |
| 31 | ifdef LOCAL_SOONG_HEADER_JAR |
| 32 | $(eval $(call copy-one-file,$(LOCAL_SOONG_HEADER_JAR),$(full_classes_header_jar))) |
| 33 | else |
| 34 | $(eval $(call copy-one-file,$(full_classes_jar),$(full_classes_header_jar))) |
| 35 | endif |
| 36 | endif # TURBINE_DISABLED != false |
| 37 | |
| 38 | |
Colin Cross | e05e6df | 2017-11-15 21:35:27 -0800 | [diff] [blame] | 39 | $(eval $(call copy-one-file,$(LOCAL_PREBUILT_MODULE_FILE),$(LOCAL_BUILT_MODULE))) |
| 40 | |
| 41 | ifdef LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE |
| 42 | resource_export_package := $(intermediates.COMMON)/package-export.apk |
| 43 | resource_export_stamp := $(intermediates.COMMON)/src/R.stamp |
| 44 | |
| 45 | $(resource_export_package): PRIVATE_STAMP := $(resource_export_stamp) |
| 46 | $(resource_export_package): .KATI_IMPLICIT_OUTPUTS := $(resource_export_stamp) |
| 47 | $(resource_export_package): $(LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE) |
| 48 | @echo "Copy: $$@" |
| 49 | $(copy-file-to-target) |
| 50 | touch $(PRIVATE_STAMP) |
| 51 | |
| 52 | endif # LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE |
| 53 | |
| 54 | java-dex: $(LOCAL_SOONG_DEX_JAR) |
| 55 | |
| 56 | ifdef LOCAL_DEX_PREOPT |
| 57 | # defines built_odex along with rule to install odex |
| 58 | include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk |
| 59 | |
| 60 | $(built_odex): $(LOCAL_SOONG_DEX_JAR) |
| 61 | $(call dexpreopt-one-file,$<,$@) |
| 62 | endif |
| 63 | |
Colin Cross | aec3640 | 2017-12-14 11:20:27 -0800 | [diff] [blame] | 64 | PACKAGES := $(PACKAGES) $(LOCAL_MODULE) |
| 65 | ifdef LOCAL_CERTIFICATE |
Colin Cross | 4e34ce0 | 2017-12-15 13:20:27 -0800 | [diff] [blame] | 66 | PACKAGES.$(LOCAL_MODULE).CERTIFICATE := $(LOCAL_CERTIFICATE) |
| 67 | PACKAGES.$(LOCAL_MODULE).PRIVATE_KEY := $(patsubst %.x509.pem,%.pk8,$(LOCAL_CERTIFICATE)) |
Colin Cross | aec3640 | 2017-12-14 11:20:27 -0800 | [diff] [blame] | 68 | endif |
| 69 | |
Colin Cross | e05e6df | 2017-11-15 21:35:27 -0800 | [diff] [blame] | 70 | ifndef LOCAL_IS_HOST_MODULE |
| 71 | ifeq ($(LOCAL_SDK_VERSION),system_current) |
| 72 | my_link_type := java:system |
| 73 | my_warn_types := java:platform |
| 74 | my_allowed_types := java:sdk java:system |
| 75 | else ifneq ($(LOCAL_SDK_VERSION),) |
| 76 | my_link_type := java:sdk |
| 77 | my_warn_types := java:system java:platform |
| 78 | my_allowed_types := java:sdk |
| 79 | else |
| 80 | my_link_type := java:platform |
| 81 | my_warn_types := |
| 82 | my_allowed_types := java:sdk java:system java:platform |
| 83 | endif |
| 84 | |
| 85 | my_link_deps := |
| 86 | my_2nd_arch_prefix := $(LOCAL_2ND_ARCH_VAR_PREFIX) |
| 87 | my_common := COMMON |
| 88 | include $(BUILD_SYSTEM)/link_type.mk |
| 89 | endif # !LOCAL_IS_HOST_MODULE |
| 90 | |
Colin Cross | 8c5ef24 | 2017-11-30 20:11:22 -0800 | [diff] [blame] | 91 | ifdef LOCAL_SOONG_RRO_DIRS |
| 92 | $(call append_enforce_rro_sources, \ |
| 93 | $(my_register_name), \ |
| 94 | false, \ |
| 95 | $(LOCAL_FULL_MANIFEST_FILE), \ |
| 96 | $(LOCAL_EXPORT_PACKAGE_RESOURCES), \ |
| 97 | $(LOCAL_SOONG_RRO_DIRS)) |
| 98 | endif |