The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -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 |
Ying Wang | 4f1ab92 | 2011-03-15 13:19:30 -0700 | [diff] [blame^] | 22 | ## will be called this. |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 23 | ## |
| 24 | ## MODULE, MODULE_PATH, and MODULE_SUFFIX will |
| 25 | ## be set for you. |
| 26 | ########################################################### |
| 27 | |
Joe Onorato | 899e62a | 2010-02-04 17:37:21 -0800 | [diff] [blame] | 28 | |
| 29 | # If this makefile is being read from within an inheritance, |
| 30 | # use the new values. |
| 31 | skip_definition:= |
| 32 | ifdef LOCAL_PACKAGE_OVERRIDES |
| 33 | package_overridden := $(call set-inherited-package-variables) |
| 34 | ifeq ($(strip $(package_overridden)),) |
| 35 | skip_definition := true |
| 36 | endif |
| 37 | endif |
| 38 | |
| 39 | ifndef skip_definition |
| 40 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 41 | LOCAL_PACKAGE_NAME := $(strip $(LOCAL_PACKAGE_NAME)) |
| 42 | ifeq ($(LOCAL_PACKAGE_NAME),) |
| 43 | $(error $(LOCAL_PATH): Package modules must define LOCAL_PACKAGE_NAME) |
| 44 | endif |
| 45 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 46 | ifneq ($(strip $(LOCAL_MODULE_SUFFIX)),) |
| 47 | $(error $(LOCAL_PATH): Package modules may not define LOCAL_MODULE_SUFFIX) |
| 48 | endif |
| 49 | LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) |
| 50 | |
| 51 | ifneq ($(strip $(LOCAL_MODULE)),) |
| 52 | $(error $(LOCAL_PATH): Package modules may not define LOCAL_MODULE) |
| 53 | endif |
| 54 | LOCAL_MODULE := $(LOCAL_PACKAGE_NAME) |
| 55 | |
| 56 | # Android packages should use Android resources or assets. |
| 57 | ifneq (,$(LOCAL_JAVA_RESOURCE_DIRS)) |
| 58 | $(error $(LOCAL_PATH): Package modules may not set LOCAL_JAVA_RESOURCE_DIRS) |
| 59 | endif |
| 60 | ifneq (,$(LOCAL_JAVA_RESOURCE_FILES)) |
| 61 | $(error $(LOCAL_PATH): Package modules may not set LOCAL_JAVA_RESOURCE_FILES) |
| 62 | endif |
| 63 | |
Evan Charlton | 121a787 | 2010-07-23 11:03:29 -0700 | [diff] [blame] | 64 | ifeq ($(strip $(LOCAL_MANIFEST_FILE)),) |
| 65 | LOCAL_MANIFEST_FILE := AndroidManifest.xml |
| 66 | endif |
| 67 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 68 | ifneq ($(strip $(LOCAL_MODULE_CLASS)),) |
| 69 | $(error $(LOCAL_PATH): Package modules may not set LOCAL_MODULE_CLASS) |
| 70 | endif |
| 71 | LOCAL_MODULE_CLASS := APPS |
| 72 | |
The Android Open Source Project | 2f31293 | 2009-03-09 11:52:11 -0700 | [diff] [blame] | 73 | # Package LOCAL_MODULE_TAGS default to optional |
| 74 | LOCAL_MODULE_TAGS := $(strip $(LOCAL_MODULE_TAGS)) |
| 75 | ifeq ($(LOCAL_MODULE_TAGS),) |
| 76 | LOCAL_MODULE_TAGS := optional |
| 77 | endif |
| 78 | |
Ying Wang | c61d593 | 2010-03-10 16:02:42 -0800 | [diff] [blame] | 79 | ifeq ($(filter tests, $(LOCAL_MODULE_TAGS)),) |
| 80 | # Force localization check if it's not tagged as tests. |
| 81 | LOCAL_AAPT_FLAGS := $(LOCAL_AAPT_FLAGS) -z |
| 82 | endif |
| 83 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 84 | ifeq (,$(LOCAL_ASSET_DIR)) |
| 85 | LOCAL_ASSET_DIR := $(LOCAL_PATH)/assets |
| 86 | endif |
| 87 | |
| 88 | ifeq (,$(LOCAL_RESOURCE_DIR)) |
| 89 | LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res |
| 90 | endif |
| 91 | LOCAL_RESOURCE_DIR := \ |
Bjorn Bringert | a7ab17d | 2010-01-14 17:33:44 +0000 | [diff] [blame] | 92 | $(wildcard $(foreach dir, $(PRODUCT_PACKAGE_OVERLAYS), \ |
| 93 | $(addprefix $(dir)/, $(LOCAL_RESOURCE_DIR)))) \ |
| 94 | $(wildcard $(foreach dir, $(DEVICE_PACKAGE_OVERLAYS), \ |
| 95 | $(addprefix $(dir)/, $(LOCAL_RESOURCE_DIR)))) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 96 | $(LOCAL_RESOURCE_DIR) |
| 97 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 98 | all_assets := $(call find-subdir-assets,$(LOCAL_ASSET_DIR)) |
| 99 | all_assets := $(addprefix $(LOCAL_ASSET_DIR)/,$(patsubst assets/%,%,$(all_assets))) |
| 100 | |
| 101 | all_resources := $(strip \ |
| 102 | $(foreach dir, $(LOCAL_RESOURCE_DIR), \ |
| 103 | $(addprefix $(dir)/, \ |
| 104 | $(patsubst res/%,%, \ |
| 105 | $(call find-subdir-assets,$(dir)) \ |
| 106 | ) \ |
| 107 | ) \ |
| 108 | )) |
| 109 | |
| 110 | all_res_assets := $(strip $(all_assets) $(all_resources)) |
| 111 | |
Ying Wang | 6ef046c | 2009-12-07 18:14:00 -0800 | [diff] [blame] | 112 | package_expected_intermediates_COMMON := $(call local-intermediates-dir,COMMON) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 113 | # If no assets or resources were found, clear the directory variables so |
| 114 | # we don't try to build them. |
| 115 | ifeq (,$(all_assets)) |
| 116 | LOCAL_ASSET_DIR:= |
| 117 | endif |
| 118 | ifeq (,$(all_resources)) |
| 119 | LOCAL_RESOURCE_DIR:= |
| 120 | R_file_stamp := |
| 121 | else |
| 122 | # Make sure that R_file_stamp inherits the proper PRIVATE vars. |
| 123 | # If R.stamp moves, be sure to update the framework makefile, |
| 124 | # which has intimate knowledge of its location. |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 125 | R_file_stamp := $(package_expected_intermediates_COMMON)/src/R.stamp |
| 126 | LOCAL_INTERMEDIATE_TARGETS += $(R_file_stamp) |
| 127 | endif |
| 128 | |
| 129 | LOCAL_BUILT_MODULE_STEM := package.apk |
| 130 | |
Ying Wang | 3b2bdf1 | 2010-02-01 09:51:23 -0800 | [diff] [blame] | 131 | LOCAL_PROGUARD_ENABLED:=$(strip $(LOCAL_PROGUARD_ENABLED)) |
Ying Wang | 85ab497 | 2010-02-19 18:39:13 -0800 | [diff] [blame] | 132 | ifndef LOCAL_PROGUARD_ENABLED |
| 133 | ifneq ($(filter user userdebug, $(TARGET_BUILD_VARIANT)),) |
| 134 | # turn on Proguard by default for user & userdebug build |
| 135 | LOCAL_PROGUARD_ENABLED :=full |
| 136 | endif |
| 137 | endif |
| 138 | ifeq ($(LOCAL_PROGUARD_ENABLED),disabled) |
| 139 | # the package explicitly request to disable proguard. |
| 140 | LOCAL_PROGUARD_ENABLED := |
| 141 | endif |
Ying Wang | 3b2bdf1 | 2010-02-01 09:51:23 -0800 | [diff] [blame] | 142 | proguard_options_file := |
| 143 | ifneq ($(LOCAL_PROGUARD_ENABLED),custom) |
| 144 | ifneq ($(all_resources),) |
Ying Wang | a17463f | 2010-03-03 14:32:06 -0800 | [diff] [blame] | 145 | proguard_options_file := $(package_expected_intermediates_COMMON)/proguard_options |
Ying Wang | 3b2bdf1 | 2010-02-01 09:51:23 -0800 | [diff] [blame] | 146 | endif # all_resources |
| 147 | endif # !custom |
Ying Wang | a17463f | 2010-03-03 14:32:06 -0800 | [diff] [blame] | 148 | LOCAL_PROGUARD_FLAGS := $(addprefix -include ,$(proguard_options_file)) $(LOCAL_PROGUARD_FLAGS) |
Joe Onorato | 2daa2b3 | 2009-08-30 13:39:24 -0700 | [diff] [blame] | 149 | |
Ying Wang | e7874c4 | 2010-09-17 16:36:06 -0700 | [diff] [blame] | 150 | ifeq (true,$(WITH_DEXPREOPT)) |
Ying Wang | 94978cf | 2011-01-12 11:12:06 -0800 | [diff] [blame] | 151 | ifeq (,$(TARGET_BUILD_APPS)) |
Ying Wang | e7874c4 | 2010-09-17 16:36:06 -0700 | [diff] [blame] | 152 | ifneq (,$(LOCAL_SRC_FILES)) |
| 153 | ifndef LOCAL_DEX_PREOPT |
| 154 | LOCAL_DEX_PREOPT := true |
| 155 | endif |
| 156 | endif |
| 157 | endif |
Ying Wang | 94978cf | 2011-01-12 11:12:06 -0800 | [diff] [blame] | 158 | endif |
Ying Wang | e7874c4 | 2010-09-17 16:36:06 -0700 | [diff] [blame] | 159 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 160 | ################################# |
| 161 | include $(BUILD_SYSTEM)/java.mk |
| 162 | ################################# |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 163 | |
Evan Charlton | 121a787 | 2010-07-23 11:03:29 -0700 | [diff] [blame] | 164 | full_android_manifest := $(LOCAL_PATH)/$(LOCAL_MANIFEST_FILE) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 165 | $(LOCAL_INTERMEDIATE_TARGETS): \ |
| 166 | PRIVATE_ANDROID_MANIFEST := $(full_android_manifest) |
| 167 | |
| 168 | ifneq ($(all_resources),) |
| 169 | |
| 170 | # Since we don't know where the real R.java file is going to end up, |
| 171 | # we need to use another file to stand in its place. We'll just |
| 172 | # copy the generated file to src/R.stamp, which means it will |
| 173 | # have the same contents and timestamp as the actual file. |
| 174 | # |
| 175 | # At the same time, this will copy the R.java file to a central |
| 176 | # 'R' directory to make it easier to add the files to an IDE. |
| 177 | # |
| 178 | #TODO: use PRIVATE_SOURCE_INTERMEDIATES_DIR instead of |
| 179 | # $(intermediates.COMMON)/src |
| 180 | ifneq ($(package_expected_intermediates_COMMON),$(intermediates.COMMON)) |
| 181 | $(error $(LOCAL_MODULE): internal error: expected intermediates.COMMON "$(package_expected_intermediates_COMMON)" != intermediates.COMMON "$(intermediates.COMMON)") |
| 182 | endif |
| 183 | |
| 184 | $(R_file_stamp): PRIVATE_RESOURCE_PUBLICS_OUTPUT := \ |
| 185 | $(intermediates.COMMON)/public_resources.xml |
Joe Onorato | 2daa2b3 | 2009-08-30 13:39:24 -0700 | [diff] [blame] | 186 | $(R_file_stamp): PRIVATE_PROGUARD_OPTIONS_FILE := $(proguard_options_file) |
Ying Wang | 0bd59a0 | 2010-07-15 17:17:52 -0700 | [diff] [blame] | 187 | $(R_file_stamp): $(all_res_assets) $(full_android_manifest) $(RenderScript_file_stamp) $(AAPT) | $(ACP) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 188 | @echo "target R.java/Manifest.java: $(PRIVATE_MODULE) ($@)" |
| 189 | @rm -f $@ |
| 190 | $(create-resource-java-files) |
| 191 | $(hide) for GENERATED_MANIFEST_FILE in `find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) \ |
| 192 | -name Manifest.java 2> /dev/null`; do \ |
Patrick Scott | fa30f5b | 2010-11-05 15:00:50 -0400 | [diff] [blame] | 193 | dir=`awk '/package/{gsub(/\./,"/",$$2);gsub(/;/,"",$$2);print $$2;exit}' $$GENERATED_MANIFEST_FILE`; \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 194 | mkdir -p $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \ |
| 195 | $(ACP) -fpt $$GENERATED_MANIFEST_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \ |
| 196 | done; |
| 197 | $(hide) for GENERATED_R_FILE in `find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) \ |
| 198 | -name R.java 2> /dev/null`; do \ |
Patrick Scott | fa30f5b | 2010-11-05 15:00:50 -0400 | [diff] [blame] | 199 | dir=`awk '/package/{gsub(/\./,"/",$$2);gsub(/;/,"",$$2);print $$2;exit}' $$GENERATED_R_FILE`; \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 200 | mkdir -p $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \ |
| 201 | $(ACP) -fpt $$GENERATED_R_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir \ |
| 202 | || exit 31; \ |
| 203 | $(ACP) -fpt $$GENERATED_R_FILE $@ || exit 32; \ |
| 204 | done; \ |
| 205 | |
Joe Onorato | 2daa2b3 | 2009-08-30 13:39:24 -0700 | [diff] [blame] | 206 | $(proguard_options_file): $(R_file_stamp) |
| 207 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 208 | ifdef LOCAL_EXPORT_PACKAGE_RESOURCES |
| 209 | # Put this module's resources into a PRODUCT-agnositc package that |
| 210 | # other packages can use to build their own PRODUCT-agnostic R.java (etc.) |
| 211 | # files. |
| 212 | resource_export_package := $(intermediates.COMMON)/package-export.apk |
| 213 | $(R_file_stamp): $(resource_export_package) |
| 214 | |
| 215 | # add-assets-to-package looks at PRODUCT_AAPT_CONFIG, but this target |
| 216 | # can't know anything about PRODUCT. Clear it out just for this target. |
Ying Wang | 4f1ab92 | 2011-03-15 13:19:30 -0700 | [diff] [blame^] | 217 | $(resource_export_package): PRIVATE_PRODUCT_AAPT_CONFIG := |
Ying Wang | 035ef06 | 2010-08-18 20:30:52 -0700 | [diff] [blame] | 218 | $(resource_export_package): $(all_res_assets) $(full_android_manifest) $(RenderScript_file_stamp) $(AAPT) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 219 | @echo "target Export Resources: $(PRIVATE_MODULE) ($@)" |
| 220 | $(create-empty-package) |
| 221 | $(add-assets-to-package) |
| 222 | endif |
| 223 | |
| 224 | # Other modules should depend on the BUILT module if |
| 225 | # they want to use this module's R.java file. |
| 226 | $(LOCAL_BUILT_MODULE): $(R_file_stamp) |
| 227 | |
| 228 | ifneq ($(full_classes_jar),) |
| 229 | # If full_classes_jar is non-empty, we're building sources. |
| 230 | # If we're building sources, the initial javac step (which |
| 231 | # produces full_classes_compiled_jar) needs to ensure the |
| 232 | # R.java and Manifest.java files have been generated first. |
| 233 | $(full_classes_compiled_jar): $(R_file_stamp) |
| 234 | endif |
| 235 | |
| 236 | endif # all_resources |
| 237 | |
| 238 | ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true) |
| 239 | # We need to explicitly clear this var so that we don't |
| 240 | # inherit the value from whomever caused us to be built. |
| 241 | $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_AAPT_INCLUDES := |
| 242 | else |
| 243 | # Most packages should link against the resources defined by framework-res. |
| 244 | # Even if they don't have their own resources, they may use framework |
| 245 | # resources. |
Ying Wang | 0f6f4ca | 2010-06-09 10:26:26 -0700 | [diff] [blame] | 246 | ifneq ($(filter-out current,$(LOCAL_SDK_VERSION)),) |
| 247 | # for released sdk versions, the platform resources were built into android.jar. |
| 248 | framework_res_package_export := \ |
| 249 | $(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_VERSION)/android.jar |
| 250 | framework_res_package_export_deps := $(framework_res_package_export) |
| 251 | else # LOCAL_SDK_VERSION |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 252 | framework_res_package_export := \ |
| 253 | $(call intermediates-dir-for,APPS,framework-res,,COMMON)/package-export.apk |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 254 | # We can't depend directly on the export.apk file; it won't get its |
| 255 | # PRIVATE_ vars set up correctly if we do. Instead, depend on the |
| 256 | # corresponding R.stamp file, which lists the export.apk as a dependency. |
| 257 | framework_res_package_export_deps := \ |
| 258 | $(dir $(framework_res_package_export))src/R.stamp |
Ying Wang | 0f6f4ca | 2010-06-09 10:26:26 -0700 | [diff] [blame] | 259 | endif # LOCAL_SDK_VERSION |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 260 | $(R_file_stamp): $(framework_res_package_export_deps) |
Ying Wang | 0f6f4ca | 2010-06-09 10:26:26 -0700 | [diff] [blame] | 261 | $(LOCAL_INTERMEDIATE_TARGETS): \ |
| 262 | PRIVATE_AAPT_INCLUDES := $(framework_res_package_export) |
| 263 | endif # LOCAL_NO_STANDARD_LIBRARIES |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 264 | |
| 265 | ifneq ($(full_classes_jar),) |
| 266 | $(LOCAL_BUILT_MODULE): PRIVATE_DEX_FILE := $(built_dex) |
| 267 | $(LOCAL_BUILT_MODULE): $(built_dex) |
| 268 | endif # full_classes_jar |
| 269 | |
| 270 | |
| 271 | # Get the list of jni libraries to be included in the apk file. |
| 272 | |
| 273 | so_suffix := $($(my_prefix)SHLIB_SUFFIX) |
| 274 | |
| 275 | jni_shared_libraries := \ |
| 276 | $(addprefix $($(my_prefix)OUT_INTERMEDIATE_LIBRARIES)/, \ |
| 277 | $(addsuffix $(so_suffix), \ |
| 278 | $(LOCAL_JNI_SHARED_LIBRARIES))) |
| 279 | |
Jack Palevich | a0ab29b | 2010-06-18 15:38:07 +0800 | [diff] [blame] | 280 | # Set the abi directory used by the local JNI shared libraries. |
| 281 | # (Doesn't change how the local shared libraries are compiled, just |
| 282 | # sets where they are stored in the apk.) |
| 283 | |
| 284 | ifeq ($(LOCAL_JNI_SHARED_LIBRARIES_ABI),) |
| 285 | jni_shared_libraries_abi := $(TARGET_CPU_ABI) |
| 286 | else |
| 287 | jni_shared_libraries_abi := $(LOCAL_JNI_SHARED_LIBRARIES_ABI) |
| 288 | endif |
| 289 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 290 | # Pick a key to sign the package with. If this package hasn't specified |
| 291 | # an explicit certificate, use the default. |
| 292 | # Secure release builds will have their packages signed after the fact, |
| 293 | # so it's ok for these private keys to be in the clear. |
| 294 | ifeq ($(LOCAL_CERTIFICATE),) |
| 295 | LOCAL_CERTIFICATE := testkey |
| 296 | endif |
Doug Zongker | f6a53aa | 2009-12-15 15:06:55 -0800 | [diff] [blame] | 297 | |
| 298 | ifeq ($(LOCAL_CERTIFICATE),EXTERNAL) |
| 299 | # The special value "EXTERNAL" means that we will sign it with the |
| 300 | # default testkey, apply predexopt, but then expect the final .apk |
| 301 | # (after dexopting) to be signed by an outside tool. |
| 302 | LOCAL_CERTIFICATE := testkey |
| 303 | PACKAGES.$(LOCAL_PACKAGE_NAME).EXTERNAL_KEY := 1 |
| 304 | endif |
| 305 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 306 | # If this is not an absolute certificate, assign it to a generic one. |
| 307 | ifeq ($(dir $(strip $(LOCAL_CERTIFICATE))),./) |
| 308 | LOCAL_CERTIFICATE := $(SRC_TARGET_DIR)/product/security/$(LOCAL_CERTIFICATE) |
| 309 | endif |
| 310 | private_key := $(LOCAL_CERTIFICATE).pk8 |
| 311 | certificate := $(LOCAL_CERTIFICATE).x509.pem |
| 312 | |
| 313 | $(LOCAL_BUILT_MODULE): $(private_key) $(certificate) $(SIGNAPK_JAR) |
| 314 | $(LOCAL_BUILT_MODULE): PRIVATE_PRIVATE_KEY := $(private_key) |
| 315 | $(LOCAL_BUILT_MODULE): PRIVATE_CERTIFICATE := $(certificate) |
| 316 | |
| 317 | PACKAGES.$(LOCAL_PACKAGE_NAME).PRIVATE_KEY := $(private_key) |
| 318 | PACKAGES.$(LOCAL_PACKAGE_NAME).CERTIFICATE := $(certificate) |
| 319 | |
| 320 | # Define the rule to build the actual package. |
| 321 | $(LOCAL_BUILT_MODULE): $(AAPT) | $(ZIPALIGN) |
Ying Wang | e7874c4 | 2010-09-17 16:36:06 -0700 | [diff] [blame] | 322 | ifeq ($(LOCAL_DEX_PREOPT),true) |
| 323 | # Make sure the boot jars get dexpreopt-ed first |
| 324 | $(LOCAL_BUILT_MODULE): $(DEXPREOPT_BOOT_ODEXS) | $(DEXPREOPT) $(DEXOPT) |
| 325 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 326 | $(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES := $(jni_shared_libraries) |
Jack Palevich | a0ab29b | 2010-06-18 15:38:07 +0800 | [diff] [blame] | 327 | $(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES_ABI := $(jni_shared_libraries_abi) |
Joe Onorato | 16fa4b2 | 2010-06-09 16:35:58 -0700 | [diff] [blame] | 328 | ifneq ($(TARGET_BUILD_APPS),) |
Ying Wang | 5291130 | 2010-05-26 13:13:56 -0700 | [diff] [blame] | 329 | # Include all resources for unbundled apps. |
Ying Wang | 8b07ed8 | 2010-12-28 13:14:29 -0800 | [diff] [blame] | 330 | LOCAL_AAPT_INCLUDE_ALL_RESOURCES := true |
| 331 | endif |
| 332 | ifeq ($(LOCAL_AAPT_INCLUDE_ALL_RESOURCES),true) |
Ying Wang | 4f1ab92 | 2011-03-15 13:19:30 -0700 | [diff] [blame^] | 333 | $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_CONFIG := |
| 334 | else |
| 335 | $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_CONFIG := $(PRODUCT_AAPT_CONFIG) |
Ying Wang | 5291130 | 2010-05-26 13:13:56 -0700 | [diff] [blame] | 336 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 337 | $(LOCAL_BUILT_MODULE): $(all_res_assets) $(jni_shared_libraries) $(full_android_manifest) |
| 338 | @echo "target Package: $(PRIVATE_MODULE) ($@)" |
| 339 | $(create-empty-package) |
| 340 | $(add-assets-to-package) |
| 341 | ifneq ($(jni_shared_libraries),) |
| 342 | $(add-jni-shared-libs-to-package) |
| 343 | endif |
| 344 | ifneq ($(full_classes_jar),) |
| 345 | $(add-dex-to-package) |
| 346 | endif |
| 347 | $(sign-package) |
| 348 | @# Alignment must happen after all other zip operations. |
| 349 | $(align-package) |
Ying Wang | e7874c4 | 2010-09-17 16:36:06 -0700 | [diff] [blame] | 350 | ifeq ($(LOCAL_DEX_PREOPT),true) |
| 351 | $(hide) rm -f $(patsubst %.apk,%.odex,$@) |
| 352 | $(call dexpreopt-one-file,$@,$(patsubst %.apk,%.odex,$@)) |
| 353 | $(call dexpreopt-remove-classes.dex,$@) |
| 354 | |
| 355 | built_odex := $(basename $(LOCAL_BUILT_MODULE)).odex |
| 356 | $(built_odex): $(LOCAL_BUILT_MODULE) |
| 357 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 358 | |
| 359 | # Save information about this package |
| 360 | PACKAGES.$(LOCAL_PACKAGE_NAME).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES)) |
| 361 | PACKAGES.$(LOCAL_PACKAGE_NAME).RESOURCE_FILES := $(all_resources) |
| 362 | |
| 363 | PACKAGES := $(PACKAGES) $(LOCAL_PACKAGE_NAME) |
Joe Onorato | 899e62a | 2010-02-04 17:37:21 -0800 | [diff] [blame] | 364 | |
| 365 | endif # skip_definition |