Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 1 | # -*- mode: makefile -*- |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 2 | # Copyright (C) 2007 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 | # Definitions for building the Java library and associated tests. |
| 18 | # |
| 19 | |
| 20 | # |
| 21 | # Common definitions for host and target. |
| 22 | # |
| 23 | |
Jesse Wilson | d5d3526 | 2010-05-12 23:56:14 -0700 | [diff] [blame] | 24 | # libcore is divided into modules. |
| 25 | # |
| 26 | # The structure of each module is: |
| 27 | # |
| 28 | # src/ |
| 29 | # main/ # To be shipped on every device. |
| 30 | # java/ # Java source for library code. |
| 31 | # native/ # C++ source for library code. |
| 32 | # resources/ # Support files. |
| 33 | # test/ # Built only on demand, for testing. |
| 34 | # java/ # Java source for tests. |
| 35 | # native/ # C++ source for tests (rare). |
| 36 | # resources/ # Support files. |
| 37 | # |
| 38 | # All subdirectories are optional (hence the "2> /dev/null"s below). |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 39 | |
Narayan Kamath | 0a57ec2 | 2015-07-24 14:34:02 +0100 | [diff] [blame] | 40 | include $(LOCAL_PATH)/openjdk_java_files.mk |
| 41 | include $(LOCAL_PATH)/non_openjdk_java_files.mk |
Jesse Wilson | 32cfe95 | 2010-05-04 16:36:03 -0700 | [diff] [blame] | 42 | |
| 43 | define all-test-java-files-under |
Przemyslaw Szczepaniak | ebe4f19 | 2015-07-09 13:19:15 +0100 | [diff] [blame] | 44 | $(foreach dir,$(1),$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && (find $(dir)/src/test/java -name "*.java" 2> /dev/null) | grep -v -f java_tests_blacklist))) |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 45 | endef |
| 46 | |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 47 | define all-core-resource-dirs |
| 48 | $(shell cd $(LOCAL_PATH) && ls -d */src/$(1)/{java,resources} 2> /dev/null) |
| 49 | endef |
| 50 | |
Jesse Wilson | d5d3526 | 2010-05-12 23:56:14 -0700 | [diff] [blame] | 51 | # The Java files and their associated resources. |
Narayan Kamath | 29c564f | 2015-07-30 12:05:42 +0100 | [diff] [blame] | 52 | core_resource_dirs := \ |
| 53 | luni/src/main/java \ |
| 54 | ojluni/src/main/resources/ |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 55 | test_resource_dirs := $(call all-core-resource-dirs,test) |
Narayan Kamath | 51525b5 | 2013-11-15 18:02:54 +0000 | [diff] [blame] | 56 | test_src_files := $(call all-test-java-files-under,dalvik dom harmony-tests json luni xml) |
Igor Murashkin | 4c65c01 | 2016-03-24 20:52:10 +0000 | [diff] [blame] | 57 | ojtest_src_files := $(call all-test-java-files-under,ojluni) |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 58 | |
Jesse Wilson | 7898a91 | 2010-09-13 15:42:41 -0700 | [diff] [blame] | 59 | ifeq ($(EMMA_INSTRUMENT),true) |
Ying Wang | ff053c3 | 2012-08-21 17:20:51 -0700 | [diff] [blame] | 60 | ifneq ($(EMMA_INSTRUMENT_STATIC),true) |
Piotr Jastrzebski | 51b1b69 | 2015-02-16 15:01:09 +0000 | [diff] [blame] | 61 | nojcore_src_files += $(call all-java-files-under, ../external/emma/core ../external/emma/pregenerated) |
Jesse Wilson | 7898a91 | 2010-09-13 15:42:41 -0700 | [diff] [blame] | 62 | core_resource_dirs += ../external/emma/core/res ../external/emma/pregenerated/res |
| 63 | endif |
Ying Wang | ff053c3 | 2012-08-21 17:20:51 -0700 | [diff] [blame] | 64 | endif |
Jesse Wilson | 7898a91 | 2010-09-13 15:42:41 -0700 | [diff] [blame] | 65 | |
Elliott Hughes | 48d0b3f | 2010-12-14 09:48:52 -0800 | [diff] [blame] | 66 | local_javac_flags=-encoding UTF-8 |
| 67 | #local_javac_flags+=-Xlint:all -Xlint:-serial,-deprecation,-unchecked |
| 68 | local_javac_flags+=-Xmaxwarns 9999999 |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 69 | |
Narayan Kamath | 1a0f184 | 2015-09-07 12:59:53 +0100 | [diff] [blame] | 70 | |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 71 | # |
Narayan Kamath | f37f781 | 2015-04-01 09:34:24 +0100 | [diff] [blame] | 72 | # ICU4J related rules. |
| 73 | # |
Neil Fuller | 7280299 | 2015-10-05 15:39:53 +0100 | [diff] [blame] | 74 | # We compile android_icu4j along with core-libart because we're implementing parts of core-libart |
| 75 | # in terms of android_icu4j. |
| 76 | android_icu4j_root := ../external/icu/android_icu4j/ |
Paul Duffin | a98463d | 2016-02-25 16:02:42 +0000 | [diff] [blame] | 77 | android_icu4j_src_files := $(call all-java-files-under,$(android_icu4j_root)/src/main/java) |
Neil Fuller | 7280299 | 2015-10-05 15:39:53 +0100 | [diff] [blame] | 78 | android_icu4j_resource_dirs := $(android_icu4j_root)/resources |
Narayan Kamath | f37f781 | 2015-04-01 09:34:24 +0100 | [diff] [blame] | 79 | |
| 80 | # |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 81 | # Build for the target (device). |
| 82 | # |
| 83 | |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 84 | include $(CLEAR_VARS) |
Neil Fuller | 7d6a54c | 2016-01-27 21:48:51 +0000 | [diff] [blame] | 85 | LOCAL_SRC_FILES := $(openjdk_java_files) $(non_openjdk_java_files) $(android_icu4j_src_files) $(openjdk_lambda_stub_files) |
Neil Fuller | 7280299 | 2015-10-05 15:39:53 +0100 | [diff] [blame] | 86 | LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) $(android_icu4j_resource_dirs) |
Brian Carlstrom | 3711c21 | 2013-06-25 15:59:29 -0700 | [diff] [blame] | 87 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 88 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Brian Carlstrom | 3711c21 | 2013-06-25 15:59:29 -0700 | [diff] [blame] | 89 | LOCAL_MODULE_TAGS := optional |
Neil Fuller | 6c8e0ae | 2016-01-27 14:28:20 +0000 | [diff] [blame] | 90 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
Piotr Jastrzebski | 51b1b69 | 2015-02-16 15:01:09 +0000 | [diff] [blame] | 91 | LOCAL_MODULE := core-all |
Brian Carlstrom | 3711c21 | 2013-06-25 15:59:29 -0700 | [diff] [blame] | 92 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
| 93 | LOCAL_REQUIRED_MODULES := tzdata |
Piotr Jastrzebski | 5c3c9df | 2015-04-20 10:56:00 +0100 | [diff] [blame] | 94 | LOCAL_CORE_LIBRARY := true |
Narayan Kamath | 0ebbfbd | 2015-07-30 15:01:19 +0100 | [diff] [blame] | 95 | LOCAL_UNINSTALLABLE_MODULE := true |
Brian Carlstrom | 3711c21 | 2013-06-25 15:59:29 -0700 | [diff] [blame] | 96 | include $(BUILD_JAVA_LIBRARY) |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 97 | |
Narayan Kamath | f41eec8 | 2015-11-20 12:39:23 +0000 | [diff] [blame] | 98 | include $(CLEAR_VARS) |
Narayan Kamath | 0a57ec2 | 2015-07-24 14:34:02 +0100 | [diff] [blame] | 99 | LOCAL_SRC_FILES := $(openjdk_java_files) |
Piotr Jastrzebski | 51b1b69 | 2015-02-16 15:01:09 +0000 | [diff] [blame] | 100 | LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) |
Narayan Kamath | f41eec8 | 2015-11-20 12:39:23 +0000 | [diff] [blame] | 101 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 102 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Narayan Kamath | f41eec8 | 2015-11-20 12:39:23 +0000 | [diff] [blame] | 103 | LOCAL_MODULE_TAGS := optional |
Neil Fuller | 6c8e0ae | 2016-01-27 14:28:20 +0000 | [diff] [blame] | 104 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
Narayan Kamath | f41eec8 | 2015-11-20 12:39:23 +0000 | [diff] [blame] | 105 | LOCAL_MODULE := core-oj |
Narayan Kamath | f41eec8 | 2015-11-20 12:39:23 +0000 | [diff] [blame] | 106 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
Narayan Kamath | 09f993b | 2015-11-18 09:28:42 +0000 | [diff] [blame] | 107 | LOCAL_JAVA_LIBRARIES := core-all |
Narayan Kamath | 558a2d1 | 2015-12-22 14:37:40 +0000 | [diff] [blame] | 108 | LOCAL_NOTICE_FILE := $(LOCAL_PATH)/ojluni/NOTICE |
Narayan Kamath | f41eec8 | 2015-11-20 12:39:23 +0000 | [diff] [blame] | 109 | LOCAL_REQUIRED_MODULES := tzdata |
| 110 | LOCAL_CORE_LIBRARY := true |
Piotr Jastrzebski | 51b1b69 | 2015-02-16 15:01:09 +0000 | [diff] [blame] | 111 | include $(BUILD_JAVA_LIBRARY) |
| 112 | |
| 113 | # Definitions to make the core library. |
| 114 | include $(CLEAR_VARS) |
Przemyslaw Szczepaniak | 70b617f | 2015-11-20 12:01:45 +0000 | [diff] [blame] | 115 | LOCAL_SRC_FILES := $(non_openjdk_java_files) $(android_icu4j_src_files) |
Narayan Kamath | a61daf4 | 2015-11-24 13:31:36 +0000 | [diff] [blame] | 116 | LOCAL_JAVA_RESOURCE_DIRS := $(android_icu4j_resource_dirs) |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 117 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 118 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 119 | LOCAL_MODULE_TAGS := optional |
Neil Fuller | 6c8e0ae | 2016-01-27 14:28:20 +0000 | [diff] [blame] | 120 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 121 | LOCAL_MODULE := core-libart |
Narayan Kamath | 647e4a6 | 2015-10-02 10:22:16 +0100 | [diff] [blame] | 122 | LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/JavaLibrary.mk |
Narayan Kamath | 09f993b | 2015-11-18 09:28:42 +0000 | [diff] [blame] | 123 | LOCAL_JAVA_LIBRARIES := core-all |
Sebastien Hertz | 827e3d4 | 2016-03-24 09:43:45 +0100 | [diff] [blame] | 124 | ifeq ($(EMMA_INSTRUMENT),true) |
| 125 | ifneq ($(EMMA_INSTRUMENT_STATIC),true) |
| 126 | # For instrumented build, include Jacoco classes into core-libart. |
| 127 | LOCAL_STATIC_JAVA_LIBRARIES := jacocoagent |
| 128 | endif # EMMA_INSTRUMENT_STATIC |
| 129 | endif # EMMA_INSTRUMENT |
Narayan Kamath | b985319 | 2015-09-02 13:38:48 +0100 | [diff] [blame] | 130 | LOCAL_CORE_LIBRARY := true |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 131 | LOCAL_REQUIRED_MODULES := tzdata |
Narayan Kamath | f41eec8 | 2015-11-20 12:39:23 +0000 | [diff] [blame] | 132 | include $(BUILD_JAVA_LIBRARY) |
| 133 | |
Neil Fuller | 668d346 | 2016-02-01 18:14:45 +0000 | [diff] [blame] | 134 | # A library that exists to satisfy javac when |
| 135 | # compiling source code that contains lambdas. |
| 136 | include $(CLEAR_VARS) |
| 137 | LOCAL_SRC_FILES := $(openjdk_lambda_stub_files) |
| 138 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 139 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Neil Fuller | 668d346 | 2016-02-01 18:14:45 +0000 | [diff] [blame] | 140 | LOCAL_MODULE_TAGS := optional |
| 141 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
| 142 | LOCAL_MODULE := core-lambda-stubs |
| 143 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
| 144 | LOCAL_JAVA_LIBRARIES := core-all |
| 145 | LOCAL_NOTICE_FILE := $(LOCAL_PATH)/ojluni/NOTICE |
| 146 | LOCAL_CORE_LIBRARY := true |
| 147 | LOCAL_UNINSTALLABLE_MODULE := true |
| 148 | include $(BUILD_JAVA_LIBRARY) |
| 149 | |
Kenny Root | 38375a4 | 2013-04-23 15:50:31 -0700 | [diff] [blame] | 150 | ifeq ($(LIBCORE_SKIP_TESTS),) |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 151 | # A guaranteed unstripped version of core-oj and core-libart. This is required for ART testing in |
| 152 | # preopted configurations. See b/24535627. |
| 153 | include $(CLEAR_VARS) |
| 154 | LOCAL_SRC_FILES := $(openjdk_java_files) |
| 155 | LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) |
| 156 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 157 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 158 | LOCAL_MODULE_TAGS := optional |
| 159 | LOCAL_DEX_PREOPT := false |
Neil Fuller | 6c8e0ae | 2016-01-27 14:28:20 +0000 | [diff] [blame] | 160 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 161 | LOCAL_MODULE := core-oj-testdex |
| 162 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
| 163 | LOCAL_JAVA_LIBRARIES := core-all |
| 164 | LOCAL_NOTICE_FILE := $(LOCAL_PATH)/ojluni/NOTICE |
| 165 | LOCAL_REQUIRED_MODULES := tzdata |
| 166 | LOCAL_CORE_LIBRARY := true |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 167 | include $(BUILD_JAVA_LIBRARY) |
| 168 | |
| 169 | include $(CLEAR_VARS) |
| 170 | LOCAL_SRC_FILES := $(non_openjdk_java_files) $(android_icu4j_src_files) |
| 171 | LOCAL_JAVA_RESOURCE_DIRS := $(android_icu4j_resource_dirs) |
| 172 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 173 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 174 | LOCAL_MODULE_TAGS := optional |
| 175 | LOCAL_DEX_PREOPT := false |
Neil Fuller | 6c8e0ae | 2016-01-27 14:28:20 +0000 | [diff] [blame] | 176 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 177 | LOCAL_MODULE := core-libart-testdex |
| 178 | LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/JavaLibrary.mk |
| 179 | LOCAL_JAVA_LIBRARIES := core-all |
| 180 | LOCAL_CORE_LIBRARY := true |
| 181 | LOCAL_REQUIRED_MODULES := tzdata |
| 182 | include $(BUILD_JAVA_LIBRARY) |
| 183 | endif |
| 184 | |
| 185 | ifeq ($(LIBCORE_SKIP_TESTS),) |
Kenny Root | 38375a4 | 2013-04-23 15:50:31 -0700 | [diff] [blame] | 186 | # Make the core-tests library. |
| 187 | include $(CLEAR_VARS) |
Narayan Kamath | 51525b5 | 2013-11-15 18:02:54 +0000 | [diff] [blame] | 188 | LOCAL_SRC_FILES := $(test_src_files) |
Brian Carlstrom | 51ee38b | 2010-07-23 15:57:52 -0700 | [diff] [blame] | 189 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 190 | LOCAL_NO_STANDARD_LIBRARIES := true |
Paul Duffin | 7c19e31 | 2016-04-13 14:12:43 +0100 | [diff] [blame] | 191 | LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs okhttp core-junit junit4-target bouncycastle mockito-target |
Neil Fuller | 62fba1e | 2014-05-29 11:52:06 +0100 | [diff] [blame] | 192 | LOCAL_STATIC_JAVA_LIBRARIES := core-tests-support sqlite-jdbc mockwebserver nist-pkix-tests |
Elliott Hughes | d610834 | 2011-02-22 10:13:54 -0800 | [diff] [blame] | 193 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Neil Fuller | 668d346 | 2016-02-01 18:14:45 +0000 | [diff] [blame] | 194 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
Brian Carlstrom | b094af3 | 2010-05-28 17:37:37 -0700 | [diff] [blame] | 195 | LOCAL_MODULE := core-tests |
Elliott Hughes | 73d3e26 | 2012-08-28 17:56:09 -0700 | [diff] [blame] | 196 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
Jesse Wilson | 706d535 | 2010-06-08 17:20:09 -0700 | [diff] [blame] | 197 | include $(BUILD_STATIC_JAVA_LIBRARY) |
Elliott Hughes | c5cd6e8 | 2012-10-18 18:13:10 -0700 | [diff] [blame] | 198 | endif |
Jesse Wilson | 706d535 | 2010-06-08 17:20:09 -0700 | [diff] [blame] | 199 | |
Tsu Chiang Chuang | 808558f | 2013-08-21 11:46:49 -0700 | [diff] [blame] | 200 | ifeq ($(LIBCORE_SKIP_TESTS),) |
Kenny Root | b397b19 | 2013-08-29 14:24:47 -0700 | [diff] [blame] | 201 | # Make the core-tests-support library. |
| 202 | include $(CLEAR_VARS) |
| 203 | LOCAL_SRC_FILES := $(call all-test-java-files-under,support) |
| 204 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 205 | LOCAL_NO_STANDARD_LIBRARIES := true |
Paul Duffin | 7c19e31 | 2016-04-13 14:12:43 +0100 | [diff] [blame] | 206 | LOCAL_JAVA_LIBRARIES := core-oj core-libart core-junit junit4-target bouncycastle |
Kenny Root | 0435fdb | 2016-03-30 12:52:38 -0700 | [diff] [blame] | 207 | LOCAL_STATIC_JAVA_LIBRARIES := bouncycastle-bcpkix bouncycastle-ocsp |
Kenny Root | b397b19 | 2013-08-29 14:24:47 -0700 | [diff] [blame] | 208 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Kenny Root | b397b19 | 2013-08-29 14:24:47 -0700 | [diff] [blame] | 209 | LOCAL_MODULE := core-tests-support |
| 210 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
| 211 | include $(BUILD_STATIC_JAVA_LIBRARY) |
| 212 | endif |
| 213 | |
| 214 | ifeq ($(LIBCORE_SKIP_TESTS),) |
Tsu Chiang Chuang | 808558f | 2013-08-21 11:46:49 -0700 | [diff] [blame] | 215 | # Make the jsr166-tests library. |
| 216 | include $(CLEAR_VARS) |
| 217 | LOCAL_SRC_FILES := $(call all-test-java-files-under, jsr166-tests) |
| 218 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 219 | LOCAL_NO_STANDARD_LIBRARIES := true |
Paul Duffin | 7c19e31 | 2016-04-13 14:12:43 +0100 | [diff] [blame] | 220 | LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs core-junit junit4-target |
Tsu Chiang Chuang | 808558f | 2013-08-21 11:46:49 -0700 | [diff] [blame] | 221 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
| 222 | LOCAL_MODULE := jsr166-tests |
Przemyslaw Szczepaniak | 087f0ca | 2016-03-15 12:38:36 +0000 | [diff] [blame] | 223 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
Tsu Chiang Chuang | 808558f | 2013-08-21 11:46:49 -0700 | [diff] [blame] | 224 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
| 225 | include $(BUILD_STATIC_JAVA_LIBRARY) |
| 226 | endif |
| 227 | |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 228 | # |
| 229 | # Build for the host. |
| 230 | # |
| 231 | |
Elliott Hughes | e983a0b | 2015-01-16 10:47:17 -0800 | [diff] [blame] | 232 | ifeq ($(HOST_OS),linux) |
| 233 | |
Ian Rogers | 3deabd2 | 2014-05-23 15:12:42 -0700 | [diff] [blame] | 234 | include $(CLEAR_VARS) |
Narayan Kamath | 0a57ec2 | 2015-07-24 14:34:02 +0100 | [diff] [blame] | 235 | LOCAL_SRC_FILES := $(call all-java-files-under, dex/src/main) |
Tsu Chiang Chuang | 25963ae | 2013-07-23 16:39:20 -0700 | [diff] [blame] | 236 | LOCAL_MODULE_TAGS := optional |
| 237 | LOCAL_MODULE := dex-host |
| 238 | include $(BUILD_HOST_JAVA_LIBRARY) |
| 239 | |
Piotr Jastrzebski | 51b1b69 | 2015-02-16 15:01:09 +0000 | [diff] [blame] | 240 | include $(CLEAR_VARS) |
Neil Fuller | 7d6a54c | 2016-01-27 21:48:51 +0000 | [diff] [blame] | 241 | LOCAL_SRC_FILES := $(non_openjdk_java_files) $(openjdk_java_files) $(android_icu4j_src_files) $(openjdk_lambda_stub_files) |
Przemyslaw Szczepaniak | e3b37c2 | 2015-09-28 16:24:00 +0100 | [diff] [blame] | 242 | LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) |
Ian Rogers | 3deabd2 | 2014-05-23 15:12:42 -0700 | [diff] [blame] | 243 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 244 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Ian Rogers | 3deabd2 | 2014-05-23 15:12:42 -0700 | [diff] [blame] | 245 | LOCAL_MODULE_TAGS := optional |
Neil Fuller | 6c8e0ae | 2016-01-27 14:28:20 +0000 | [diff] [blame] | 246 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
Piotr Jastrzebski | 51b1b69 | 2015-02-16 15:01:09 +0000 | [diff] [blame] | 247 | LOCAL_MODULE := core-all-hostdex |
Ian Rogers | 3deabd2 | 2014-05-23 15:12:42 -0700 | [diff] [blame] | 248 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
| 249 | LOCAL_REQUIRED_MODULES := tzdata-host |
Piotr Jastrzebski | 5c3c9df | 2015-04-20 10:56:00 +0100 | [diff] [blame] | 250 | LOCAL_CORE_LIBRARY := true |
Narayan Kamath | 0ebbfbd | 2015-07-30 15:01:19 +0100 | [diff] [blame] | 251 | LOCAL_UNINSTALLABLE_MODULE := true |
Ian Rogers | 3deabd2 | 2014-05-23 15:12:42 -0700 | [diff] [blame] | 252 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 253 | |
Narayan Kamath | f41eec8 | 2015-11-20 12:39:23 +0000 | [diff] [blame] | 254 | include $(CLEAR_VARS) |
Narayan Kamath | 0a57ec2 | 2015-07-24 14:34:02 +0100 | [diff] [blame] | 255 | LOCAL_SRC_FILES := $(openjdk_java_files) |
Piotr Jastrzebski | 51b1b69 | 2015-02-16 15:01:09 +0000 | [diff] [blame] | 256 | LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) |
Narayan Kamath | f41eec8 | 2015-11-20 12:39:23 +0000 | [diff] [blame] | 257 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 258 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Narayan Kamath | f41eec8 | 2015-11-20 12:39:23 +0000 | [diff] [blame] | 259 | LOCAL_MODULE_TAGS := optional |
Neil Fuller | 6c8e0ae | 2016-01-27 14:28:20 +0000 | [diff] [blame] | 260 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
Narayan Kamath | f41eec8 | 2015-11-20 12:39:23 +0000 | [diff] [blame] | 261 | LOCAL_MODULE := core-oj-hostdex |
Narayan Kamath | 558a2d1 | 2015-12-22 14:37:40 +0000 | [diff] [blame] | 262 | LOCAL_NOTICE_FILE := $(LOCAL_PATH)/ojluni/NOTICE |
Narayan Kamath | f41eec8 | 2015-11-20 12:39:23 +0000 | [diff] [blame] | 263 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
Piotr Jastrzebski | 51b1b69 | 2015-02-16 15:01:09 +0000 | [diff] [blame] | 264 | LOCAL_JAVA_LIBRARIES := core-all-hostdex |
Narayan Kamath | f41eec8 | 2015-11-20 12:39:23 +0000 | [diff] [blame] | 265 | LOCAL_REQUIRED_MODULES := tzdata-host |
Narayan Kamath | f41eec8 | 2015-11-20 12:39:23 +0000 | [diff] [blame] | 266 | LOCAL_CORE_LIBRARY := true |
Narayan Kamath | f41eec8 | 2015-11-20 12:39:23 +0000 | [diff] [blame] | 267 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
| 268 | |
Kenny Root | ba07db5 | 2013-08-29 13:40:35 -0700 | [diff] [blame] | 269 | # Definitions to make the core library. |
| 270 | include $(CLEAR_VARS) |
Przemyslaw Szczepaniak | 70b617f | 2015-11-20 12:01:45 +0000 | [diff] [blame] | 271 | LOCAL_SRC_FILES := $(non_openjdk_java_files) $(android_icu4j_src_files) |
Narayan Kamath | a61daf4 | 2015-11-24 13:31:36 +0000 | [diff] [blame] | 272 | LOCAL_JAVA_RESOURCE_DIRS := $(android_icu4j_resource_dirs) |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 273 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e983a0b | 2015-01-16 10:47:17 -0800 | [diff] [blame] | 274 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 275 | LOCAL_MODULE_TAGS := optional |
Neil Fuller | 6c8e0ae | 2016-01-27 14:28:20 +0000 | [diff] [blame] | 276 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 277 | LOCAL_MODULE := core-libart-hostdex |
| 278 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
Piotr Jastrzebski | 51b1b69 | 2015-02-16 15:01:09 +0000 | [diff] [blame] | 279 | LOCAL_JAVA_LIBRARIES := core-oj-hostdex |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 280 | LOCAL_REQUIRED_MODULES := tzdata-host |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 281 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
| 282 | |
Neil Fuller | 3375f98 | 2016-02-15 14:39:05 +0000 | [diff] [blame] | 283 | # A library that exists to satisfy javac when |
| 284 | # compiling source code that contains lambdas. |
| 285 | include $(CLEAR_VARS) |
| 286 | LOCAL_SRC_FILES := $(openjdk_lambda_stub_files) |
| 287 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 288 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Neil Fuller | 3375f98 | 2016-02-15 14:39:05 +0000 | [diff] [blame] | 289 | LOCAL_MODULE_TAGS := optional |
| 290 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
| 291 | LOCAL_MODULE := core-lambda-stubs-hostdex |
| 292 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
| 293 | LOCAL_JAVA_LIBRARIES := core-all-hostdex |
| 294 | LOCAL_CORE_LIBRARY := true |
| 295 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
| 296 | |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 297 | # Make the core-tests library. |
| 298 | ifeq ($(LIBCORE_SKIP_TESTS),) |
| 299 | include $(CLEAR_VARS) |
| 300 | LOCAL_SRC_FILES := $(test_src_files) |
| 301 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 302 | LOCAL_NO_STANDARD_LIBRARIES := true |
Paul Duffin | 7c19e31 | 2016-04-13 14:12:43 +0100 | [diff] [blame] | 303 | LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex core-lambda-stubs-hostdex okhttp-hostdex bouncycastle-hostdex core-junit-hostdex junit4-target-hostdex core-tests-support-hostdex mockito-api-hostdex |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 304 | LOCAL_STATIC_JAVA_LIBRARIES := sqlite-jdbc-host mockwebserver-host nist-pkix-tests-host |
| 305 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
| 306 | LOCAL_MODULE_TAGS := optional |
Neil Fuller | 4c6a1ee | 2016-02-15 12:51:39 +0000 | [diff] [blame] | 307 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 308 | LOCAL_MODULE := core-tests-hostdex |
| 309 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
| 310 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
| 311 | endif |
Elliott Hughes | d610834 | 2011-02-22 10:13:54 -0800 | [diff] [blame] | 312 | |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 313 | # Make the core-tests-support library. |
| 314 | ifeq ($(LIBCORE_SKIP_TESTS),) |
| 315 | include $(CLEAR_VARS) |
| 316 | LOCAL_SRC_FILES := $(call all-test-java-files-under,support) |
| 317 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 318 | LOCAL_NO_STANDARD_LIBRARIES := true |
Paul Duffin | 7c19e31 | 2016-04-13 14:12:43 +0100 | [diff] [blame] | 319 | LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex core-junit-hostdex junit4-target-hostdex bouncycastle-hostdex |
Kenny Root | 0435fdb | 2016-03-30 12:52:38 -0700 | [diff] [blame] | 320 | LOCAL_STATIC_JAVA_LIBRARIES := bouncycastle-bcpkix-hostdex bouncycastle-ocsp-hostdex |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 321 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
| 322 | LOCAL_MODULE_TAGS := optional |
| 323 | LOCAL_MODULE := core-tests-support-hostdex |
| 324 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
| 325 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
Elliott Hughes | 92fc63e | 2013-02-07 17:05:57 -0800 | [diff] [blame] | 326 | endif |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 327 | |
Igor Murashkin | 6037000 | 2016-04-04 11:53:53 -0700 | [diff] [blame^] | 328 | # Make the core-ojtests-hostdex library. |
Igor Murashkin | 4c65c01 | 2016-03-24 20:52:10 +0000 | [diff] [blame] | 329 | ifeq ($(LIBCORE_SKIP_TESTS),) |
| 330 | include $(CLEAR_VARS) |
| 331 | LOCAL_SRC_FILES := $(ojtest_src_files) |
| 332 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 333 | LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex core-lambda-stubs-hostdex okhttp-hostdex bouncycastle-hostdex |
| 334 | LOCAL_STATIC_JAVA_LIBRARIES := testng-hostdex |
| 335 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
| 336 | LOCAL_MODULE_TAGS := optional |
| 337 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
| 338 | LOCAL_MODULE := core-ojtests-hostdex |
| 339 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
| 340 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
| 341 | endif |
| 342 | |
Igor Murashkin | 6037000 | 2016-04-04 11:53:53 -0700 | [diff] [blame^] | 343 | # Make the core-ojtests library. |
| 344 | ifeq ($(LIBCORE_SKIP_TESTS),) |
| 345 | include $(CLEAR_VARS) |
| 346 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 347 | LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs okhttp bouncycastle |
| 348 | LOCAL_STATIC_JAVA_LIBRARIES := testng |
| 349 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
| 350 | LOCAL_MODULE_TAGS := optional |
| 351 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
| 352 | LOCAL_MODULE := core-ojtests |
| 353 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
| 354 | # jack bug workaround: int[] java.util.stream.StatefulTestOp.-getjava-util-stream-StreamShapeSwitchesValues() is a private synthetic method in an interface which causes a hard verifier error |
| 355 | LOCAL_DEX_PREOPT := false # disable AOT preverification which breaks the build. it will still throw VerifyError at runtime. |
| 356 | include $(BUILD_JAVA_LIBRARY) |
| 357 | endif |
| 358 | |
| 359 | |
| 360 | # Make the core-ojtests-public library. Excludes any private API tests. |
| 361 | ifeq ($(LIBCORE_SKIP_TESTS),) |
| 362 | include $(CLEAR_VARS) |
| 363 | # Filter out SerializedLambdaTest because it depends on stub classes and won't actually run. |
| 364 | LOCAL_SRC_FILES := $(filter-out %/DeserializeMethodTest.java %/SerializedLambdaTest.java ojluni/src/test/java/util/stream/boot%,$(ojtest_src_files)) # Do not include anything from the boot* directories. Those directories need a custom bootclasspath to run. |
| 365 | # Include source code as part of JAR |
| 366 | LOCAL_JAVA_RESOURCE_DIRS := ojluni/src/test/dist |
| 367 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 368 | LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs okhttp bouncycastle testng |
| 369 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
| 370 | LOCAL_MODULE_TAGS := optional |
| 371 | LOCAL_JAVA_LANGUAGE_VERSION := 1.8 |
| 372 | LOCAL_MODULE := core-ojtests-public |
| 373 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
| 374 | # jack bug workaround: int[] java.util.stream.StatefulTestOp.-getjava-util-stream-StreamShapeSwitchesValues() is a private synthetic method in an interface which causes a hard verifier error |
| 375 | LOCAL_DEX_PREOPT := false # disable AOT preverification which breaks the build. it will still throw VerifyError at runtime. |
| 376 | include $(BUILD_JAVA_LIBRARY) |
| 377 | endif |
| 378 | |
| 379 | |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 380 | endif # HOST_OS == linux |
| 381 | |
| 382 | # |
| 383 | # Local droiddoc for faster libcore testing |
| 384 | # |
| 385 | # |
Elliott Hughes | 92fc63e | 2013-02-07 17:05:57 -0800 | [diff] [blame] | 386 | # Run with: |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 387 | # mm -j32 libcore-docs |
| 388 | # |
Elliott Hughes | 92fc63e | 2013-02-07 17:05:57 -0800 | [diff] [blame] | 389 | # Main output: |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 390 | # ../out/target/common/docs/libcore/reference/packages.html |
| 391 | # |
Elliott Hughes | 92fc63e | 2013-02-07 17:05:57 -0800 | [diff] [blame] | 392 | # All text for proofreading (or running tools over): |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 393 | # ../out/target/common/docs/libcore-proofread.txt |
| 394 | # |
Elliott Hughes | 92fc63e | 2013-02-07 17:05:57 -0800 | [diff] [blame] | 395 | # TODO list of missing javadoc, etc: |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 396 | # ../out/target/common/docs/libcore-docs-todo.html |
| 397 | # |
| 398 | # Rerun: |
| 399 | # rm -rf ../out/target/common/docs/libcore-timestamp && mm -j32 libcore-docs |
| 400 | # |
| 401 | include $(CLEAR_VARS) |
Ying Wang | 21ac42d | 2013-12-04 15:54:36 -0800 | [diff] [blame] | 402 | |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 403 | # for shared defintion of libcore_to_document |
| 404 | include $(LOCAL_PATH)/Docs.mk |
| 405 | |
Neil Fuller | 4259738 | 2015-10-07 11:00:01 +0100 | [diff] [blame] | 406 | # The libcore_to_document paths are relative to $(TOPDIR). We are in libcore so we must prepend |
| 407 | # ../ to make LOCAL_SRC_FILES relative to $(LOCAL_PATH). |
| 408 | LOCAL_SRC_FILES := $(addprefix ../, $(libcore_to_document)) |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 409 | # rerun doc generation without recompiling the java |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 410 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
| 411 | LOCAL_MODULE_CLASS:=JAVA_LIBRARIES |
| 412 | |
| 413 | LOCAL_MODULE := libcore |
Elliott Hughes | 73d3e26 | 2012-08-28 17:56:09 -0700 | [diff] [blame] | 414 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 415 | |
Elliott Hughes | b986327 | 2012-11-08 14:28:29 -0800 | [diff] [blame] | 416 | LOCAL_DROIDDOC_OPTIONS := \ |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 417 | -offlinemode \ |
| 418 | -title "libcore" \ |
| 419 | -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \ |
| 420 | -todo ../$(LOCAL_MODULE)-docs-todo.html \ |
| 421 | -hdf android.whichdoc offline |
| 422 | |
| 423 | LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk |
| 424 | |
| 425 | include $(BUILD_DROIDDOC) |
Narayan Kamath | 0a57ec2 | 2015-07-24 14:34:02 +0100 | [diff] [blame] | 426 | |
| 427 | openjdk_java_files := |
| 428 | non_openjdk_java_files := |