Narayan Kamath | 0dd273a | 2013-10-28 13:20:52 +0000 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2013 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 | # Rules for building a host dalvik java library. These libraries |
| 19 | # are meant to be used by a dalvik VM instance running on the host. |
| 20 | # They will be compiled against libcore and not the host JRE. |
| 21 | # |
| 22 | |
Ying Wang | 0757768 | 2015-01-26 09:52:28 -0800 | [diff] [blame] | 23 | ifeq ($(HOST_OS),linux) |
Narayan Kamath | 0dd273a | 2013-10-28 13:20:52 +0000 | [diff] [blame] | 24 | USE_CORE_LIB_BOOTCLASSPATH := true |
| 25 | |
| 26 | ####################################### |
| 27 | include $(BUILD_SYSTEM)/host_java_library_common.mk |
| 28 | ####################################### |
| 29 | |
| 30 | ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) |
Brian Carlstrom | b1dafb1 | 2014-06-18 15:11:01 -0700 | [diff] [blame] | 31 | LOCAL_JAVA_LIBRARIES += core-libart-hostdex |
Narayan Kamath | 0dd273a | 2013-10-28 13:20:52 +0000 | [diff] [blame] | 32 | endif |
| 33 | |
| 34 | full_classes_compiled_jar := $(intermediates.COMMON)/classes-full-debug.jar |
| 35 | full_classes_jarjar_jar := $(intermediates.COMMON)/classes-jarjar.jar |
| 36 | full_classes_jar := $(intermediates.COMMON)/classes.jar |
| 37 | built_dex := $(intermediates.COMMON)/classes.dex |
| 38 | |
| 39 | LOCAL_INTERMEDIATE_TARGETS += \ |
| 40 | $(full_classes_compiled_jar) \ |
| 41 | $(full_classes_jarjar_jar) \ |
| 42 | $(full_classes_jar) \ |
| 43 | $(built_dex) |
| 44 | |
| 45 | # See comment in java.mk |
| 46 | java_alternative_checked_module := $(full_classes_compiled_jar) |
| 47 | |
| 48 | ####################################### |
| 49 | include $(BUILD_SYSTEM)/base_rules.mk |
| 50 | ####################################### |
| 51 | |
| 52 | $(full_classes_compiled_jar): PRIVATE_JAVAC_DEBUG_FLAGS := -g |
| 53 | |
| 54 | java_alternative_checked_module := |
| 55 | |
| 56 | # The layers file allows you to enforce a layering between java packages. |
| 57 | # Run build/tools/java-layers.py for more details. |
| 58 | layers_file := $(addprefix $(LOCAL_PATH)/, $(LOCAL_JAVA_LAYERS_FILE)) |
| 59 | |
| 60 | $(LOCAL_INTERMEDIATE_TARGETS): \ |
| 61 | PRIVATE_CLASS_INTERMEDIATES_DIR := $(intermediates.COMMON)/classes |
| 62 | $(LOCAL_INTERMEDIATE_TARGETS): \ |
| 63 | PRIVATE_SOURCE_INTERMEDIATES_DIR := $(LOCAL_INTERMEDIATE_SOURCE_DIR) |
| 64 | |
| 65 | $(cleantarget): PRIVATE_CLEAN_FILES += $(intermediates.COMMON) |
| 66 | |
| 67 | $(full_classes_compiled_jar): PRIVATE_JAVA_LAYERS_FILE := $(layers_file) |
| 68 | $(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) |
| 69 | $(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_FILES := |
| 70 | $(full_classes_compiled_jar): PRIVATE_JAR_PACKAGES := |
Jeff Brown | 4c4aa99 | 2014-05-23 18:41:19 -0700 | [diff] [blame] | 71 | $(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_PACKAGES := |
Narayan Kamath | 0dd273a | 2013-10-28 13:20:52 +0000 | [diff] [blame] | 72 | $(full_classes_compiled_jar): PRIVATE_RMTYPEDEFS := |
Dan Albert | 954b5bd | 2014-11-08 22:20:03 -0800 | [diff] [blame] | 73 | $(full_classes_compiled_jar): \ |
| 74 | $(java_sources) \ |
| 75 | $(java_resource_sources) \ |
| 76 | $(full_java_lib_deps) \ |
| 77 | $(jar_manifest_file) \ |
| 78 | $(proto_java_sources_file_stamp) \ |
| 79 | $(LOCAL_MODULE_MAKEFILE) \ |
| 80 | $(LOCAL_ADDITIONAL_DEPENDENCIES) |
Narayan Kamath | 0dd273a | 2013-10-28 13:20:52 +0000 | [diff] [blame] | 81 | $(transform-host-java-to-package) |
| 82 | |
| 83 | # Run jarjar if necessary, otherwise just copy the file. |
| 84 | ifneq ($(strip $(LOCAL_JARJAR_RULES)),) |
| 85 | $(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES) |
| 86 | $(full_classes_jarjar_jar): $(full_classes_compiled_jar) $(LOCAL_JARJAR_RULES) | $(JARJAR) |
| 87 | @echo JarJar: $@ |
| 88 | $(hide) java -jar $(JARJAR) process $(PRIVATE_JARJAR_RULES) $< $@ |
| 89 | else |
| 90 | $(full_classes_jarjar_jar): $(full_classes_compiled_jar) | $(ACP) |
| 91 | @echo Copying: $@ |
| 92 | $(hide) $(ACP) -fp $< $@ |
| 93 | endif |
| 94 | |
| 95 | $(full_classes_jar): $(full_classes_jarjar_jar) | $(ACP) |
| 96 | @echo Copying: $@ |
| 97 | $(hide) $(ACP) -fp $< $@ |
| 98 | |
| 99 | $(built_dex): PRIVATE_INTERMEDIATES_DIR := $(intermediates.COMMON) |
| 100 | $(built_dex): PRIVATE_DX_FLAGS := $(LOCAL_DX_FLAGS) |
| 101 | $(built_dex): $(full_classes_jar) $(DX) |
| 102 | $(transform-classes.jar-to-dex) |
| 103 | |
| 104 | $(LOCAL_BUILT_MODULE): PRIVATE_DEX_FILE := $(built_dex) |
Ying Wang | 07acdbf | 2015-01-14 14:23:56 -0800 | [diff] [blame] | 105 | $(LOCAL_BUILT_MODULE): PRIVATE_SOURCE_ARCHIVE := $(full_classes_jarjar_jar) |
Fredrik Roubert | cc93f0c | 2015-01-28 21:29:38 +0100 | [diff] [blame] | 106 | $(LOCAL_BUILT_MODULE): PRIVATE_DONT_DELETE_JAR_DIRS := $(LOCAL_DONT_DELETE_JAR_DIRS) |
Narayan Kamath | 0dd273a | 2013-10-28 13:20:52 +0000 | [diff] [blame] | 107 | $(LOCAL_BUILT_MODULE): $(built_dex) $(java_resource_sources) |
| 108 | @echo "Host Jar: $(PRIVATE_MODULE) ($@)" |
Ying Wang | 07acdbf | 2015-01-14 14:23:56 -0800 | [diff] [blame] | 109 | $(call initialize-package-file,$(PRIVATE_SOURCE_ARCHIVE),$@) |
Narayan Kamath | 0dd273a | 2013-10-28 13:20:52 +0000 | [diff] [blame] | 110 | $(add-dex-to-package) |
Narayan Kamath | 0dd273a | 2013-10-28 13:20:52 +0000 | [diff] [blame] | 111 | |
| 112 | USE_CORE_LIB_BOOTCLASSPATH := |
Ying Wang | 0757768 | 2015-01-26 09:52:28 -0800 | [diff] [blame] | 113 | |
| 114 | endif |