blob: a29f8204115802b215c9a5feb2ce4ad967d17464 [file] [log] [blame]
Ying Wang956dccc2015-08-28 11:47:03 -07001# Target Java.
The Android Open Source Project88b60792009-03-03 19:28:42 -08002# Requires:
3# LOCAL_MODULE_SUFFIX
4# LOCAL_MODULE_CLASS
5# all_res_assets
6
The Android Open Source Project88b60792009-03-03 19:28:42 -08007LOCAL_NO_STANDARD_LIBRARIES:=$(strip $(LOCAL_NO_STANDARD_LIBRARIES))
8LOCAL_SDK_VERSION:=$(strip $(LOCAL_SDK_VERSION))
9
Ying Wanga5fc87a2010-11-02 18:43:16 -070010proto_sources := $(filter %.proto,$(LOCAL_SRC_FILES))
11ifneq ($(proto_sources),)
12ifeq ($(LOCAL_PROTOC_OPTIMIZE_TYPE),micro)
Jeff Davidsonb8ddd552014-09-15 17:51:11 -070013 LOCAL_STATIC_JAVA_LIBRARIES += libprotobuf-java-micro
Ying Wanga5fc87a2010-11-02 18:43:16 -070014else
Ulas Kirazcibde274e2013-03-28 14:02:14 -070015 ifeq ($(LOCAL_PROTOC_OPTIMIZE_TYPE),nano)
Jeff Davidsonb8ddd552014-09-15 17:51:11 -070016 LOCAL_STATIC_JAVA_LIBRARIES += libprotobuf-java-nano
Ulas Kirazcibde274e2013-03-28 14:02:14 -070017 else
Joe Onoratoc05a8ee2016-10-05 18:01:10 -070018 ifeq ($(LOCAL_PROTOC_OPTIMIZE_TYPE),stream)
19 # No library for stream protobufs
20 else
21 LOCAL_STATIC_JAVA_LIBRARIES += libprotobuf-java-lite
22 endif
Ulas Kirazcibde274e2013-03-28 14:02:14 -070023 endif
Ying Wanga5fc87a2010-11-02 18:43:16 -070024endif
25endif
26
Ying Wange295c3d2016-02-24 14:11:55 -080027# LOCAL_STATIC_JAVA_AAR_LIBRARIES and LOCAL_STATIC_ANDROID_LIBRARIES are also LOCAL_STATIC_JAVA_LIBRARIES.
28LOCAL_STATIC_JAVA_LIBRARIES := $(strip $(LOCAL_STATIC_JAVA_LIBRARIES) \
29 $(LOCAL_STATIC_JAVA_AAR_LIBRARIES) \
30 $(LOCAL_STATIC_ANDROID_LIBRARIES))
31# LOCAL_SHARED_ANDROID_LIBRARIES are also LOCAL_JAVA_LIBRARIES.
32LOCAL_JAVA_LIBRARIES := $(sort $(LOCAL_JAVA_LIBRARIES) $(LOCAL_SHARED_ANDROID_LIBRARIES))
The Android Open Source Project88b60792009-03-03 19:28:42 -080033
34LOCAL_BUILT_MODULE_STEM := $(strip $(LOCAL_BUILT_MODULE_STEM))
35ifeq ($(LOCAL_BUILT_MODULE_STEM),)
36$(error $(LOCAL_PATH): Target java template must define LOCAL_BUILT_MODULE_STEM)
37endif
38ifneq ($(filter classes-compiled.jar classes.jar,$(LOCAL_BUILT_MODULE_STEM)),)
39$(error LOCAL_BUILT_MODULE_STEM may not be "$(LOCAL_BUILT_MODULE_STEM)")
40endif
41
Joe Onoratoe334d252009-07-17 15:33:40 -040042
43##############################################################################
44# Define the intermediate targets before including base_rules so they get
45# the correct environment.
46##############################################################################
47
48intermediates := $(call local-intermediates-dir)
49intermediates.COMMON := $(call local-intermediates-dir,COMMON)
50
Ying Wang957fea52010-09-23 11:48:38 -070051ifeq ($(LOCAL_PROGUARD_ENABLED),disabled)
52LOCAL_PROGUARD_ENABLED :=
53endif
54
Nan Zhangb3ec5342017-08-31 21:43:04 +000055full_classes_turbine_jar := $(intermediates.COMMON)/classes-turbine.jar
56full_classes_header_jarjar := $(intermediates.COMMON)/classes-header-jarjar.jar
57full_classes_header_jar := $(intermediates.COMMON)/classes-header.jar
Colin Crossa6e87822017-12-20 17:33:01 -080058full_classes_compiled_jar := $(intermediates.COMMON)/classes-full-debug.jar
Colin Crossf8a49c52017-05-22 16:21:49 -070059full_classes_processed_jar := $(intermediates.COMMON)/classes-processed.jar
Colin Crossa6e87822017-12-20 17:33:01 -080060full_classes_jarjar_jar := $(intermediates.COMMON)/classes-jarjar.jar
Nan Zhang9bd54052017-09-13 13:13:53 -070061full_classes_combined_jar := $(intermediates.COMMON)/classes-combined.jar
Colin Crossa6e87822017-12-20 17:33:01 -080062built_dex_intermediate := $(intermediates.COMMON)/dex/classes.dex
Ying Wang957fea52010-09-23 11:48:38 -070063full_classes_stubs_jar := $(intermediates.COMMON)/stubs.jar
Colin Crossdfc45ec2017-05-26 15:22:02 -070064java_source_list_file := $(intermediates.COMMON)/java-source-list
Ying Wang957fea52010-09-23 11:48:38 -070065
Ying Wang37b82aa2013-08-28 17:28:36 -070066ifeq ($(LOCAL_MODULE_CLASS)$(LOCAL_SRC_FILES)$(LOCAL_STATIC_JAVA_LIBRARIES)$(LOCAL_SOURCE_FILES_ALL_GENERATED),APPS)
67# If this is an apk without any Java code (e.g. framework-res), we should skip compiling Java.
Ying Wang990cf5e2013-08-28 13:04:46 -070068full_classes_jar :=
69built_dex :=
70else
Ying Wang957fea52010-09-23 11:48:38 -070071full_classes_jar := $(intermediates.COMMON)/classes.jar
Ying Wang7b7929a2013-09-12 17:35:21 -070072built_dex := $(intermediates.COMMON)/classes.dex
Ying Wang990cf5e2013-08-28 13:04:46 -070073endif
Joe Onoratoe334d252009-07-17 15:33:40 -040074
75LOCAL_INTERMEDIATE_TARGETS += \
Nan Zhangb3ec5342017-08-31 21:43:04 +000076 $(full_classes_turbine_jar) \
Joe Onoratoe334d252009-07-17 15:33:40 -040077 $(full_classes_compiled_jar) \
Ying Wang957fea52010-09-23 11:48:38 -070078 $(full_classes_jarjar_jar) \
Ying Wang957fea52010-09-23 11:48:38 -070079 $(full_classes_jar) \
Nan Zhang9bd54052017-09-13 13:13:53 -070080 $(full_classes_combined_jar) \
Ying Wang957fea52010-09-23 11:48:38 -070081 $(built_dex_intermediate) \
Guang Zhu155afe32010-03-10 15:48:03 -080082 $(built_dex) \
Colin Crossdfc45ec2017-05-26 15:22:02 -070083 $(full_classes_stubs_jar) \
84 $(java_source_list_file)
Ying Wang957fea52010-09-23 11:48:38 -070085
Joe Onorato77dc0a52010-05-17 18:16:11 -070086LOCAL_INTERMEDIATE_SOURCE_DIR := $(intermediates.COMMON)/src
Joe Onoratoe334d252009-07-17 15:33:40 -040087
Ying Wang956dccc2015-08-28 11:47:03 -070088###########################################################
89## AIDL: Compile .aidl files to .java
90###########################################################
91aidl_sources := $(filter %.aidl,$(LOCAL_SRC_FILES))
Christopher Wileyd9205ba2016-06-23 16:44:47 -070092aidl_java_sources :=
Ying Wang956dccc2015-08-28 11:47:03 -070093
94ifneq ($(strip $(aidl_sources)),)
Ying Wang956dccc2015-08-28 11:47:03 -070095
96aidl_preprocess_import :=
97ifdef LOCAL_SDK_VERSION
Jeongik Chad05b57a2020-07-08 18:10:38 +090098ifneq ($(filter current system_current test_current core_current, $(LOCAL_SDK_VERSION)$(TARGET_BUILD_USE_PREBUILT_SDKS)),)
99 # LOCAL_SDK_VERSION is current and no TARGET_BUILD_USE_PREBUILT_SDKS
Colin Cross50bf3122019-04-18 12:06:27 -0700100 aidl_preprocess_import := $(FRAMEWORK_AIDL)
Ying Wang956dccc2015-08-28 11:47:03 -0700101else
Anton Hansson66d47b82018-04-27 14:11:17 +0100102 aidl_preprocess_import := $(call resolve-prebuilt-sdk-aidl-path,$(LOCAL_SDK_VERSION))
Ying Wang956dccc2015-08-28 11:47:03 -0700103endif # not current or system_current
104else
105# build against the platform.
106LOCAL_AIDL_INCLUDES += $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)
107endif # LOCAL_SDK_VERSION
Ying Wang956dccc2015-08-28 11:47:03 -0700108
Christopher Wileyd9205ba2016-06-23 16:44:47 -0700109$(foreach s,$(aidl_sources),\
Dan Willemsen4d995272017-09-29 17:37:31 -0700110 $(eval $(call define-aidl-java-rule,$(s),$(intermediates.COMMON)/aidl,aidl_java_sources)))
Shinichiro Hamaji2a0d1fe2016-01-28 16:10:00 +0900111$(foreach java,$(aidl_java_sources), \
112 $(call include-depfile,$(java:%.java=%.P),$(java)))
Ying Wang956dccc2015-08-28 11:47:03 -0700113
Christopher Wileyd9205ba2016-06-23 16:44:47 -0700114$(aidl_java_sources) : $(LOCAL_ADDITIONAL_DEPENDENCIES) $(aidl_preprocess_import)
115
Steven Morelande0c38892019-02-05 17:01:48 -0800116$(aidl_java_sources): PRIVATE_AIDL_FLAGS := $(addprefix -p,$(aidl_preprocess_import)) -I$(LOCAL_PATH) -I$(LOCAL_PATH)/src $(addprefix -I,$(LOCAL_AIDL_INCLUDES))
Christopher Wileydc9e2672016-06-24 13:13:52 -0700117$(aidl_java_sources): PRIVATE_MODULE := $(LOCAL_MODULE)
Christopher Wileyd9205ba2016-06-23 16:44:47 -0700118
Ying Wang956dccc2015-08-28 11:47:03 -0700119endif
120
Ying Wang956dccc2015-08-28 11:47:03 -0700121##########################################
122
Ying Wang1d977e32013-01-30 11:22:06 -0800123# All of the rules after full_classes_compiled_jar are very unlikely
124# to fail except for bugs in their respective tools. If you would
125# like to run these rules, add the "all" modifier goal to the make
126# command line.
Ying Wang447d6962015-09-01 19:12:05 -0700127ifndef LOCAL_CHECKED_MODULE
Jean-Philippe Lesot0fbc9ff2015-01-20 14:18:48 +0000128ifdef full_classes_jar
Colin Crossb17f2852017-04-27 13:34:02 -0700129LOCAL_CHECKED_MODULE := $(full_classes_compiled_jar)
Ying Wang990cf5e2013-08-28 13:04:46 -0700130endif
Yohann Rousselee572682015-08-18 19:18:18 +0200131endif
Ying Wang1d977e32013-01-30 11:22:06 -0800132
The Android Open Source Project88b60792009-03-03 19:28:42 -0800133#######################################
134include $(BUILD_SYSTEM)/base_rules.mk
135#######################################
136
Yasuhiro Matsudaff82e822015-09-04 16:23:49 +0900137###########################################################
138## logtags: emit java source
139###########################################################
140ifneq ($(strip $(logtags_sources)),)
141
Dan Willemsen4d995272017-09-29 17:37:31 -0700142logtags_java_sources := $(patsubst %.logtags,%.java,$(addprefix $(intermediates.COMMON)/logtags/, $(logtags_sources)))
Yasuhiro Matsudaff82e822015-09-04 16:23:49 +0900143logtags_sources := $(addprefix $(LOCAL_PATH)/, $(logtags_sources))
144
Shinichiro Hamajid3ce14c2016-03-29 03:29:21 +0900145$(logtags_java_sources): PRIVATE_MERGED_TAG := $(TARGET_OUT_COMMON_INTERMEDIATES)/all-event-log-tags.txt
Colin Crossfdea8932017-12-06 14:38:40 -0800146$(logtags_java_sources): $(intermediates.COMMON)/logtags/%.java: $(LOCAL_PATH)/%.logtags $(TARGET_OUT_COMMON_INTERMEDIATES)/all-event-log-tags.txt $(JAVATAGS) build/make/tools/event_log_tags.py
Yasuhiro Matsudaff82e822015-09-04 16:23:49 +0900147 $(transform-logtags-to-java)
148
149else
150logtags_java_sources :=
151endif
152
Ying Wang956dccc2015-08-28 11:47:03 -0700153##########################################
154java_sources := $(addprefix $(LOCAL_PATH)/, $(filter %.java,$(LOCAL_SRC_FILES))) $(aidl_java_sources) $(logtags_java_sources) \
155 $(filter %.java,$(LOCAL_GENERATED_SOURCES))
Nan Zhangad818dc2017-10-04 09:26:06 -0700156java_intermediate_sources := $(addprefix $(TARGET_OUT_COMMON_INTERMEDIATES)/, $(filter %.java,$(LOCAL_INTERMEDIATE_SOURCES)))
157all_java_sources := $(java_sources) $(java_intermediate_sources)
patricktub23d8e62018-10-05 14:55:36 +0800158ALL_MODULES.$(my_register_name).SRCS := $(ALL_MODULES.$(my_register_name).SRCS) $(all_java_sources)
Nan Zhangad818dc2017-10-04 09:26:06 -0700159
Ying Wang956dccc2015-08-28 11:47:03 -0700160include $(BUILD_SYSTEM)/java_common.mk
161
Anton Hansson7ff32d22018-02-21 15:29:44 +0000162include $(BUILD_SYSTEM)/sdk_check.mk
163
Narayan Kamathbbcdc072017-08-22 15:47:08 +0100164# Set the profile source so that the odex / profile code included from java.mk
165# can find it.
166#
167# TODO: b/64896089, this is broken when called from package_internal.mk, since the file
168# we preopt from is a temporary file. This will be addressed in a follow up, possibly
169# by disabling stripping for profile guided preopt (which may be desirable for other
170# reasons anyway).
171#
172# Note that we set this only when called from package_internal.mk and not in other cases.
173ifneq (,$(called_from_package_internal)
174dex_preopt_profile_src_file := $(LOCAL_BUILT_MODULE)
175endif
176
Brian Carlstromced4bff2013-11-14 23:44:56 -0800177#######################################
178# defines built_odex along with rule to install odex
Ulya Trafimovich2bf58772021-03-16 11:51:37 +0000179my_manifest_or_apk := $(full_android_manifest)
Brian Carlstromced4bff2013-11-14 23:44:56 -0800180include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk
Ulya Trafimovich2bf58772021-03-16 11:51:37 +0000181my_manifest_or_apk :=
Brian Carlstromced4bff2013-11-14 23:44:56 -0800182#######################################
183
Ying Wang990cf5e2013-08-28 13:04:46 -0700184# Make sure there's something to build.
185ifdef full_classes_jar
186ifndef need_compile_java
Jeff Gaston960acf12018-02-26 21:00:25 -0500187$(call pretty-error,Target java module does not define any source or resource files)
Ying Wang990cf5e2013-08-28 13:04:46 -0700188endif
189endif
190
The Android Open Source Project88b60792009-03-03 19:28:42 -0800191# Since we're using intermediates.COMMON, make sure that it gets cleaned
192# properly.
193$(cleantarget): PRIVATE_CLEAN_FILES += $(intermediates.COMMON)
194
Ying Wang990cf5e2013-08-28 13:04:46 -0700195ifdef full_classes_jar
The Android Open Source Project88b60792009-03-03 19:28:42 -0800196
Joe Onorato64d85d02009-04-09 19:31:12 -0700197# Droiddoc isn't currently able to generate stubs for modules, so we're just
198# allowing it to use the classes.jar as the "stubs" that would be use to link
199# against, for the cases where someone needs the jar to link against.
Colin Cross0e537342017-03-29 12:17:36 -0700200$(eval $(call copy-one-file,$(full_classes_jar),$(full_classes_stubs_jar)))
Yo Chiang58142472020-05-08 15:38:46 +0800201ALL_MODULES.$(my_register_name).STUBS := $(full_classes_stubs_jar)
Joe Onorato64d85d02009-04-09 19:31:12 -0700202
Joe Onorato0eccce92011-10-30 21:37:35 -0700203# The layers file allows you to enforce a layering between java packages.
Colin Crossfdea8932017-12-06 14:38:40 -0800204# Run build/make/tools/java-layers.py for more details.
Joe Onorato0eccce92011-10-30 21:37:35 -0700205layers_file := $(addprefix $(LOCAL_PATH)/, $(LOCAL_JAVA_LAYERS_FILE))
206$(full_classes_compiled_jar): PRIVATE_JAVA_LAYERS_FILE := $(layers_file)
Ying Wang057eba02012-10-18 10:54:49 -0700207$(full_classes_compiled_jar): PRIVATE_WARNINGS_ENABLE := $(LOCAL_WARNINGS_ENABLE)
Joe Onorato0eccce92011-10-30 21:37:35 -0700208
The Android Open Source Project88b60792009-03-03 19:28:42 -0800209# Compile the java files to a .jar file.
210# This intentionally depends on java_sources, not all_java_sources.
211# Deps for generated source files must be handled separately,
212# via deps on the target that generates the sources.
Paul Duffin3ca92982016-09-20 15:12:30 +0100213
Przemyslaw Szczepaniak2e81b3c2017-06-30 14:51:12 +0100214# For user / userdebug builds, strip the local variable table and the local variable
215# type table. This has no bearing on stack traces, but will leave less information
216# available via JDWP.
217ifneq (,$(PRODUCT_MINIMIZE_JAVA_DEBUG_INFO))
218ifneq (,$(filter userdebug user,$(TARGET_BUILD_VARIANT)))
219LOCAL_JAVACFLAGS+= -g:source,lines
Przemyslaw Szczepaniak2e81b3c2017-06-30 14:51:12 +0100220endif
221endif
222
Colin Crossdfc45ec2017-05-26 15:22:02 -0700223# List of dependencies for anything that needs all java sources in place
224java_sources_deps := \
225 $(java_sources) \
226 $(java_resource_sources) \
Colin Cross11e2d552018-03-07 15:44:54 -0800227 $(LOCAL_SRCJARS) \
Colin Crossdfc45ec2017-05-26 15:22:02 -0700228 $(LOCAL_ADDITIONAL_DEPENDENCIES)
229
Dan Willemsenc84e4cb2019-06-10 16:39:45 -0700230$(java_source_list_file): $(java_sources_deps) $(NORMALIZE_PATH)
Colin Crossdfc45ec2017-05-26 15:22:02 -0700231 $(write-java-source-list)
232
patricktuab435e32019-05-10 15:34:26 +0800233ALL_MODULES.$(my_register_name).SRCJARS := $(LOCAL_SRCJARS)
234
Colin Cross7dc90432017-09-26 16:17:24 -0700235ifneq ($(TURBINE_ENABLED),false)
236
Nan Zhangb3ec5342017-08-31 21:43:04 +0000237$(full_classes_turbine_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags)
Colin Cross11e2d552018-03-07 15:44:54 -0800238$(full_classes_turbine_jar): PRIVATE_SRCJARS := $(LOCAL_SRCJARS)
Nan Zhangb3ec5342017-08-31 21:43:04 +0000239$(full_classes_turbine_jar): \
240 $(java_source_list_file) \
241 $(java_sources_deps) \
242 $(full_java_header_libs) \
Colin Cross1d1e5ef2017-09-23 18:19:05 -0700243 $(full_java_bootclasspath_libs) \
Colin Crossf9602572017-10-12 13:34:40 -0700244 $(full_java_system_modules_deps) \
Nan Zhangb3ec5342017-08-31 21:43:04 +0000245 $(NORMALIZE_PATH) \
246 $(JAR_ARGS) \
247 $(ZIPTIME) \
Nan Zhang9bd54052017-09-13 13:13:53 -0700248 | $(TURBINE) \
249 $(MERGE_ZIPS)
Nan Zhangb3ec5342017-08-31 21:43:04 +0000250 $(transform-java-to-header.jar)
251
252.KATI_RESTAT: $(full_classes_turbine_jar)
253
254# Run jarjar before generate classes-header.jar if necessary.
255ifneq ($(strip $(LOCAL_JARJAR_RULES)),)
256$(full_classes_header_jarjar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)
257$(full_classes_header_jarjar): $(full_classes_turbine_jar) $(LOCAL_JARJAR_RULES) | $(JARJAR)
Colin Crossa1271eb2021-02-08 10:55:05 -0800258 $(call transform-jarjar)
Nan Zhangb3ec5342017-08-31 21:43:04 +0000259else
260full_classes_header_jarjar := $(full_classes_turbine_jar)
261endif
262
263$(eval $(call copy-one-file,$(full_classes_header_jarjar),$(full_classes_header_jar)))
264
Colin Cross7dc90432017-09-26 16:17:24 -0700265endif # TURBINE_ENABLED != false
266
Colin Cross28ff3e32020-03-05 12:41:30 -0800267# TODO(b/143658984): goma can't handle the --system argument to javac.
268#$(full_classes_compiled_jar): .KATI_NINJA_POOL := $(GOMA_POOL)
Colin Cross24575c42022-04-08 10:52:08 -0700269$(full_classes_compiled_jar): .KATI_NINJA_POOL := $(JAVAC_NINJA_POOL)
Colin Cross5ef6e792018-03-07 14:16:43 -0800270$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags)
271$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_FILES := $(LOCAL_JAR_EXCLUDE_FILES)
272$(full_classes_compiled_jar): PRIVATE_JAR_PACKAGES := $(LOCAL_JAR_PACKAGES)
273$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_PACKAGES := $(LOCAL_JAR_EXCLUDE_PACKAGES)
Colin Cross5ef6e792018-03-07 14:16:43 -0800274$(full_classes_compiled_jar): PRIVATE_JAVA_SOURCE_LIST := $(java_source_list_file)
275$(full_classes_compiled_jar): PRIVATE_ALL_JAVA_HEADER_LIBRARIES := $(full_java_header_libs)
Colin Cross11e2d552018-03-07 15:44:54 -0800276$(full_classes_compiled_jar): PRIVATE_SRCJARS := $(LOCAL_SRCJARS)
277$(full_classes_compiled_jar): PRIVATE_SRCJAR_LIST_FILE := $(intermediates.COMMON)/srcjar-list
278$(full_classes_compiled_jar): PRIVATE_SRCJAR_INTERMEDIATES_DIR := $(intermediates.COMMON)/srcjars
Colin Cross5ef6e792018-03-07 14:16:43 -0800279$(full_classes_compiled_jar): \
280 $(java_source_list_file) \
281 $(full_java_header_libs) \
282 $(java_sources_deps) \
283 $(full_java_bootclasspath_libs) \
284 $(full_java_system_modules_deps) \
285 $(layers_file) \
286 $(annotation_processor_deps) \
287 $(NORMALIZE_PATH) \
288 $(JAR_ARGS) \
Colin Cross3f99cd52018-03-15 16:26:08 -0700289 $(ZIPSYNC) \
Kousik Kumar7d611162020-04-16 12:43:40 -0700290 $(SOONG_ZIP) \
Colin Cross5ef6e792018-03-07 14:16:43 -0800291 | $(SOONG_JAVAC_WRAPPER)
292 @echo "Target Java: $@
293 $(call compile-java,$(TARGET_JAVAC),$(PRIVATE_ALL_JAVA_HEADER_LIBRARIES))
294
Ying Wangcddeb6c2016-03-24 11:00:30 -0700295javac-check : $(full_classes_compiled_jar)
Paul Duffin32bd0ad2016-09-15 14:34:42 +0100296javac-check-$(LOCAL_MODULE) : $(full_classes_compiled_jar)
Dan Willemsen7a1da0e2018-07-24 01:21:12 -0700297.PHONY: javac-check-$(LOCAL_MODULE)
Ying Wangcddeb6c2016-03-24 11:00:30 -0700298
Nan Zhang9bd54052017-09-13 13:13:53 -0700299$(full_classes_combined_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
300$(full_classes_combined_jar): $(full_classes_compiled_jar) \
Nan Zhangb8801172017-09-20 14:56:48 -0700301 $(jar_manifest_file) \
Nan Zhang9bd54052017-09-13 13:13:53 -0700302 $(full_static_java_libs) | $(MERGE_ZIPS)
Nan Zhangb8801172017-09-20 14:56:48 -0700303 $(if $(PRIVATE_JAR_MANIFEST), $(hide) sed -e "s/%BUILD_NUMBER%/$(BUILD_NUMBER_FROM_FILE)/" \
304 $(PRIVATE_JAR_MANIFEST) > $(dir $@)/manifest.mf)
Colin Cross5b73ab32018-02-14 10:32:48 -0800305 $(MERGE_ZIPS) -j --ignore-duplicates $(if $(PRIVATE_JAR_MANIFEST),-m $(dir $@)/manifest.mf) \
Nan Zhangb8801172017-09-20 14:56:48 -0700306 $(if $(PRIVATE_DONT_DELETE_JAR_META_INF),,-stripDir META-INF -zipToNotStrip $<) \
Colin Cross91f53fd2019-04-29 10:25:20 -0700307 $@ $< $(PRIVATE_STATIC_JAVA_LIBRARIES)
Nan Zhang9bd54052017-09-13 13:13:53 -0700308
Colin Crossf8a49c52017-05-22 16:21:49 -0700309ifdef LOCAL_JAR_PROCESSOR
310# LOCAL_JAR_PROCESSOR_ARGS must be evaluated here to set up the rule-local
311# PRIVATE_JAR_PROCESSOR_ARGS variable, but $< and $@ are not available yet.
312# Set ${in} and ${out} so they can be referenced by LOCAL_JAR_PROCESSOR_ARGS
313# using deferred evaluation (LOCAL_JAR_PROCESSOR_ARGS = instead of :=).
Nan Zhang9bd54052017-09-13 13:13:53 -0700314in := $(full_classes_combined_jar)
Colin Crossf8a49c52017-05-22 16:21:49 -0700315out := $(full_classes_processed_jar).tmp
Colin Cross89b802b2017-07-13 19:25:47 -0700316my_jar_processor := $(HOST_OUT_JAVA_LIBRARIES)/$(LOCAL_JAR_PROCESSOR).jar
317
Colin Crossf8a49c52017-05-22 16:21:49 -0700318$(full_classes_processed_jar): PRIVATE_JAR_PROCESSOR_ARGS := $(LOCAL_JAR_PROCESSOR_ARGS)
Colin Cross89b802b2017-07-13 19:25:47 -0700319$(full_classes_processed_jar): PRIVATE_JAR_PROCESSOR := $(my_jar_processor)
Colin Crossf8a49c52017-05-22 16:21:49 -0700320$(full_classes_processed_jar): PRIVATE_TMP_OUT := $(out)
321in :=
322out :=
323
Nan Zhang9bd54052017-09-13 13:13:53 -0700324$(full_classes_processed_jar): $(full_classes_combined_jar) $(my_jar_processor)
Colin Crossf8a49c52017-05-22 16:21:49 -0700325 @echo Processing $@ with $(PRIVATE_JAR_PROCESSOR)
326 $(hide) rm -f $@ $(PRIVATE_TMP_OUT)
Colin Cross0851df82017-06-30 13:55:38 -0700327 $(hide) $(JAVA) -jar $(PRIVATE_JAR_PROCESSOR) $(PRIVATE_JAR_PROCESSOR_ARGS)
Colin Crossf8a49c52017-05-22 16:21:49 -0700328 $(hide) mv $(PRIVATE_TMP_OUT) $@
329
Colin Cross89b802b2017-07-13 19:25:47 -0700330my_jar_processor :=
Colin Crossf8a49c52017-05-22 16:21:49 -0700331else
Nan Zhang9bd54052017-09-13 13:13:53 -0700332full_classes_processed_jar := $(full_classes_combined_jar)
Colin Crossf8a49c52017-05-22 16:21:49 -0700333endif
334
Nan Zhang870025f2017-09-13 14:56:11 -0700335# Run jarjar if necessary
336ifneq ($(strip $(LOCAL_JARJAR_RULES)),)
337$(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)
338$(full_classes_jarjar_jar): $(full_classes_processed_jar) $(LOCAL_JARJAR_RULES) | $(JARJAR)
Colin Crossa1271eb2021-02-08 10:55:05 -0800339 $(call transform-jarjar)
Nan Zhang870025f2017-09-13 14:56:11 -0700340else
341full_classes_jarjar_jar := $(full_classes_processed_jar)
342endif
343
Jeff Gastondb6557e2018-02-27 14:05:40 -0500344$(eval $(call copy-one-file,$(full_classes_jarjar_jar),$(full_classes_jar)))
Colin Cross96873482017-12-22 16:51:23 -0800345
346#######################################
Jeff Gastond2ba7242018-01-31 17:34:07 -0500347LOCAL_FULL_CLASSES_PRE_JACOCO_JAR := $(full_classes_jar)
348
Colin Cross96873482017-12-22 16:51:23 -0800349include $(BUILD_SYSTEM)/jacoco.mk
350#######################################
351
Tobias Thierer7ef760b2017-11-17 13:02:12 +0000352# Temporarily enable --multi-dex until proguard supports v53 class files
353# ( http://b/67673860 ) or we move away from proguard altogether.
Tobias Thierer89740662017-10-25 02:38:01 +0100354LOCAL_DX_FLAGS := $(filter-out --multi-dex,$(LOCAL_DX_FLAGS)) --multi-dex
Tobias Thierer89740662017-10-25 02:38:01 +0100355
Colin Crosscf010852018-06-06 21:46:25 +0000356full_classes_pre_proguard_jar := $(LOCAL_FULL_CLASSES_JACOCO_JAR)
Ying Wang3b2bdf12010-02-01 09:51:23 -0800357
Colin Cross950f1ef2017-04-05 15:30:42 -0700358# Keep a copy of the jar just before proguard processing.
359$(eval $(call copy-one-file,$(full_classes_pre_proguard_jar),$(intermediates.COMMON)/classes-pre-proguard.jar))
Shinichiro Hamaji89b255a2015-11-09 16:47:42 +0900360
Colin Cross0e537342017-03-29 12:17:36 -0700361# Run proguard if necessary
Ying Wang7311a342013-08-21 18:32:49 -0700362ifdef LOCAL_PROGUARD_ENABLED
Colin Crosse616f342017-12-28 09:43:41 -0800363ifneq ($(filter-out full custom obfuscation optimization,$(LOCAL_PROGUARD_ENABLED)),)
Ying Wang7311a342013-08-21 18:32:49 -0700364 $(warning while processing: $(LOCAL_MODULE))
365 $(error invalid value for LOCAL_PROGUARD_ENABLED: $(LOCAL_PROGUARD_ENABLED))
366endif
Joe Onorato2daa2b32009-08-30 13:39:24 -0700367proguard_dictionary := $(intermediates.COMMON)/proguard_dictionary
Søren Gjesse9fbdd9e2018-04-13 15:34:20 +0200368proguard_configuration := $(intermediates.COMMON)/proguard_configuration
Ying Wang4f5d0e62015-05-04 19:21:48 -0700369
Colin Crossb5f25a22017-10-20 19:16:41 -0700370# When an app contains references to APIs that are not in the SDK specified by
Anton Hansson400673c2018-04-10 16:16:33 +0100371# its LOCAL_SDK_VERSION for example added by support library or by runtime
Colin Crossb5f25a22017-10-20 19:16:41 -0700372# classes added by desugar, we artifically raise the "SDK version" "linked" by
373# ProGuard, to
Ying Wang4f5d0e62015-05-04 19:21:48 -0700374# - suppress ProGuard warnings of referencing symbols unknown to the lower SDK version.
375# - prevent ProGuard stripping subclass in the support library that extends class added in the higher SDK version.
Colin Crossb5f25a22017-10-20 19:16:41 -0700376# See b/20667396
377my_proguard_sdk_raise :=
Ying Wang4f5d0e62015-05-04 19:21:48 -0700378ifdef LOCAL_SDK_VERSION
Ying Wang4f5d0e62015-05-04 19:21:48 -0700379ifdef TARGET_BUILD_APPS
Jiyong Park5ebca302018-01-31 00:14:55 +0900380ifeq (,$(filter current system_current test_current core_current, $(LOCAL_SDK_VERSION)))
Anton Hansson400673c2018-04-10 16:16:33 +0100381 my_proguard_sdk_raise := $(call java-lib-header-files, $(call resolve-prebuilt-sdk-module,current))
Ying Wang742f5832015-06-26 12:33:06 -0700382endif
Ying Wang4f5d0e62015-05-04 19:21:48 -0700383else
384 # For platform build, we can't just raise to the "current" SDK,
385 # that would break apps that use APIs removed from the current SDK.
Pete Gillin38294752020-07-01 12:44:12 +0100386 my_proguard_sdk_raise := $(call java-lib-header-files,$(LEGACY_CORE_PLATFORM_BOOTCLASSPATH_LIBRARIES) $(FRAMEWORK_LIBRARIES))
Ying Wang4f5d0e62015-05-04 19:21:48 -0700387endif
Jiyong Parkeadd1bd2019-04-03 22:22:37 +0900388ifdef BOARD_SYSTEMSDK_VERSIONS
389ifneq (,$(filter true,$(LOCAL_VENDOR_MODULE) $(LOCAL_ODM_MODULE) $(LOCAL_PROPRIETARY_MODULE)))
390 # But for vendor or odm apks, don't raise SDK as the apks are required to
391 # use SDK APIs only
392 my_proguard_sdk_raise :=
393endif
394endif
Ying Wang4f5d0e62015-05-04 19:21:48 -0700395endif
Ying Wang4f5d0e62015-05-04 19:21:48 -0700396
Colin Cross3ebfe732018-07-25 13:41:42 -0700397legacy_proguard_flags := $(addprefix -libraryjars ,$(my_proguard_sdk_raise) \
Colin Crossb5f25a22017-10-20 19:16:41 -0700398 $(filter-out $(my_proguard_sdk_raise), \
Colin Crossb541aae2017-09-23 19:52:43 -0700399 $(full_java_bootclasspath_libs) \
400 $(full_shared_java_header_libs)))
Nan Zhangb3ec5342017-08-31 21:43:04 +0000401
Colin Crossb5f25a22017-10-20 19:16:41 -0700402legacy_proguard_lib_deps := $(my_proguard_sdk_raise) \
Dan Willemsenf14179b2019-06-12 21:18:31 +0000403 $(filter-out $(my_proguard_sdk_raise),$(full_java_bootclasspath_libs) $(full_shared_java_header_libs))
Yohann Rousselb7de0fb2015-11-03 18:33:21 +0100404
405legacy_proguard_flags += -printmapping $(proguard_dictionary)
Søren Gjesse9fbdd9e2018-04-13 15:34:20 +0200406legacy_proguard_flags += -printconfiguration $(proguard_configuration)
Yohann Rousselb7de0fb2015-11-03 18:33:21 +0100407
Colin Cross2a406722019-12-13 16:23:11 -0800408common_proguard_flags :=
Colin Crosse616f342017-12-28 09:43:41 -0800409common_proguard_flag_files := $(BUILD_SYSTEM)/proguard.flags
Ying Wang7311a342013-08-21 18:32:49 -0700410ifneq ($(LOCAL_INSTRUMENTATION_FOR)$(filter tests,$(LOCAL_MODULE_TAGS)),)
Yohann Rousselb4c49cb2014-09-08 14:45:14 +0200411common_proguard_flags += -dontshrink # don't shrink tests by default
Ying Wang3b2bdf12010-02-01 09:51:23 -0800412endif # test package
Dan Willemsen1417c172017-11-17 13:11:26 -0800413ifneq ($(LOCAL_PROGUARD_ENABLED),custom)
Colin Crosse6210f62019-02-25 22:21:24 -0800414 common_proguard_flag_files += $(foreach l,$(LOCAL_STATIC_ANDROID_LIBRARIES),\
415 $(call intermediates-dir-for,JAVA_LIBRARIES,$(l),,COMMON)/export_proguard_flags)
Dan Willemsen1417c172017-11-17 13:11:26 -0800416endif
Shinichiro Hamaji4eaeef82016-04-07 18:56:42 +0900417ifneq ($(common_proguard_flag_files),)
418common_proguard_flags += $(addprefix -include , $(common_proguard_flag_files))
419# This is included from $(BUILD_SYSTEM)/proguard.flags
420common_proguard_flag_files += $(BUILD_SYSTEM)/proguard_basic_keeps.flags
421endif
422
Ying Wang7311a342013-08-21 18:32:49 -0700423ifeq ($(filter obfuscation,$(LOCAL_PROGUARD_ENABLED)),)
424# By default no obfuscation
Yohann Rousselb4c49cb2014-09-08 14:45:14 +0200425common_proguard_flags += -dontobfuscate
Ying Wang7311a342013-08-21 18:32:49 -0700426endif # No obfuscation
427ifeq ($(filter optimization,$(LOCAL_PROGUARD_ENABLED)),)
428# By default no optimization
Yohann Rousselb4c49cb2014-09-08 14:45:14 +0200429common_proguard_flags += -dontoptimize
Ying Wang7311a342013-08-21 18:32:49 -0700430endif # No optimization
Ying Wang3b2bdf12010-02-01 09:51:23 -0800431
Ying Wang7311a342013-08-21 18:32:49 -0700432ifdef LOCAL_INSTRUMENTATION_FOR
433ifeq ($(filter obfuscation,$(LOCAL_PROGUARD_ENABLED)),)
434# If no obfuscation, link in the instrmented package's classes.jar as a library.
435# link_instr_classes_jar is defined in base_rule.mk
Yohann Rousselb4c49cb2014-09-08 14:45:14 +0200436legacy_proguard_flags += -libraryjars $(link_instr_classes_jar)
Nan Zhangb3ec5342017-08-31 21:43:04 +0000437legacy_proguard_lib_deps += $(link_instr_classes_jar)
Ying Wang7311a342013-08-21 18:32:49 -0700438else # obfuscation
439# If obfuscation is enabled, the main app must be obfuscated too.
440# We need to run obfuscation using the main app's dictionary,
441# and treat the main app's class.jar as injars instead of libraryjars.
Yohann Rousselb4c49cb2014-09-08 14:45:14 +0200442legacy_proguard_flags := -injars $(link_instr_classes_jar) \
Ying Wang7311a342013-08-21 18:32:49 -0700443 -outjars $(intermediates.COMMON)/proguard.$(LOCAL_INSTRUMENTATION_FOR).jar \
444 -include $(link_instr_intermediates_dir.COMMON)/proguard_options \
445 -applymapping $(link_instr_intermediates_dir.COMMON)/proguard_dictionary \
446 -verbose \
Yohann Rousselb4c49cb2014-09-08 14:45:14 +0200447 $(legacy_proguard_flags)
Colin Crossfcb441b2018-07-25 13:40:05 -0700448legacy_proguard_lib_deps += \
449 $(link_instr_classes_jar) \
450 $(link_instr_intermediates_dir.COMMON)/proguard_options \
451 $(link_instr_intermediates_dir.COMMON)/proguard_dictionary \
Ying Wang7311a342013-08-21 18:32:49 -0700452
453# Sometimes (test + main app) uses different keep rules from the main app -
454# apply the main app's dictionary anyway.
Yohann Rousselb4c49cb2014-09-08 14:45:14 +0200455legacy_proguard_flags += -ignorewarnings
Ying Wang7311a342013-08-21 18:32:49 -0700456
Ying Wang7311a342013-08-21 18:32:49 -0700457endif # no obfuscation
458endif # LOCAL_INSTRUMENTATION_FOR
Joe Onorato2daa2b32009-08-30 13:39:24 -0700459
Ying Wang0b9382c2010-09-29 14:50:41 -0700460proguard_flag_files := $(addprefix $(LOCAL_PATH)/, $(LOCAL_PROGUARD_FLAG_FILES))
Søren Gjesse0c1fe642017-10-12 16:09:13 +0200461proguard_flag_files += $(addprefix $(LOCAL_PATH)/, $(LOCAL_R8_FLAG_FILES))
Ying Wang0b9382c2010-09-29 14:50:41 -0700462LOCAL_PROGUARD_FLAGS += $(addprefix -include , $(proguard_flag_files))
Dan Willemsen829abae2019-08-09 09:14:45 -0700463LOCAL_PROGUARD_FLAGS_DEPS += $(proguard_flag_files)
464proguard_flag_files :=
Ying Wang0b9382c2010-09-29 14:50:41 -0700465
Mihail Dumitrescu4df82b32014-02-07 15:18:59 +0000466ifdef LOCAL_TEST_MODULE_TO_PROGUARD_WITH
467extra_input_jar := $(call intermediates-dir-for,APPS,$(LOCAL_TEST_MODULE_TO_PROGUARD_WITH),,COMMON)/classes.jar
468else
469extra_input_jar :=
470endif
Paul Duffinf22aca12017-02-21 13:11:13 +0000471
Dan Willemsenbdd6a752017-09-25 23:36:19 -0700472ifneq ($(filter obfuscation,$(LOCAL_PROGUARD_ENABLED)),)
Søren Gjesse9fbdd9e2018-04-13 15:34:20 +0200473 $(built_dex_intermediate): .KATI_IMPLICIT_OUTPUTS := $(proguard_dictionary) $(proguard_configuration)
Colin Cross330b1fe2021-04-06 18:04:06 -0700474
475 # Make a rule to copy the proguard_dictionary to a packaging directory.
476 $(eval $(call copy-one-file,$(proguard_dictionary),\
477 $(call local-packaging-dir,proguard_dictionary)/proguard_dictionary))
478 $(call add-dependency,$(LOCAL_BUILT_MODULE),\
479 $(call local-packaging-dir,proguard_dictionary)/proguard_dictionary)
480
481 $(eval $(call copy-one-file,$(full_classes_pre_proguard_jar),\
482 $(call local-packaging-dir,proguard_dictionary)/classes.jar))
483 $(call add-dependency,$(LOCAL_BUILT_MODULE),\
484 $(call local-packaging-dir,proguard_dictionary)/classes.jar)
Søren Gjesse4ab5b022017-10-25 17:10:59 +0200485endif
Ying Wang3b2bdf12010-02-01 09:51:23 -0800486
Ying Wang7311a342013-08-21 18:32:49 -0700487endif # LOCAL_PROGUARD_ENABLED defined
488
Colin Cross96476c12017-04-06 09:56:19 -0700489ifneq ($(LOCAL_IS_STATIC_JAVA_LIBRARY),true)
Colin Cross79e2f732016-12-21 14:29:13 -0800490$(built_dex_intermediate): PRIVATE_DX_FLAGS := $(LOCAL_DX_FLAGS)
Søren Gjesse0c1fe642017-10-12 16:09:13 +0200491
Søren Gjesse0c1fe642017-10-12 16:09:13 +0200492ifdef LOCAL_PROGUARD_ENABLED
Colin Cross24575c42022-04-08 10:52:08 -0700493 $(built_dex_intermediate): .KATI_NINJA_POOL := $(R8_NINJA_POOL)
Colin Cross3ebfe732018-07-25 13:41:42 -0700494 $(built_dex_intermediate): PRIVATE_EXTRA_INPUT_JAR := $(extra_input_jar)
495 $(built_dex_intermediate): PRIVATE_PROGUARD_FLAGS := $(legacy_proguard_flags) $(common_proguard_flags) $(LOCAL_PROGUARD_FLAGS)
Søren Gjesseb2293432018-08-23 11:17:17 +0200496 $(built_dex_intermediate): PRIVATE_PROGUARD_DICTIONARY := $(proguard_dictionary)
Dan Willemsen829abae2019-08-09 09:14:45 -0700497 $(built_dex_intermediate) : $(full_classes_pre_proguard_jar) $(extra_input_jar) $(my_proguard_sdk_raise) $(common_proguard_flag_files) $(legacy_proguard_lib_deps) $(R8_COMPAT_PROGUARD) $(LOCAL_PROGUARD_FLAGS_DEPS)
Søren Gjesse0c1fe642017-10-12 16:09:13 +0200498 $(transform-jar-to-dex-r8)
Colin Cross3ebfe732018-07-25 13:41:42 -0700499else # !LOCAL_PROGUARD_ENABLED
Colin Cross24575c42022-04-08 10:52:08 -0700500 $(built_dex_intermediate): .KATI_NINJA_POOL := $(D8_NINJA_POOL)
Colin Crossec17af32018-09-21 12:36:53 -0700501 $(built_dex_intermediate): PRIVATE_D8_LIBS := $(full_java_bootclasspath_libs) $(full_shared_java_header_libs)
502 $(built_dex_intermediate): $(full_java_bootclasspath_libs) $(full_shared_java_header_libs)
Colin Cross3ebfe732018-07-25 13:41:42 -0700503 $(built_dex_intermediate): $(full_classes_pre_proguard_jar) $(DX) $(ZIP2ZIP)
Colin Cross79e2f732016-12-21 14:29:13 -0800504 $(transform-classes.jar-to-dex)
Søren Gjesse0c1fe642017-10-12 16:09:13 +0200505endif
Colin Cross79e2f732016-12-21 14:29:13 -0800506
Ulya Trafimovich4c69c2f2020-04-30 10:59:48 +0100507$(foreach pair,$(PRODUCT_BOOT_JARS), \
508 $(if $(filter $(LOCAL_MODULE),$(call word-colon,2,$(pair))), \
509 $(call pretty-error,Modules in PRODUCT_BOOT_JARS must be defined in Android.bp files)))
David Brazdilb8fa6dd2018-01-29 14:43:14 +0000510
Colin Cross485c9cd2019-02-04 15:28:51 -0800511$(built_dex): $(built_dex_intermediate)
Guang Zhu155afe32010-03-10 15:48:03 -0800512 @echo Copying: $@
Yohann Roussel8ffe9c32013-08-20 17:05:27 +0200513 $(hide) mkdir -p $(dir $@)
514 $(hide) rm -f $(dir $@)/classes*.dex
Colin Cross0e537342017-03-29 12:17:36 -0700515 $(hide) cp -fp $(dir $<)/classes*.dex $(dir $@)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800516
Colin Cross9eff8302017-04-27 15:05:44 -0700517java-dex: $(built_dex)
518
Colin Cross96476c12017-04-06 09:56:19 -0700519endif # !LOCAL_IS_STATIC_JAVA_LIBRARY
520
The Android Open Source Project88b60792009-03-03 19:28:42 -0800521findbugs_xml := $(intermediates.COMMON)/findbugs.xml
Ying Wang702e01e2015-10-21 10:30:51 -0700522$(findbugs_xml): PRIVATE_AUXCLASSPATH := $(addprefix -auxclasspath ,$(strip \
523 $(call normalize-path-list,$(filter %.jar,$(full_java_libs)))))
524$(findbugs_xml): PRIVATE_FINDBUGS_FLAGS := $(LOCAL_FINDBUGS_FLAGS)
Colin Cross950f1ef2017-04-05 15:30:42 -0700525$(findbugs_xml) : $(full_classes_pre_proguard_jar) $(filter %.xml, $(LOCAL_FINDBUGS_FLAGS))
The Android Open Source Project88b60792009-03-03 19:28:42 -0800526 @echo Findbugs: $@
527 $(hide) $(FINDBUGS) -textui -effort:min -xml:withMessages \
Ying Wang702e01e2015-10-21 10:30:51 -0700528 $(PRIVATE_AUXCLASSPATH) $(PRIVATE_FINDBUGS_FLAGS) \
Yohann Rousseld2a76c12015-02-05 16:10:58 +0100529 $< \
The Android Open Source Project88b60792009-03-03 19:28:42 -0800530 > $@
531
532ALL_FINDBUGS_FILES += $(findbugs_xml)
533
534findbugs_html := $(PRODUCT_OUT)/findbugs/$(LOCAL_MODULE).html
535$(findbugs_html) : PRIVATE_XML_FILE := $(findbugs_xml)
536$(LOCAL_MODULE)-findbugs : $(findbugs_html)
Dan Willemsen7a1da0e2018-07-24 01:21:12 -0700537.PHONY: $(LOCAL_MODULE)-findbugs
The Android Open Source Project88b60792009-03-03 19:28:42 -0800538$(findbugs_html) : $(findbugs_xml)
539 @mkdir -p $(dir $@)
Andrew Stadlercef9ed92009-05-13 00:44:59 -0700540 @echo ConvertXmlToText: $@
Yuncheol Heo623d7062014-05-20 17:04:16 +0900541 $(hide) $(FINDBUGS_DIR)/convertXmlToText -html:fancy.xsl $(PRIVATE_XML_FILE) \
The Android Open Source Project88b60792009-03-03 19:28:42 -0800542 > $@
543
544$(LOCAL_MODULE)-findbugs : $(findbugs_html)
545
Ying Wang990cf5e2013-08-28 13:04:46 -0700546endif # full_classes_jar is defined
Yohann Rousselb4c49cb2014-09-08 14:45:14 +0200547
Colin Crossa27f42a2019-02-06 15:40:03 -0800548$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_DEFAULT_APP_TARGET_SDK := $(call module-target-sdk-version)
549$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_SDK_VERSION := $(call module-sdk-version)
550$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_MIN_SDK_VERSION := $(call codename-or-sdk-to-sdk,$(call module-min-sdk-version))