Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2008 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
| 17 | ########################################################### |
| 18 | ## Standard rules for building an application package. |
| 19 | ## |
| 20 | ## Additional inputs from base_rules.make: |
| 21 | ## LOCAL_PACKAGE_NAME: The name of the package; the directory |
| 22 | ## will be called this. |
| 23 | ## |
| 24 | ## MODULE, MODULE_PATH, and MODULE_SUFFIX will |
| 25 | ## be set for you. |
| 26 | ########################################################### |
| 27 | |
| 28 | # If this makefile is being read from within an inheritance, |
| 29 | # use the new values. |
| 30 | skip_definition:= |
| 31 | ifdef LOCAL_PACKAGE_OVERRIDES |
| 32 | package_overridden := $(call set-inherited-package-variables) |
| 33 | ifeq ($(strip $(package_overridden)),) |
| 34 | skip_definition := true |
| 35 | endif |
| 36 | endif |
| 37 | |
| 38 | ifndef skip_definition |
| 39 | |
| 40 | LOCAL_PACKAGE_NAME := $(strip $(LOCAL_PACKAGE_NAME)) |
| 41 | ifeq ($(LOCAL_PACKAGE_NAME),) |
| 42 | $(error $(LOCAL_PATH): Package modules must define LOCAL_PACKAGE_NAME) |
| 43 | endif |
| 44 | |
| 45 | ifneq ($(strip $(LOCAL_MODULE_SUFFIX)),) |
| 46 | $(error $(LOCAL_PATH): Package modules may not define LOCAL_MODULE_SUFFIX) |
| 47 | endif |
| 48 | LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) |
| 49 | |
| 50 | ifneq ($(strip $(LOCAL_MODULE)),) |
| 51 | $(error $(LOCAL_PATH): Package modules may not define LOCAL_MODULE) |
| 52 | endif |
| 53 | LOCAL_MODULE := $(LOCAL_PACKAGE_NAME) |
| 54 | |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 55 | ifneq ($(strip $(LOCAL_MODULE_CLASS)),) |
| 56 | $(error $(LOCAL_PATH): Package modules may not set LOCAL_MODULE_CLASS) |
| 57 | endif |
| 58 | LOCAL_MODULE_CLASS := APPS |
| 59 | |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 60 | intermediates := $(call local-intermediates-dir) |
| 61 | intermediates.COMMON := $(call local-intermediates-dir,COMMON) |
| 62 | |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 63 | # Package LOCAL_MODULE_TAGS default to optional |
| 64 | LOCAL_MODULE_TAGS := $(strip $(LOCAL_MODULE_TAGS)) |
| 65 | ifeq ($(LOCAL_MODULE_TAGS),) |
| 66 | LOCAL_MODULE_TAGS := optional |
| 67 | endif |
| 68 | |
| 69 | ifeq ($(filter tests, $(LOCAL_MODULE_TAGS)),) |
| 70 | # Force localization check if it's not tagged as tests. |
| 71 | LOCAL_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) -z |
| 72 | endif |
| 73 | |
Ying Wang | 4cb0499 | 2014-07-29 10:34:30 -0700 | [diff] [blame] | 74 | need_compile_asset := |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 75 | ifeq (,$(LOCAL_ASSET_DIR)) |
| 76 | LOCAL_ASSET_DIR := $(LOCAL_PATH)/assets |
Ying Wang | 4cb0499 | 2014-07-29 10:34:30 -0700 | [diff] [blame] | 77 | else |
| 78 | need_compile_asset := true |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 79 | endif |
| 80 | |
Ying Wang | 6129192 | 2014-06-25 13:23:58 -0700 | [diff] [blame] | 81 | # LOCAL_RESOURCE_DIR may point to resource generated during the build |
| 82 | need_compile_res := |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 83 | ifeq (,$(LOCAL_RESOURCE_DIR)) |
| 84 | LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res |
Ying Wang | 6129192 | 2014-06-25 13:23:58 -0700 | [diff] [blame] | 85 | else |
| 86 | need_compile_res := true |
Dan Willemsen | fa7ecfb | 2017-05-02 23:55:44 -0700 | [diff] [blame] | 87 | LOCAL_RESOURCE_DIR := $(foreach d,$(LOCAL_RESOURCE_DIR),$(call clean-path,$(d))) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 88 | endif |
| 89 | |
Colin Cross | 2029903 | 2018-05-09 13:29:51 -0700 | [diff] [blame] | 90 | include $(BUILD_SYSTEM)/force_aapt2.mk |
| 91 | |
Colin Cross | 7bc6cab | 2018-05-17 15:05:47 -0700 | [diff] [blame] | 92 | # Process Support Library dependencies. |
| 93 | include $(BUILD_SYSTEM)/support_libraries.mk |
| 94 | |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 95 | package_resource_overlays := $(strip \ |
| 96 | $(wildcard $(foreach dir, $(PRODUCT_PACKAGE_OVERLAYS), \ |
| 97 | $(addprefix $(dir)/, $(LOCAL_RESOURCE_DIR)))) \ |
| 98 | $(wildcard $(foreach dir, $(DEVICE_PACKAGE_OVERLAYS), \ |
| 99 | $(addprefix $(dir)/, $(LOCAL_RESOURCE_DIR))))) |
| 100 | |
Jaekyun Seok | 3070610 | 2017-02-02 00:44:58 +0900 | [diff] [blame] | 101 | enforce_rro_enabled := |
Jaekyun Seok | 2a20999 | 2017-03-30 11:25:02 +0900 | [diff] [blame] | 102 | ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),) |
| 103 | ifneq ($(package_resource_overlays),) |
| 104 | ifeq ($(PRODUCT_ENFORCE_RRO_TARGETS),*) |
| 105 | enforce_rro_enabled := true |
| 106 | else ifneq (,$(filter $(LOCAL_PACKAGE_NAME), $(PRODUCT_ENFORCE_RRO_TARGETS))) |
Jaekyun Seok | 3070610 | 2017-02-02 00:44:58 +0900 | [diff] [blame] | 107 | enforce_rro_enabled := true |
| 108 | endif |
| 109 | endif |
| 110 | |
| 111 | ifdef enforce_rro_enabled |
| 112 | ifeq (,$(LOCAL_MODULE_PATH)) |
| 113 | ifeq (true,$(LOCAL_PROPRIETARY_MODULE)) |
| 114 | enforce_rro_enabled := |
| 115 | else ifeq (true,$(LOCAL_OEM_MODULE)) |
| 116 | enforce_rro_enabled := |
| 117 | else ifeq (true,$(LOCAL_ODM_MODULE)) |
| 118 | enforce_rro_enabled := |
Jaekyun Seok | b7735d8 | 2017-11-27 17:04:47 +0900 | [diff] [blame] | 119 | else ifeq (true,$(LOCAL_PRODUCT_MODULE)) |
| 120 | enforce_rro_enabled := |
Dario Freni | 5f681e1 | 2018-05-29 13:09:01 +0100 | [diff] [blame] | 121 | else ifeq (true,$(LOCAL_PRODUCT_SERVICES_MODULE)) |
| 122 | enforce_rro_enabled := |
Jaekyun Seok | 3070610 | 2017-02-02 00:44:58 +0900 | [diff] [blame] | 123 | endif |
| 124 | else ifeq ($(filter $(TARGET_OUT)/%,$(LOCAL_MODULE_PATH)),) |
| 125 | enforce_rro_enabled := |
| 126 | endif |
| 127 | endif |
| 128 | endif |
| 129 | |
Jaekyun Seok | ccee95e | 2017-09-01 17:23:25 +0900 | [diff] [blame] | 130 | ifdef enforce_rro_enabled |
| 131 | ifneq ($(PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS),) |
| 132 | static_only_resource_overlays := $(filter $(addsuffix %,$(PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS)),$(package_resource_overlays)) |
| 133 | ifneq ($(static_only_resource_overlays),) |
| 134 | package_resource_overlays := $(filter-out $(static_only_resource_overlays),$(package_resource_overlays)) |
| 135 | LOCAL_RESOURCE_DIR := $(static_only_resource_overlays) $(LOCAL_RESOURCE_DIR) |
| 136 | ifeq ($(package_resource_overlays),) |
| 137 | enforce_rro_enabled := |
| 138 | endif |
| 139 | endif |
| 140 | endif |
| 141 | else |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 142 | LOCAL_RESOURCE_DIR := $(package_resource_overlays) $(LOCAL_RESOURCE_DIR) |
Jaekyun Seok | 3070610 | 2017-02-02 00:44:58 +0900 | [diff] [blame] | 143 | endif |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 144 | |
Colin Cross | 2c32144 | 2014-02-12 13:06:30 -0800 | [diff] [blame] | 145 | all_assets := $(strip \ |
| 146 | $(foreach dir, $(LOCAL_ASSET_DIR), \ |
| 147 | $(addprefix $(dir)/, \ |
| 148 | $(patsubst assets/%,%, \ |
| 149 | $(call find-subdir-assets, $(dir)) \ |
| 150 | ) \ |
| 151 | ) \ |
| 152 | )) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 153 | |
Ying Wang | 4cb0499 | 2014-07-29 10:34:30 -0700 | [diff] [blame] | 154 | ifneq ($(all_assets),) |
| 155 | need_compile_asset := true |
| 156 | endif |
| 157 | |
Dan Willemsen | bb6393c | 2017-11-17 15:39:52 -0800 | [diff] [blame] | 158 | ifdef LOCAL_AAPT2_ONLY |
| 159 | LOCAL_USE_AAPT2 := true |
| 160 | endif |
| 161 | |
Adam Lesinski | e758f93 | 2016-02-26 11:13:43 -0800 | [diff] [blame] | 162 | my_res_package := |
Colin Cross | 2029903 | 2018-05-09 13:29:51 -0700 | [diff] [blame] | 163 | ifeq ($(LOCAL_USE_AAPT2),true) |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 164 | # In aapt2 the last takes precedence. |
| 165 | my_resource_dirs := $(call reverse-list,$(LOCAL_RESOURCE_DIR)) |
Adam Lesinski | e758f93 | 2016-02-26 11:13:43 -0800 | [diff] [blame] | 166 | my_res_dir := |
| 167 | my_overlay_res_dirs := |
| 168 | |
Colin Cross | 71c5b95 | 2018-05-23 13:35:53 -0700 | [diff] [blame] | 169 | ifneq ($(strip $(LOCAL_STATIC_ANDROID_LIBRARIES) $(LOCAL_STATIC_JAVA_AAR_LIBRARIES)),) |
Adam Lesinski | e758f93 | 2016-02-26 11:13:43 -0800 | [diff] [blame] | 170 | # If we are using static android libraries, every source file becomes an overlay. |
| 171 | # This is to emulate old AAPT behavior which simulated library support. |
| 172 | my_res_dir := |
| 173 | my_overlay_res_dirs := $(my_resource_dirs) |
| 174 | else |
| 175 | # Without static libraries, the first directory is our directory, which can then be |
| 176 | # overlaid by the rest. (First directory in my_resource_dirs is last directory in |
| 177 | # $(LOCAL_RESOURCE_DIR) due to it being reversed. |
| 178 | my_res_dir := $(firstword $(my_resource_dirs)) |
| 179 | my_overlay_res_dirs := $(wordlist 2,999,$(my_resource_dirs)) |
| 180 | endif |
| 181 | |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 182 | my_overlay_resources := $(strip \ |
Adam Lesinski | e758f93 | 2016-02-26 11:13:43 -0800 | [diff] [blame] | 183 | $(foreach d,$(my_overlay_res_dirs),\ |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 184 | $(addprefix $(d)/, \ |
| 185 | $(call find-subdir-assets,$(d))))) |
| 186 | |
Colin Cross | fe10963 | 2016-11-29 11:12:56 -0800 | [diff] [blame] | 187 | my_res_resources := $(if $(my_res_dir),$(strip \ |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 188 | $(addprefix $(my_res_dir)/, \ |
Colin Cross | fe10963 | 2016-11-29 11:12:56 -0800 | [diff] [blame] | 189 | $(call find-subdir-assets,$(my_res_dir))))) |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 190 | |
| 191 | all_resources := $(strip $(my_res_resources) $(my_overlay_resources)) |
| 192 | |
| 193 | # The linked resource package. |
| 194 | my_res_package := $(intermediates)/package-res.apk |
| 195 | LOCAL_INTERMEDIATE_TARGETS += $(my_res_package) |
| 196 | |
Ying Wang | e585397 | 2016-03-01 12:06:47 -0800 | [diff] [blame] | 197 | # Always run aapt2, because we need to at least compile the AndroidManifest.xml. |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 198 | need_compile_res := true |
| 199 | |
Ying Wang | e295c3d | 2016-02-24 14:11:55 -0800 | [diff] [blame] | 200 | else # LOCAL_USE_AAPT2 |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 201 | all_resources := $(strip \ |
| 202 | $(foreach dir, $(LOCAL_RESOURCE_DIR), \ |
| 203 | $(addprefix $(dir)/, \ |
| 204 | $(patsubst res/%,%, \ |
| 205 | $(call find-subdir-assets,$(dir)) \ |
| 206 | ) \ |
| 207 | ) \ |
| 208 | )) |
| 209 | |
Adam Lesinski | 4c45205 | 2016-08-12 12:57:17 -0700 | [diff] [blame] | 210 | ifdef LOCAL_PACKAGE_SPLITS |
| 211 | LOCAL_AAPT_FLAGS += $(addprefix --split ,$(LOCAL_PACKAGE_SPLITS)) |
| 212 | endif |
| 213 | |
Ying Wang | e295c3d | 2016-02-24 14:11:55 -0800 | [diff] [blame] | 214 | endif # LOCAL_USE_AAPT2 |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 215 | |
Ying Wang | 6129192 | 2014-06-25 13:23:58 -0700 | [diff] [blame] | 216 | ifneq ($(all_resources),) |
| 217 | need_compile_res := true |
| 218 | endif |
| 219 | |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 220 | all_res_assets := $(strip $(all_assets) $(all_resources)) |
| 221 | |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 222 | # If no assets or resources were found, clear the directory variables so |
| 223 | # we don't try to build them. |
Ying Wang | 4cb0499 | 2014-07-29 10:34:30 -0700 | [diff] [blame] | 224 | ifneq (true,$(need_compile_asset)) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 225 | LOCAL_ASSET_DIR:= |
| 226 | endif |
Ying Wang | 6129192 | 2014-06-25 13:23:58 -0700 | [diff] [blame] | 227 | ifneq (true,$(need_compile_res)) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 228 | LOCAL_RESOURCE_DIR:= |
| 229 | R_file_stamp := |
| 230 | else |
| 231 | # Make sure that R_file_stamp inherits the proper PRIVATE vars. |
| 232 | # If R.stamp moves, be sure to update the framework makefile, |
| 233 | # which has intimate knowledge of its location. |
Ying Wang | 98ae798 | 2014-12-18 14:53:52 -0800 | [diff] [blame] | 234 | R_file_stamp := $(intermediates.COMMON)/src/R.stamp |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 235 | LOCAL_INTERMEDIATE_TARGETS += $(R_file_stamp) |
| 236 | endif |
| 237 | |
Narayan Kamath | 7c20510 | 2017-08-07 12:31:17 +0100 | [diff] [blame] | 238 | ifdef LOCAL_COMPRESSED_MODULE |
| 239 | ifneq (true,$(LOCAL_COMPRESSED_MODULE)) |
| 240 | $(call pretty-error, Unknown value for LOCAL_COMPRESSED_MODULE $(LOCAL_COMPRESSED_MODULE)) |
| 241 | endif |
| 242 | endif |
| 243 | |
| 244 | ifdef LOCAL_COMPRESSED_MODULE |
Narayan Kamath | 6a4bd69 | 2017-08-14 10:53:50 +0100 | [diff] [blame] | 245 | PACKAGES.$(LOCAL_PACKAGE_NAME).COMPRESSED := gz |
Narayan Kamath | 7c20510 | 2017-08-07 12:31:17 +0100 | [diff] [blame] | 246 | LOCAL_BUILT_MODULE_STEM := package.apk.gz |
| 247 | LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk.gz |
| 248 | else # !LOCAL_COMPRESSED_MODULE |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 249 | LOCAL_BUILT_MODULE_STEM := package.apk |
Ying Wang | af9757e | 2014-07-17 21:24:42 -0700 | [diff] [blame] | 250 | LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk |
Narayan Kamath | 7c20510 | 2017-08-07 12:31:17 +0100 | [diff] [blame] | 251 | endif |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 252 | |
| 253 | LOCAL_PROGUARD_ENABLED:=$(strip $(LOCAL_PROGUARD_ENABLED)) |
| 254 | ifndef LOCAL_PROGUARD_ENABLED |
| 255 | ifneq ($(DISABLE_PROGUARD),true) |
| 256 | LOCAL_PROGUARD_ENABLED :=full |
| 257 | endif |
| 258 | endif |
| 259 | ifeq ($(LOCAL_PROGUARD_ENABLED),disabled) |
| 260 | # the package explicitly request to disable proguard. |
| 261 | LOCAL_PROGUARD_ENABLED := |
| 262 | endif |
| 263 | proguard_options_file := |
| 264 | ifneq ($(LOCAL_PROGUARD_ENABLED),custom) |
Ying Wang | 6129192 | 2014-06-25 13:23:58 -0700 | [diff] [blame] | 265 | ifeq ($(need_compile_res),true) |
Ying Wang | 98ae798 | 2014-12-18 14:53:52 -0800 | [diff] [blame] | 266 | proguard_options_file := $(intermediates.COMMON)/proguard_options |
Ying Wang | 6129192 | 2014-06-25 13:23:58 -0700 | [diff] [blame] | 267 | endif # need_compile_res |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 268 | endif # !custom |
| 269 | LOCAL_PROGUARD_FLAGS := $(addprefix -include ,$(proguard_options_file)) $(LOCAL_PROGUARD_FLAGS) |
| 270 | |
| 271 | ifeq (true,$(EMMA_INSTRUMENT)) |
| 272 | ifndef LOCAL_EMMA_INSTRUMENT |
Jeff Gaston | aaae43c | 2017-04-11 16:36:46 -0700 | [diff] [blame] | 273 | # No jacoco for test apks. |
Ying Wang | 324ffb2 | 2015-11-06 11:22:28 -0800 | [diff] [blame] | 274 | ifeq (,$(LOCAL_INSTRUMENTATION_FOR)) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 275 | LOCAL_EMMA_INSTRUMENT := true |
| 276 | endif # No test apk |
| 277 | endif # LOCAL_EMMA_INSTRUMENT is not set |
| 278 | else |
| 279 | LOCAL_EMMA_INSTRUMENT := false |
| 280 | endif # EMMA_INSTRUMENT is true |
| 281 | |
| 282 | ifeq (true,$(LOCAL_EMMA_INSTRUMENT)) |
| 283 | ifeq (true,$(EMMA_INSTRUMENT_STATIC)) |
Colin Cross | 11e2d55 | 2018-03-07 15:44:54 -0800 | [diff] [blame] | 284 | ifneq ($(LOCAL_SRC_FILES)$(LOCAL_SRCJARS)$(LOCAL_STATIC_JAVA_LIBRARIES)$(LOCAL_SOURCE_FILES_ALL_GENERATED),) |
Colin Cross | 79e2f73 | 2016-12-21 14:29:13 -0800 | [diff] [blame] | 285 | # Only add jacocoagent if the package contains some java code |
Sebastien Hertz | dfce8ad | 2015-11-19 17:53:00 +0100 | [diff] [blame] | 286 | LOCAL_STATIC_JAVA_LIBRARIES += jacocoagent |
Colin Cross | dc4a6b8 | 2018-01-03 12:39:11 -0800 | [diff] [blame] | 287 | # Exclude jacoco classes from proguard |
| 288 | LOCAL_PROGUARD_FLAGS += -include $(BUILD_SYSTEM)/proguard.jacoco.flags |
Colin Cross | 79e2f73 | 2016-12-21 14:29:13 -0800 | [diff] [blame] | 289 | endif # Contains java code |
| 290 | else |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 291 | ifdef LOCAL_SDK_VERSION |
| 292 | ifdef TARGET_BUILD_APPS |
Sebastien Hertz | 2319e56 | 2016-03-31 16:48:26 +0200 | [diff] [blame] | 293 | # In unbundled build, merge the coverage library into the apk. |
Colin Cross | 79e2f73 | 2016-12-21 14:29:13 -0800 | [diff] [blame] | 294 | ifneq ($(LOCAL_SRC_FILES)$(LOCAL_STATIC_JAVA_LIBRARIES)$(LOCAL_SOURCE_FILES_ALL_GENERATED),) |
| 295 | # Only add jacocoagent if the package contains some java code |
Sebastien Hertz | dfce8ad | 2015-11-19 17:53:00 +0100 | [diff] [blame] | 296 | LOCAL_STATIC_JAVA_LIBRARIES += jacocoagent |
Sebastien Hertz | 2319e56 | 2016-03-31 16:48:26 +0200 | [diff] [blame] | 297 | # Exclude jacoco classes from proguard |
| 298 | LOCAL_PROGUARD_FLAGS += -include $(BUILD_SYSTEM)/proguard.jacoco.flags |
Colin Cross | 79e2f73 | 2016-12-21 14:29:13 -0800 | [diff] [blame] | 299 | endif # Contains java code |
Colin Cross | e673deb | 2017-09-27 14:28:41 -0700 | [diff] [blame] | 300 | endif # TARGET_BUILD_APPS |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 301 | endif # LOCAL_SDK_VERSION |
Colin Cross | 79e2f73 | 2016-12-21 14:29:13 -0800 | [diff] [blame] | 302 | endif # EMMA_INSTRUMENT_STATIC |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 303 | endif # LOCAL_EMMA_INSTRUMENT |
| 304 | |
| 305 | rs_compatibility_jni_libs := |
| 306 | |
Ying Wang | ed0361f | 2015-04-19 09:55:39 -0700 | [diff] [blame] | 307 | ifeq ($(LOCAL_DATA_BINDING),true) |
| 308 | data_binding_intermediates := $(intermediates.COMMON)/data-binding |
| 309 | |
| 310 | LOCAL_JAVACFLAGS += -processorpath $(DATA_BINDING_COMPILER) -s $(data_binding_intermediates)/anno-src |
Ying Wang | ed0361f | 2015-04-19 09:55:39 -0700 | [diff] [blame] | 311 | |
| 312 | LOCAL_STATIC_JAVA_LIBRARIES += databinding-baselibrary |
| 313 | LOCAL_STATIC_JAVA_AAR_LIBRARIES += databinding-library databinding-adapters |
| 314 | |
| 315 | data_binding_res_in := $(LOCAL_RESOURCE_DIR) |
| 316 | data_binding_res_out := $(data_binding_intermediates)/res |
| 317 | |
| 318 | # Replace with the processed merged res dir. |
| 319 | LOCAL_RESOURCE_DIR := $(data_binding_res_out) |
| 320 | |
| 321 | LOCAL_AAPT_FLAGS += --auto-add-overlay --extra-packages com.android.databinding.library |
| 322 | endif # LOCAL_DATA_BINDING |
| 323 | |
Narayan Kamath | 7c20510 | 2017-08-07 12:31:17 +0100 | [diff] [blame] | 324 | # If the module is a compressed module, we don't pre-opt it because its final |
| 325 | # installation location will be the data partition. |
| 326 | ifdef LOCAL_COMPRESSED_MODULE |
| 327 | LOCAL_DEX_PREOPT := false |
| 328 | endif |
| 329 | |
Ying Wang | e9dd9f2 | 2014-10-29 15:48:32 -0700 | [diff] [blame] | 330 | include $(BUILD_SYSTEM)/android_manifest.mk |
| 331 | |
Colin Cross | 7a28158 | 2018-03-06 16:21:36 -0800 | [diff] [blame] | 332 | resource_export_package := |
| 333 | |
| 334 | include $(BUILD_SYSTEM)/java_renderscript.mk |
| 335 | |
| 336 | include $(BUILD_SYSTEM)/aapt_flags.mk |
| 337 | |
| 338 | ifeq ($(need_compile_res),true) |
| 339 | |
| 340 | ############################### |
| 341 | ## APK splits |
| 342 | built_apk_splits := |
| 343 | installed_apk_splits := |
| 344 | my_apk_split_configs := |
| 345 | |
| 346 | ifdef LOCAL_PACKAGE_SPLITS |
| 347 | ifdef LOCAL_COMPRESSED_MODULE |
| 348 | $(error $(LOCAL_MODULE): LOCAL_COMPRESSED_MODULE is not currently supported for split installs) |
| 349 | endif # LOCAL_COMPRESSED_MODULE |
| 350 | |
| 351 | my_apk_split_configs := $(LOCAL_PACKAGE_SPLITS) |
| 352 | my_split_suffixes := $(subst $(comma),_,$(my_apk_split_configs)) |
| 353 | built_apk_splits := $(foreach s,$(my_split_suffixes),$(intermediates)/package_$(s).apk) |
| 354 | endif |
| 355 | |
| 356 | $(R_file_stamp) $(my_res_package): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) |
| 357 | $(R_file_stamp) $(my_res_package): PRIVATE_TARGET_AAPT_CHARACTERISTICS := $(TARGET_AAPT_CHARACTERISTICS) |
| 358 | $(R_file_stamp) $(my_res_package): PRIVATE_MANIFEST_PACKAGE_NAME := $(LOCAL_MANIFEST_PACKAGE_NAME) |
| 359 | $(R_file_stamp) $(my_res_package): PRIVATE_MANIFEST_INSTRUMENTATION_FOR := $(LOCAL_MANIFEST_INSTRUMENTATION_FOR) |
| 360 | |
| 361 | ############################### |
| 362 | ## AAPT/AAPT2 |
| 363 | |
Colin Cross | 2029903 | 2018-05-09 13:29:51 -0700 | [diff] [blame] | 364 | ifeq ($(LOCAL_USE_AAPT2),true) |
Colin Cross | 7a28158 | 2018-03-06 16:21:36 -0800 | [diff] [blame] | 365 | my_compiled_res_base_dir := $(intermediates.COMMON)/flat-res |
Colin Cross | 532ae3b | 2018-05-15 15:15:38 -0700 | [diff] [blame] | 366 | ifneq (,$(filter-out current,$(renderscript_target_api))) |
Colin Cross | 7a28158 | 2018-03-06 16:21:36 -0800 | [diff] [blame] | 367 | ifneq ($(call math_gt_or_eq,$(renderscript_target_api),21),true) |
| 368 | my_generated_res_zips := $(rs_generated_res_zip) |
| 369 | endif # renderscript_target_api < 21 |
| 370 | endif # renderscript_target_api is set |
| 371 | my_asset_dirs := $(LOCAL_ASSET_DIR) |
| 372 | my_full_asset_paths := $(all_assets) |
| 373 | |
| 374 | # Add AAPT2 link specific flags. |
| 375 | $(my_res_package): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) |
| 376 | ifndef LOCAL_AAPT_NAMESPACES |
| 377 | $(my_res_package): PRIVATE_AAPT_FLAGS += --no-static-lib-packages |
| 378 | endif |
| 379 | |
| 380 | include $(BUILD_SYSTEM)/aapt2.mk |
| 381 | else # LOCAL_USE_AAPT2 |
| 382 | |
Colin Cross | f6d68cf | 2018-03-08 16:49:16 -0800 | [diff] [blame] | 383 | my_srcjar := $(intermediates.COMMON)/aapt.srcjar |
| 384 | LOCAL_SRCJARS += $(my_srcjar) |
| 385 | $(R_file_stamp): PRIVATE_SRCJAR := $(my_srcjar) |
| 386 | $(R_file_stamp): PRIVATE_JAVA_GEN_DIR := $(intermediates.COMMON)/aapt |
| 387 | $(R_file_stamp): .KATI_IMPLICIT_OUTPUTS := $(my_srcjar) |
Colin Cross | 7a28158 | 2018-03-06 16:21:36 -0800 | [diff] [blame] | 388 | # Since we don't know where the real R.java file is going to end up, |
| 389 | # we need to use another file to stand in its place. We'll just |
| 390 | # copy the generated file to src/R.stamp, which means it will |
| 391 | # have the same contents and timestamp as the actual file. |
| 392 | # |
| 393 | # At the same time, this will copy the R.java file to a central |
| 394 | # 'R' directory to make it easier to add the files to an IDE. |
| 395 | # |
| 396 | |
| 397 | $(R_file_stamp): PRIVATE_RESOURCE_PUBLICS_OUTPUT := \ |
| 398 | $(intermediates.COMMON)/public_resources.xml |
| 399 | $(R_file_stamp): PRIVATE_PROGUARD_OPTIONS_FILE := $(proguard_options_file) |
| 400 | $(R_file_stamp): PRIVATE_RESOURCE_LIST := $(all_res_assets) |
Colin Cross | f6d68cf | 2018-03-08 16:49:16 -0800 | [diff] [blame] | 401 | $(R_file_stamp): $(all_res_assets) $(full_android_manifest) $(rs_generated_res_zip) $(AAPT) $(SOONG_ZIP) | $(ACP) |
Colin Cross | 7a28158 | 2018-03-06 16:21:36 -0800 | [diff] [blame] | 402 | @echo "target R.java/Manifest.java: $(PRIVATE_MODULE) ($@)" |
| 403 | @rm -rf $@ && mkdir -p $(dir $@) |
| 404 | $(create-resource-java-files) |
Colin Cross | f6d68cf | 2018-03-08 16:49:16 -0800 | [diff] [blame] | 405 | $(call find-generated-R.java,$(PRIVATE_JAVA_GEN_DIR),$@) |
Colin Cross | 7a28158 | 2018-03-06 16:21:36 -0800 | [diff] [blame] | 406 | |
| 407 | $(proguard_options_file): $(R_file_stamp) |
| 408 | |
| 409 | ifdef LOCAL_EXPORT_PACKAGE_RESOURCES |
| 410 | # Put this module's resources into a PRODUCT-agnositc package that |
| 411 | # other packages can use to build their own PRODUCT-agnostic R.java (etc.) |
| 412 | # files. |
| 413 | resource_export_package := $(intermediates.COMMON)/package-export.apk |
| 414 | $(R_file_stamp): $(resource_export_package) |
| 415 | |
Colin Cross | c9e4976 | 2018-09-14 13:39:07 -0700 | [diff] [blame] | 416 | # create-assets-package looks at PRODUCT_AAPT_CONFIG, but this target |
Colin Cross | 7a28158 | 2018-03-06 16:21:36 -0800 | [diff] [blame] | 417 | # can't know anything about PRODUCT. Clear it out just for this target. |
| 418 | $(resource_export_package): PRIVATE_PRODUCT_AAPT_CONFIG := |
| 419 | $(resource_export_package): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := |
| 420 | $(resource_export_package): PRIVATE_RESOURCE_LIST := $(all_res_assets) |
Colin Cross | 1465806 | 2018-05-15 16:04:47 -0700 | [diff] [blame] | 421 | $(resource_export_package): $(all_res_assets) $(full_android_manifest) $(rs_generated_res_zip) $(AAPT) |
Colin Cross | 7a28158 | 2018-03-06 16:21:36 -0800 | [diff] [blame] | 422 | @echo "target Export Resources: $(PRIVATE_MODULE) ($@)" |
Colin Cross | c9e4976 | 2018-09-14 13:39:07 -0700 | [diff] [blame] | 423 | $(call create-assets-package,$@) |
Colin Cross | 7a28158 | 2018-03-06 16:21:36 -0800 | [diff] [blame] | 424 | endif |
| 425 | |
| 426 | endif # LOCAL_USE_AAPT2 |
| 427 | |
| 428 | endif # need_compile_res |
| 429 | |
Narayan Kamath | bbcdc07 | 2017-08-22 15:47:08 +0100 | [diff] [blame] | 430 | called_from_package_internal := true |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 431 | ################################# |
| 432 | include $(BUILD_SYSTEM)/java.mk |
| 433 | ################################# |
Narayan Kamath | bbcdc07 | 2017-08-22 15:47:08 +0100 | [diff] [blame] | 434 | called_from_package_internal := |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 435 | |
Colin Cross | 7a28158 | 2018-03-06 16:21:36 -0800 | [diff] [blame] | 436 | ifeq ($(need_compile_res),true) |
| 437 | |
| 438 | # Other modules should depend on the BUILT module if |
| 439 | # they want to use this module's R.java file. |
| 440 | $(LOCAL_BUILT_MODULE): $(R_file_stamp) |
| 441 | |
| 442 | # The R.java file must exist by the time the java source |
| 443 | # list is generated |
| 444 | $(java_source_list_file): $(R_file_stamp) |
| 445 | |
| 446 | endif # need_compile_res |
| 447 | |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 448 | LOCAL_SDK_RES_VERSION:=$(strip $(LOCAL_SDK_RES_VERSION)) |
| 449 | ifeq ($(LOCAL_SDK_RES_VERSION),) |
| 450 | LOCAL_SDK_RES_VERSION:=$(LOCAL_SDK_VERSION) |
| 451 | endif |
| 452 | |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 453 | $(LOCAL_INTERMEDIATE_TARGETS): \ |
| 454 | PRIVATE_ANDROID_MANIFEST := $(full_android_manifest) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 455 | |
Ying Wang | ed0361f | 2015-04-19 09:55:39 -0700 | [diff] [blame] | 456 | ifeq ($(LOCAL_DATA_BINDING),true) |
| 457 | data_binding_stamp := $(data_binding_intermediates)/data-binding.stamp |
| 458 | $(data_binding_stamp): PRIVATE_INTERMEDIATES := $(data_binding_intermediates) |
| 459 | $(data_binding_stamp): PRIVATE_MANIFEST := $(full_android_manifest) |
| 460 | # Generate code into $(LOCAL_INTERMEDIATE_SOURCE_DIR) so that the generated .java files |
| 461 | # will be automatically picked up by function compile-java. |
| 462 | $(data_binding_stamp): PRIVATE_SRC_OUT := $(LOCAL_INTERMEDIATE_SOURCE_DIR)/data-binding |
| 463 | $(data_binding_stamp): PRIVATE_XML_OUT := $(data_binding_intermediates)/xml |
| 464 | $(data_binding_stamp): PRIVATE_RES_OUT := $(data_binding_res_out) |
| 465 | $(data_binding_stamp): PRIVATE_RES_IN := $(data_binding_res_in) |
| 466 | $(data_binding_stamp): PRIVATE_ANNO_SRC_DIR := $(data_binding_intermediates)/anno-src |
| 467 | |
| 468 | $(data_binding_stamp) : $(all_res_assets) $(full_android_manifest) \ |
| 469 | $(DATA_BINDING_COMPILER) |
| 470 | @echo "Data-binding process: $@" |
| 471 | @rm -rf $(PRIVATE_INTERMEDIATES) $(PRIVATE_SRC_OUT) && \ |
| 472 | mkdir -p $(PRIVATE_INTERMEDIATES) $(PRIVATE_SRC_OUT) \ |
| 473 | $(PRIVATE_XML_OUT) $(PRIVATE_RES_OUT) $(PRIVATE_ANNO_SRC_DIR) |
Colin Cross | 0851df8 | 2017-06-30 13:55:38 -0700 | [diff] [blame] | 474 | $(hide) $(JAVA) -classpath $(DATA_BINDING_COMPILER) android.databinding.tool.MakeCopy \ |
Ying Wang | ed0361f | 2015-04-19 09:55:39 -0700 | [diff] [blame] | 475 | $(PRIVATE_MANIFEST) $(PRIVATE_SRC_OUT) $(PRIVATE_XML_OUT) $(PRIVATE_RES_OUT) $(PRIVATE_RES_IN) |
| 476 | $(hide) touch $@ |
| 477 | |
| 478 | # Make sure the data-binding process happens before javac and generation of R.java. |
Colin Cross | dfc45ec | 2017-05-26 15:22:02 -0700 | [diff] [blame] | 479 | $(R_file_stamp): $(data_binding_stamp) |
| 480 | $(java_source_list_file): $(data_binding_stamp) |
| 481 | $(full_classes_compiled_jar): $(data_binding_stamp) |
Ying Wang | ed0361f | 2015-04-19 09:55:39 -0700 | [diff] [blame] | 482 | endif # LOCAL_DATA_BINDING |
| 483 | |
Adam Lesinski | 6b6283a | 2018-02-14 16:18:12 -0800 | [diff] [blame] | 484 | framework_res_package_export := |
Adam Lesinski | 6b6283a | 2018-02-14 16:18:12 -0800 | [diff] [blame] | 485 | |
| 486 | ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 487 | # Most packages should link against the resources defined by framework-res. |
| 488 | # Even if they don't have their own resources, they may use framework |
| 489 | # resources. |
Dan Willemsen | c51b7b0 | 2018-02-16 13:31:17 -0800 | [diff] [blame] | 490 | ifeq ($(LOCAL_SDK_RES_VERSION),core_current) |
| 491 | # core_current doesn't contain any framework resources. |
| 492 | else ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 493 | # for released sdk versions, the platform resources were built into android.jar. |
| 494 | framework_res_package_export := \ |
Anton Hansson | 66d47b8 | 2018-04-27 14:11:17 +0100 | [diff] [blame] | 495 | $(call resolve-prebuilt-sdk-jar-path,$(LOCAL_SDK_RES_VERSION)) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 496 | else # LOCAL_SDK_RES_VERSION |
| 497 | framework_res_package_export := \ |
| 498 | $(call intermediates-dir-for,APPS,framework-res,,COMMON)/package-export.apk |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 499 | endif # LOCAL_SDK_RES_VERSION |
Adam Lesinski | 6b6283a | 2018-02-14 16:18:12 -0800 | [diff] [blame] | 500 | endif # LOCAL_NO_STANDARD_LIBRARIES |
| 501 | |
Adam Lesinski | de057c3 | 2014-03-13 18:48:27 -0700 | [diff] [blame] | 502 | all_library_res_package_exports := \ |
| 503 | $(framework_res_package_export) \ |
Adam Lesinski | 5eebe0f | 2014-03-25 15:45:34 -0700 | [diff] [blame] | 504 | $(foreach lib,$(LOCAL_RES_LIBRARIES),\ |
Adam Lesinski | de057c3 | 2014-03-13 18:48:27 -0700 | [diff] [blame] | 505 | $(call intermediates-dir-for,APPS,$(lib),,COMMON)/package-export.apk) |
| 506 | |
| 507 | all_library_res_package_export_deps := \ |
Colin Cross | 6e13692 | 2018-02-20 14:31:33 -0800 | [diff] [blame] | 508 | $(framework_res_package_export) \ |
Adam Lesinski | 5eebe0f | 2014-03-25 15:45:34 -0700 | [diff] [blame] | 509 | $(foreach lib,$(LOCAL_RES_LIBRARIES),\ |
Adam Lesinski | de057c3 | 2014-03-13 18:48:27 -0700 | [diff] [blame] | 510 | $(call intermediates-dir-for,APPS,$(lib),,COMMON)/src/R.stamp) |
Ying Wang | b574564 | 2014-06-19 16:07:30 -0700 | [diff] [blame] | 511 | $(resource_export_package) $(R_file_stamp) $(LOCAL_BUILT_MODULE): $(all_library_res_package_export_deps) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 512 | $(LOCAL_INTERMEDIATE_TARGETS): \ |
Adam Lesinski | de057c3 | 2014-03-13 18:48:27 -0700 | [diff] [blame] | 513 | PRIVATE_AAPT_INCLUDES := $(all_library_res_package_exports) |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 514 | |
Colin Cross | 2029903 | 2018-05-09 13:29:51 -0700 | [diff] [blame] | 515 | ifeq ($(LOCAL_USE_AAPT2),true) |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 516 | $(my_res_package) : $(all_library_res_package_export_deps) |
| 517 | endif |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 518 | |
Colin Cross | 7a28158 | 2018-03-06 16:21:36 -0800 | [diff] [blame] | 519 | # These four are set above for $(R_stamp_file) and $(my_res_package), but |
| 520 | # $(LOCAL_BUILT_MODULE) is not set before java.mk, so they have to be set again |
| 521 | # here. |
| 522 | $(LOCAL_BUILT_MODULE): PRIVATE_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) |
| 523 | $(LOCAL_BUILT_MODULE): PRIVATE_TARGET_AAPT_CHARACTERISTICS := $(TARGET_AAPT_CHARACTERISTICS) |
| 524 | $(LOCAL_BUILT_MODULE): PRIVATE_MANIFEST_PACKAGE_NAME := $(LOCAL_MANIFEST_PACKAGE_NAME) |
| 525 | $(LOCAL_BUILT_MODULE): PRIVATE_MANIFEST_INSTRUMENTATION_FOR := $(LOCAL_MANIFEST_INSTRUMENTATION_FOR) |
| 526 | |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 527 | ifneq ($(full_classes_jar),) |
| 528 | $(LOCAL_BUILT_MODULE): PRIVATE_DEX_FILE := $(built_dex) |
Colin Cross | 79e2f73 | 2016-12-21 14:29:13 -0800 | [diff] [blame] | 529 | # Use the jarjar processed arhive as the initial package file. |
Colin Cross | ffbf0a6 | 2017-03-29 12:58:15 -0700 | [diff] [blame] | 530 | $(LOCAL_BUILT_MODULE): PRIVATE_SOURCE_ARCHIVE := $(full_classes_pre_proguard_jar) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 531 | $(LOCAL_BUILT_MODULE): $(built_dex) |
Ying Wang | 33360dd | 2015-01-14 14:23:56 -0800 | [diff] [blame] | 532 | else |
| 533 | $(LOCAL_BUILT_MODULE): PRIVATE_DEX_FILE := |
Colin Cross | 79e2f73 | 2016-12-21 14:29:13 -0800 | [diff] [blame] | 534 | $(LOCAL_BUILT_MODULE): PRIVATE_SOURCE_ARCHIVE := |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 535 | endif # full_classes_jar |
| 536 | |
Ying Wang | 96bcad4 | 2014-04-17 13:38:04 -0700 | [diff] [blame] | 537 | include $(BUILD_SYSTEM)/install_jni_libs.mk |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 538 | |
| 539 | # Pick a key to sign the package with. If this package hasn't specified |
| 540 | # an explicit certificate, use the default. |
| 541 | # Secure release builds will have their packages signed after the fact, |
| 542 | # so it's ok for these private keys to be in the clear. |
| 543 | ifeq ($(LOCAL_CERTIFICATE),) |
| 544 | LOCAL_CERTIFICATE := $(DEFAULT_SYSTEM_DEV_CERTIFICATE) |
| 545 | endif |
| 546 | |
| 547 | ifeq ($(LOCAL_CERTIFICATE),EXTERNAL) |
| 548 | # The special value "EXTERNAL" means that we will sign it with the |
| 549 | # default devkey, apply predexopt, but then expect the final .apk |
| 550 | # (after dexopting) to be signed by an outside tool. |
| 551 | LOCAL_CERTIFICATE := $(DEFAULT_SYSTEM_DEV_CERTIFICATE) |
| 552 | PACKAGES.$(LOCAL_PACKAGE_NAME).EXTERNAL_KEY := 1 |
| 553 | endif |
| 554 | |
| 555 | # If this is not an absolute certificate, assign it to a generic one. |
| 556 | ifeq ($(dir $(strip $(LOCAL_CERTIFICATE))),./) |
| 557 | LOCAL_CERTIFICATE := $(dir $(DEFAULT_SYSTEM_DEV_CERTIFICATE))$(LOCAL_CERTIFICATE) |
| 558 | endif |
| 559 | private_key := $(LOCAL_CERTIFICATE).pk8 |
| 560 | certificate := $(LOCAL_CERTIFICATE).x509.pem |
Shinichiro Hamaji | 641e61c | 2016-05-13 16:03:24 +0900 | [diff] [blame] | 561 | additional_certificates := $(foreach c,$(LOCAL_ADDITIONAL_CERTIFICATES), $(c).x509.pem $(c).pk8) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 562 | |
| 563 | $(LOCAL_BUILT_MODULE): $(private_key) $(certificate) $(SIGNAPK_JAR) |
| 564 | $(LOCAL_BUILT_MODULE): PRIVATE_PRIVATE_KEY := $(private_key) |
| 565 | $(LOCAL_BUILT_MODULE): PRIVATE_CERTIFICATE := $(certificate) |
| 566 | |
| 567 | PACKAGES.$(LOCAL_PACKAGE_NAME).PRIVATE_KEY := $(private_key) |
| 568 | PACKAGES.$(LOCAL_PACKAGE_NAME).CERTIFICATE := $(certificate) |
| 569 | |
Shinichiro Hamaji | 641e61c | 2016-05-13 16:03:24 +0900 | [diff] [blame] | 570 | $(LOCAL_BUILT_MODULE): $(additional_certificates) |
| 571 | $(LOCAL_BUILT_MODULE): PRIVATE_ADDITIONAL_CERTIFICATES := $(additional_certificates) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 572 | |
| 573 | # Define the rule to build the actual package. |
Ying Wang | 8e20ef6 | 2014-06-24 20:01:52 -0700 | [diff] [blame] | 574 | # PRIVATE_JNI_SHARED_LIBRARIES is a list of <abi>:<path_of_built_lib>. |
| 575 | $(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES := $(jni_shared_libraries_with_abis) |
| 576 | # PRIVATE_JNI_SHARED_LIBRARIES_ABI is a list of ABI names. |
| 577 | $(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES_ABI := $(jni_shared_libraries_abis) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 578 | ifneq ($(TARGET_BUILD_APPS),) |
| 579 | # Include all resources for unbundled apps. |
| 580 | LOCAL_AAPT_INCLUDE_ALL_RESOURCES := true |
| 581 | endif |
| 582 | ifeq ($(LOCAL_AAPT_INCLUDE_ALL_RESOURCES),true) |
Adam Lesinski | e758f93 | 2016-02-26 11:13:43 -0800 | [diff] [blame] | 583 | $(my_res_package) $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_CONFIG := |
| 584 | $(my_res_package) $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 585 | else |
Adam Lesinski | e758f93 | 2016-02-26 11:13:43 -0800 | [diff] [blame] | 586 | $(my_res_package) $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_CONFIG := $(PRODUCT_AAPT_CONFIG) |
Ying Wang | 934008f | 2014-07-30 13:40:14 -0700 | [diff] [blame] | 587 | ifdef LOCAL_PACKAGE_SPLITS |
Adam Lesinski | e758f93 | 2016-02-26 11:13:43 -0800 | [diff] [blame] | 588 | $(my_res_package) $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := |
Ying Wang | 934008f | 2014-07-30 13:40:14 -0700 | [diff] [blame] | 589 | else |
Adam Lesinski | e758f93 | 2016-02-26 11:13:43 -0800 | [diff] [blame] | 590 | $(my_res_package) $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := $(PRODUCT_AAPT_PREF_CONFIG) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 591 | endif |
Ying Wang | 934008f | 2014-07-30 13:40:14 -0700 | [diff] [blame] | 592 | endif |
Colin Cross | 303567c | 2017-08-03 03:17:34 +0000 | [diff] [blame] | 593 | |
Dario Freni | 924af7d | 2018-08-17 00:56:14 +0100 | [diff] [blame] | 594 | # Run veridex on product, product_services and vendor modules. |
David Brazdil | 825770e | 2018-07-31 11:31:30 +0100 | [diff] [blame] | 595 | # We skip it for unbundled app builds where we cannot build veridex. |
| 596 | module_run_appcompat := |
Dario Freni | 716e9b6 | 2018-07-31 15:29:13 +0100 | [diff] [blame] | 597 | ifeq (true,$(filter true, \ |
| 598 | $(LOCAL_PRODUCT_MODULE) $(LOCAL_PRODUCT_SERVICES_MODULE) \ |
| 599 | $(LOCAL_VENDOR_MODULE) $(LOCAL_PROPRIETARY_MODULE))) |
David Brazdil | 825770e | 2018-07-31 11:31:30 +0100 | [diff] [blame] | 600 | ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK))) # ! unbundled app build |
| 601 | module_run_appcompat := true |
| 602 | endif |
| 603 | endif |
| 604 | |
| 605 | ifeq ($(module_run_appcompat),true) |
Dan Willemsen | b73ccb7 | 2018-09-17 14:36:37 -0700 | [diff] [blame] | 606 | $(LOCAL_BUILT_MODULE) : $(appcompat-files) |
Dario Freni | 716e9b6 | 2018-07-31 15:29:13 +0100 | [diff] [blame] | 607 | $(LOCAL_BUILT_MODULE): PRIVATE_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE) |
Dario Freni | 1ecc925 | 2018-07-13 16:44:28 +0100 | [diff] [blame] | 608 | endif |
| 609 | |
Colin Cross | 303567c | 2017-08-03 03:17:34 +0000 | [diff] [blame] | 610 | $(LOCAL_BUILT_MODULE): PRIVATE_RESOURCE_INTERMEDIATES_DIR := $(intermediates.COMMON)/resources |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 611 | $(LOCAL_BUILT_MODULE) : $(jni_shared_libraries) |
Colin Cross | c9e4976 | 2018-09-14 13:39:07 -0700 | [diff] [blame] | 612 | $(LOCAL_BUILT_MODULE) : $(JAR_ARGS) $(SOONG_ZIP) $(MERGE_ZIPS) $(ZIP2ZIP) |
Colin Cross | 2029903 | 2018-05-09 13:29:51 -0700 | [diff] [blame] | 613 | ifeq ($(LOCAL_USE_AAPT2),true) |
Ying Wang | dd71c85 | 2015-12-04 13:59:18 -0800 | [diff] [blame] | 614 | $(LOCAL_BUILT_MODULE): PRIVATE_RES_PACKAGE := $(my_res_package) |
| 615 | $(LOCAL_BUILT_MODULE) : $(my_res_package) $(AAPT2) | $(ACP) |
| 616 | else |
Dan Willemsen | f439c33 | 2017-10-02 14:22:02 -0700 | [diff] [blame] | 617 | $(LOCAL_BUILT_MODULE): PRIVATE_RESOURCE_LIST := $(all_res_assets) |
Nicolas Geoffray | a95fbd1 | 2017-09-19 13:10:31 +0100 | [diff] [blame] | 618 | $(LOCAL_BUILT_MODULE) : $(all_res_assets) $(full_android_manifest) $(AAPT) $(ZIPALIGN) |
Nicolas Geoffray | 3972a47 | 2018-01-09 11:46:30 +0000 | [diff] [blame] | 619 | endif # LOCAL_USE_AAPT2 |
Narayan Kamath | 7c20510 | 2017-08-07 12:31:17 +0100 | [diff] [blame] | 620 | ifdef LOCAL_COMPRESSED_MODULE |
| 621 | $(LOCAL_BUILT_MODULE) : $(MINIGZIP) |
| 622 | endif |
Colin Cross | dac94ff | 2018-10-07 21:32:07 -0700 | [diff] [blame^] | 623 | ifeq (true, $(LOCAL_UNCOMPRESS_DEX)) |
| 624 | $(LOCAL_BUILT_MODULE) : $(ZIP2ZIP) |
| 625 | endif |
Colin Cross | 53c8f97 | 2018-09-28 16:19:42 -0700 | [diff] [blame] | 626 | ifneq ($(BUILD_PLATFORM_ZIP),) |
| 627 | $(LOCAL_BUILT_MODULE) : .KATI_IMPLICIT_OUTPUTS := $(dir $(LOCAL_BUILT_MODULE))package.dex.apk |
| 628 | endif |
| 629 | $(LOCAL_BUILT_MODULE): |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 630 | @echo "target Package: $(PRIVATE_MODULE) ($@)" |
Colin Cross | c9e4976 | 2018-09-14 13:39:07 -0700 | [diff] [blame] | 631 | rm -rf $@.parts |
| 632 | mkdir -p $@.parts |
Colin Cross | 2029903 | 2018-05-09 13:29:51 -0700 | [diff] [blame] | 633 | ifeq ($(LOCAL_USE_AAPT2),true) |
Colin Cross | 53c8f97 | 2018-09-28 16:19:42 -0700 | [diff] [blame] | 634 | cp -f $(PRIVATE_RES_PACKAGE) $@.parts/apk.zip |
Ying Wang | 81ef471 | 2016-03-31 10:10:42 -0700 | [diff] [blame] | 635 | else # ! LOCAL_USE_AAPT2 |
Colin Cross | c9e4976 | 2018-09-14 13:39:07 -0700 | [diff] [blame] | 636 | $(call create-assets-package,$@.parts/apk.zip) |
Ying Wang | e295c3d | 2016-02-24 14:11:55 -0800 | [diff] [blame] | 637 | endif # LOCAL_USE_AAPT2 |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 638 | ifneq ($(jni_shared_libraries),) |
Colin Cross | c9e4976 | 2018-09-14 13:39:07 -0700 | [diff] [blame] | 639 | $(call create-jni-shared-libs-package,$@.parts/jni.zip) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 640 | endif |
Ying Wang | 8b27d18 | 2015-03-27 11:07:17 -0700 | [diff] [blame] | 641 | ifeq ($(full_classes_jar),) |
| 642 | # We don't build jar, need to add the Java resources here. |
Colin Cross | c9e4976 | 2018-09-14 13:39:07 -0700 | [diff] [blame] | 643 | $(if $(PRIVATE_EXTRA_JAR_ARGS),$(call create-java-resources-jar,$@.parts/res.zip)) |
Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 644 | else # full_classes_jar |
Colin Cross | c9e4976 | 2018-09-14 13:39:07 -0700 | [diff] [blame] | 645 | $(call create-dex-jar,$@.parts/dex.zip,$(PRIVATE_DEX_FILE)) |
| 646 | $(call extract-resources-jar,$@.parts/res.zip,$(PRIVATE_SOURCE_ARCHIVE)) |
Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 647 | endif # full_classes_jar |
Colin Cross | c9e4976 | 2018-09-14 13:39:07 -0700 | [diff] [blame] | 648 | $(MERGE_ZIPS) $@ $@.parts/*.zip |
| 649 | rm -rf $@.parts |
Nicolas Geoffray | 3972a47 | 2018-01-09 11:46:30 +0000 | [diff] [blame] | 650 | ifeq (true, $(LOCAL_UNCOMPRESS_DEX)) |
| 651 | @# No need to align, sign-package below will do it. |
| 652 | $(uncompress-dexs) |
| 653 | endif |
Dario Freni | 1ecc925 | 2018-07-13 16:44:28 +0100 | [diff] [blame] | 654 | # Run appcompat before stripping the classes.dex file. |
David Brazdil | 825770e | 2018-07-31 11:31:30 +0100 | [diff] [blame] | 655 | ifeq ($(module_run_appcompat),true) |
Dario Freni | 716e9b6 | 2018-07-31 15:29:13 +0100 | [diff] [blame] | 656 | ifeq ($(LOCAL_USE_AAPT2),true) |
| 657 | $(call appcompat-header, aapt2) |
| 658 | else |
| 659 | $(appcompat-header) |
| 660 | endif |
Dario Freni | 1ecc925 | 2018-07-13 16:44:28 +0100 | [diff] [blame] | 661 | $(run-appcompat) |
David Brazdil | 825770e | 2018-07-31 11:31:30 +0100 | [diff] [blame] | 662 | endif # module_run_appcompat |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 663 | ifdef LOCAL_DEX_PREOPT |
Ying Wang | 3a61eeb | 2016-03-11 10:32:01 -0800 | [diff] [blame] | 664 | ifneq ($(BUILD_PLATFORM_ZIP),) |
| 665 | @# Keep a copy of apk with classes.dex unstripped |
| 666 | $(hide) cp -f $@ $(dir $@)package.dex.apk |
| 667 | endif # BUILD_PLATFORM_ZIP |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 668 | ifneq (nostripping,$(LOCAL_DEX_PREOPT)) |
| 669 | $(call dexpreopt-remove-classes.dex,$@) |
| 670 | endif |
Nicolas Geoffray | 3972a47 | 2018-01-09 11:46:30 +0000 | [diff] [blame] | 671 | endif # LOCAL_DEX_PREOPT |
Kenny Root | dff3755 | 2015-04-15 12:09:32 -0700 | [diff] [blame] | 672 | $(sign-package) |
Narayan Kamath | 7c20510 | 2017-08-07 12:31:17 +0100 | [diff] [blame] | 673 | ifdef LOCAL_COMPRESSED_MODULE |
| 674 | $(compress-package) |
| 675 | endif # LOCAL_COMPRESSED_MODULE |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 676 | |
Ying Wang | 36142f6 | 2014-05-21 16:13:33 -0700 | [diff] [blame] | 677 | ############################### |
Ying Wang | 8070b20 | 2014-12-01 17:46:56 -0800 | [diff] [blame] | 678 | ## Build dpi-specific apks, if it's apps_only build. |
| 679 | ifdef TARGET_BUILD_APPS |
| 680 | ifdef LOCAL_DPI_VARIANTS |
| 681 | $(foreach d, $(LOCAL_DPI_VARIANTS), \ |
| 682 | $(eval my_dpi := $(d)) \ |
| 683 | $(eval include $(BUILD_SYSTEM)/dpi_specific_apk.mk)) |
| 684 | endif |
| 685 | endif |
| 686 | |
| 687 | ############################### |
Ying Wang | 36142f6 | 2014-05-21 16:13:33 -0700 | [diff] [blame] | 688 | ## Rule to build the odex file |
| 689 | ifdef LOCAL_DEX_PREOPT |
| 690 | $(built_odex): PRIVATE_DEX_FILE := $(built_dex) |
Colin Cross | dac94ff | 2018-10-07 21:32:07 -0700 | [diff] [blame^] | 691 | ifeq (true, $(LOCAL_UNCOMPRESS_DEX)) |
| 692 | $(built_odex): $(ZIP2ZIP) |
| 693 | endif |
Ying Wang | db48da7 | 2014-09-13 11:26:39 -0700 | [diff] [blame] | 694 | # Use pattern rule - we may have multiple built odex files. |
| 695 | $(built_odex) : $(dir $(LOCAL_BUILT_MODULE))% : $(built_dex) |
Ying Wang | 994c226 | 2014-05-28 13:34:59 -0700 | [diff] [blame] | 696 | $(hide) mkdir -p $(dir $@) && rm -f $@ |
Colin Cross | c9e4976 | 2018-09-14 13:39:07 -0700 | [diff] [blame] | 697 | $(call create-dex-jar,$@,$(PRIVATE_DEX_FILE)) |
Nicolas Geoffray | 3972a47 | 2018-01-09 11:46:30 +0000 | [diff] [blame] | 698 | ifeq (true, $(LOCAL_UNCOMPRESS_DEX)) |
| 699 | $(uncompress-dexs) |
| 700 | $(align-package) |
| 701 | endif |
Ying Wang | 36142f6 | 2014-05-21 16:13:33 -0700 | [diff] [blame] | 702 | $(hide) mv $@ $@.input |
| 703 | $(call dexpreopt-one-file,$@.input,$@) |
| 704 | $(hide) rm $@.input |
| 705 | endif |
| 706 | |
Ying Wang | 1425e2d | 2014-07-22 15:42:11 -0700 | [diff] [blame] | 707 | ############################### |
| 708 | ## APK splits |
| 709 | ifdef LOCAL_PACKAGE_SPLITS |
Ying Wang | 7f625aa | 2014-07-23 10:27:57 -0700 | [diff] [blame] | 710 | # The splits should have been built in the same command building the base apk. |
Alex Klyubin | 5b826ac | 2015-12-04 10:07:41 -0800 | [diff] [blame] | 711 | # This rule just runs signing. |
Ying Wang | 7f625aa | 2014-07-23 10:27:57 -0700 | [diff] [blame] | 712 | # Note that we explicily check the existence of the split apk and remove the |
| 713 | # built base apk if the split apk isn't there. |
| 714 | # That way the build system will rerun the aapt after the user changes the splitting parameters. |
Ying Wang | 1425e2d | 2014-07-22 15:42:11 -0700 | [diff] [blame] | 715 | $(built_apk_splits): PRIVATE_PRIVATE_KEY := $(private_key) |
| 716 | $(built_apk_splits): PRIVATE_CERTIFICATE := $(certificate) |
Dan Willemsen | f72308a | 2017-05-15 23:38:04 -0700 | [diff] [blame] | 717 | $(built_apk_splits) : $(intermediates)/%.apk : $(LOCAL_BUILT_MODULE) |
Ying Wang | 7f625aa | 2014-07-23 10:27:57 -0700 | [diff] [blame] | 718 | $(hide) if [ ! -f $@ ]; then \ |
| 719 | echo 'No $@ generated, check your apk splitting parameters.' 1>&2; \ |
| 720 | rm $<; exit 1; \ |
| 721 | fi |
| 722 | $(sign-package) |
Ying Wang | 1425e2d | 2014-07-22 15:42:11 -0700 | [diff] [blame] | 723 | |
| 724 | # Rules to install the splits |
Colin Cross | 7a28158 | 2018-03-06 16:21:36 -0800 | [diff] [blame] | 725 | installed_apk_splits := $(foreach s,$(my_split_suffixes),$(my_module_path)/$(LOCAL_MODULE)_$(s).apk) |
Dan Willemsen | f72308a | 2017-05-15 23:38:04 -0700 | [diff] [blame] | 726 | $(installed_apk_splits) : $(my_module_path)/$(LOCAL_MODULE)_%.apk : $(intermediates)/package_%.apk |
Ying Wang | 7f625aa | 2014-07-23 10:27:57 -0700 | [diff] [blame] | 727 | @echo "Install: $@" |
| 728 | $(copy-file-to-new-target) |
Ying Wang | 1425e2d | 2014-07-22 15:42:11 -0700 | [diff] [blame] | 729 | |
| 730 | # Register the additional built and installed files. |
| 731 | ALL_MODULES.$(my_register_name).INSTALLED += $(installed_apk_splits) |
| 732 | ALL_MODULES.$(my_register_name).BUILT_INSTALLED += \ |
Dan Willemsen | f72308a | 2017-05-15 23:38:04 -0700 | [diff] [blame] | 733 | $(foreach s,$(my_split_suffixes),$(intermediates)/package_$(s).apk:$(my_module_path)/$(LOCAL_MODULE)_$(s).apk) |
Ying Wang | 1425e2d | 2014-07-22 15:42:11 -0700 | [diff] [blame] | 734 | |
| 735 | # Make sure to install the splits when you run "make <module_name>". |
Colin Cross | 3388670 | 2016-09-20 16:01:28 -0700 | [diff] [blame] | 736 | $(my_all_targets): $(installed_apk_splits) |
Ying Wang | 1624361 | 2015-06-03 12:43:50 -0700 | [diff] [blame] | 737 | |
| 738 | ifdef LOCAL_COMPATIBILITY_SUITE |
Ying Wang | 1624361 | 2015-06-03 12:43:50 -0700 | [diff] [blame] | 739 | |
Simran Basi | 6bea37c | 2017-02-16 18:04:10 -0800 | [diff] [blame] | 740 | $(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \ |
| 741 | $(eval my_compat_dist_$(suite) := $(foreach dir, $(call compatibility_suite_dirs,$(suite)), \ |
| 742 | $(foreach s,$(my_split_suffixes),\ |
Dan Willemsen | f72308a | 2017-05-15 23:38:04 -0700 | [diff] [blame] | 743 | $(intermediates)/package_$(s).apk:$(dir)/$(LOCAL_MODULE)_$(s).apk)))) |
Ying Wang | 1624361 | 2015-06-03 12:43:50 -0700 | [diff] [blame] | 744 | |
Simran Basi | 6bea37c | 2017-02-16 18:04:10 -0800 | [diff] [blame] | 745 | $(call create-suite-dependencies) |
| 746 | |
Ying Wang | 1624361 | 2015-06-03 12:43:50 -0700 | [diff] [blame] | 747 | endif # LOCAL_COMPATIBILITY_SUITE |
Ying Wang | 1425e2d | 2014-07-22 15:42:11 -0700 | [diff] [blame] | 748 | endif # LOCAL_PACKAGE_SPLITS |
| 749 | |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 750 | # Save information about this package |
| 751 | PACKAGES.$(LOCAL_PACKAGE_NAME).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES)) |
| 752 | PACKAGES.$(LOCAL_PACKAGE_NAME).RESOURCE_FILES := $(all_resources) |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 753 | |
| 754 | PACKAGES := $(PACKAGES) $(LOCAL_PACKAGE_NAME) |
| 755 | |
Colin Cross | 8e40412 | 2014-02-06 14:45:37 -0800 | [diff] [blame] | 756 | endif # skip_definition |
| 757 | |
| 758 | # Reset internal variables. |
| 759 | all_res_assets := |
Jaekyun Seok | 3070610 | 2017-02-02 00:44:58 +0900 | [diff] [blame] | 760 | |
| 761 | ifdef enforce_rro_enabled |
| 762 | ifdef LOCAL_EXPORT_PACKAGE_RESOURCES |
| 763 | enforce_rro_use_res_lib := true |
| 764 | else |
| 765 | enforce_rro_use_res_lib := false |
| 766 | endif |
| 767 | |
| 768 | ifdef LOCAL_MANIFEST_PACKAGE_NAME |
| 769 | enforce_rro_is_manifest_package_name := true |
| 770 | enforce_rro_manifest_package_info := $(LOCAL_MANIFEST_PACKAGE_NAME) |
| 771 | else |
| 772 | enforce_rro_is_manifest_package_name := false |
| 773 | enforce_rro_manifest_package_info := $(full_android_manifest) |
| 774 | endif |
| 775 | |
| 776 | $(call append_enforce_rro_sources, \ |
| 777 | $(my_register_name), \ |
| 778 | $(enforce_rro_is_manifest_package_name), \ |
| 779 | $(enforce_rro_manifest_package_info), \ |
| 780 | $(enforce_rro_use_res_lib), \ |
| 781 | $(package_resource_overlays) \ |
| 782 | ) |
Jaekyun Seok | 2a20999 | 2017-03-30 11:25:02 +0900 | [diff] [blame] | 783 | endif # enforce_rro_enabled |