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 | |
Jesse Wilson | 32cfe95 | 2010-05-04 16:36:03 -0700 | [diff] [blame] | 40 | define all-test-java-files-under |
Przemyslaw Szczepaniak | ebe4f19 | 2015-07-09 13:19:15 +0100 | [diff] [blame] | 41 | $(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] | 42 | endef |
| 43 | |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 44 | define all-core-resource-dirs |
| 45 | $(shell cd $(LOCAL_PATH) && ls -d */src/$(1)/{java,resources} 2> /dev/null) |
| 46 | endef |
| 47 | |
Jesse Wilson | d5d3526 | 2010-05-12 23:56:14 -0700 | [diff] [blame] | 48 | # The Java files and their associated resources. |
Narayan Kamath | 29c564f | 2015-07-30 12:05:42 +0100 | [diff] [blame] | 49 | core_resource_dirs := \ |
| 50 | luni/src/main/java \ |
| 51 | ojluni/src/main/resources/ |
Joachim Sauer | ac12c75 | 2017-01-30 18:47:15 +0000 | [diff] [blame] | 52 | test_resource_dirs := $(filter-out ojluni/%,$(call all-core-resource-dirs,test)) |
Paul Duffin | fe0ee8e | 2016-08-12 11:32:44 +0100 | [diff] [blame] | 53 | test_src_files := $(call all-test-java-files-under,dalvik dalvik/test-rules dom harmony-tests json luni xml) |
Igor Murashkin | 4c65c01 | 2016-03-24 20:52:10 +0000 | [diff] [blame] | 54 | ojtest_src_files := $(call all-test-java-files-under,ojluni) |
Joachim Sauer | ac12c75 | 2017-01-30 18:47:15 +0000 | [diff] [blame] | 55 | ojtest_resource_dirs := $(filter ojluni/%,$(call all-core-resource-dirs,test)) |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 56 | |
Jesse Wilson | 7898a91 | 2010-09-13 15:42:41 -0700 | [diff] [blame] | 57 | ifeq ($(EMMA_INSTRUMENT),true) |
Ying Wang | ff053c3 | 2012-08-21 17:20:51 -0700 | [diff] [blame] | 58 | ifneq ($(EMMA_INSTRUMENT_STATIC),true) |
Piotr Jastrzebski | 51b1b69 | 2015-02-16 15:01:09 +0000 | [diff] [blame] | 59 | 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] | 60 | core_resource_dirs += ../external/emma/core/res ../external/emma/pregenerated/res |
| 61 | endif |
Ying Wang | ff053c3 | 2012-08-21 17:20:51 -0700 | [diff] [blame] | 62 | endif |
Jesse Wilson | 7898a91 | 2010-09-13 15:42:41 -0700 | [diff] [blame] | 63 | |
Elliott Hughes | 48d0b3f | 2010-12-14 09:48:52 -0800 | [diff] [blame] | 64 | local_javac_flags=-encoding UTF-8 |
| 65 | #local_javac_flags+=-Xlint:all -Xlint:-serial,-deprecation,-unchecked |
| 66 | local_javac_flags+=-Xmaxwarns 9999999 |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 67 | |
Narayan Kamath | 85952e2 | 2017-06-14 17:23:34 +0100 | [diff] [blame] | 68 | # For user / userdebug builds, strip the local variable table and the local variable |
| 69 | # type table. This has no bearing on stack traces, but will leave less information |
| 70 | # available via JDWP. |
| 71 | # |
| 72 | # TODO: Should this be conditioned on a PRODUCT_ flag or should we just turn this |
| 73 | # on for all builds. Also, name of the flag TBD. |
| 74 | ifneq (,$(PRODUCT_MINIMIZE_JAVA_DEBUG_INFO)) |
| 75 | ifneq (,$(filter userdebug user,$(TARGET_BUILD_VARIANT))) |
| 76 | local_javac_flags+= -g:source,lines |
| 77 | local_jack_flags+= -D jack.dex.debug.vars=false -D jack.dex.debug.vars.synthetic=false |
| 78 | endif |
| 79 | endif |
Narayan Kamath | 1a0f184 | 2015-09-07 12:59:53 +0100 | [diff] [blame] | 80 | |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 81 | # |
Narayan Kamath | f37f781 | 2015-04-01 09:34:24 +0100 | [diff] [blame] | 82 | # ICU4J related rules. |
| 83 | # |
Neil Fuller | 7280299 | 2015-10-05 15:39:53 +0100 | [diff] [blame] | 84 | # We compile android_icu4j along with core-libart because we're implementing parts of core-libart |
| 85 | # in terms of android_icu4j. |
| 86 | android_icu4j_root := ../external/icu/android_icu4j/ |
Paul Duffin | a98463d | 2016-02-25 16:02:42 +0000 | [diff] [blame] | 87 | 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] | 88 | android_icu4j_resource_dirs := $(android_icu4j_root)/resources |
Narayan Kamath | f37f781 | 2015-04-01 09:34:24 +0100 | [diff] [blame] | 89 | |
| 90 | # |
Colin Cross | fb7218e | 2017-10-27 17:50:42 +0000 | [diff] [blame] | 91 | # Build jaif-annotated source files for ojluni target . |
| 92 | # |
| 93 | ojluni_annotate_dir := $(call intermediates-dir-for,JAVA_LIBRARIES,core-oj,,COMMON)/annotated |
| 94 | ojluni_annotate_target := $(ojluni_annotate_dir)/timestamp |
| 95 | ojluni_annotate_jaif := $(LOCAL_PATH)/annotations/ojluni.jaif |
| 96 | ojluni_annotate_input := $(annotated_ojluni_files) |
| 97 | ojluni_annotate_output := $(patsubst $(LOCAL_PATH)/ojluni/src/main/java/%, $(ojluni_annotate_dir)/%, $(ojluni_annotate_input)) |
| 98 | |
| 99 | $(ojluni_annotate_target): PRIVATE_ANNOTATE_TARGET := $(ojluni_annotate_target) |
| 100 | $(ojluni_annotate_target): PRIVATE_ANNOTATE_DIR := $(ojluni_annotate_dir) |
| 101 | $(ojluni_annotate_target): PRIVATE_ANNOTATE_JAIF := $(ojluni_annotate_jaif) |
| 102 | $(ojluni_annotate_target): PRIVATE_ANNOTATE_INPUT := $(ojluni_annotate_input) |
| 103 | $(ojluni_annotate_target): PRIVATE_ANNOTATE_GENERATE_CMD := $(LOCAL_PATH)/annotations/generate_annotated_java_files.py |
| 104 | $(ojluni_annotate_target): PRIVATE_ANNOTATE_GENERATE_OUTPUT := $(LOCAL_PATH)/annotated_java_files.bp |
| 105 | $(ojluni_annotate_target): PRIVATE_INSERT_ANNOTATIONS_TO_SOURCE := external/annotation-tools/annotation-file-utilities/scripts/insert-annotations-to-source |
| 106 | |
| 107 | # Diff output of _ojluni_annotate_generate_cmd with what we have, and if generate annotated source. |
| 108 | $(ojluni_annotate_target): $(ojluni_annotate_input) $(ojluni_annotate_jaif) |
| 109 | rm -rf $(PRIVATE_ANNOTATE_DIR) |
| 110 | mkdir -p $(PRIVATE_ANNOTATE_DIR) |
| 111 | $(PRIVATE_ANNOTATE_GENERATE_CMD) $(PRIVATE_ANNOTATE_JAIF) > $(PRIVATE_ANNOTATE_DIR)/annotated_java_files.bp.tmp |
| 112 | diff -u $(PRIVATE_ANNOTATE_GENERATE_OUTPUT) $(PRIVATE_ANNOTATE_DIR)/annotated_java_files.bp.tmp || \ |
| 113 | (echo -e "********************" >&2; \ |
| 114 | echo -e "annotated_java_files.bp needs regenerating. Please run:" >&2; \ |
| 115 | echo -e "libcore/annotations/generate_annotated_java_files.py libcore/annotations/ojluni.jaif > libcore/annotated_java_files.bp" >&2; \ |
| 116 | echo -e "********************" >&2; exit 1) |
| 117 | rm $(PRIVATE_ANNOTATE_DIR)/annotated_java_files.bp.tmp |
| 118 | $(PRIVATE_INSERT_ANNOTATIONS_TO_SOURCE) -d $(PRIVATE_ANNOTATE_DIR) $(PRIVATE_ANNOTATE_JAIF) $(PRIVATE_ANNOTATE_INPUT) |
| 119 | touch $@ |
| 120 | $(ojluni_annotate_target): .KATI_IMPLICIT_OUTPUTS := $(ojluni_annotate_output) |
| 121 | |
| 122 | ojluni_annotate_dir:= |
| 123 | ojluni_annotate_target:= |
| 124 | ojluni_annotate_jaif:= |
| 125 | ojluni_annotate_input:= |
| 126 | ojluni_annotate_output:= |
| 127 | |
| 128 | # |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 129 | # Build for the target (device). |
| 130 | # |
Kenny Root | 38375a4 | 2013-04-23 15:50:31 -0700 | [diff] [blame] | 131 | ifeq ($(LIBCORE_SKIP_TESTS),) |
Shubham Ajmera | cfcde6a | 2017-02-09 13:24:00 +0000 | [diff] [blame] | 132 | # Build a library just containing files from luni/src/test/filesystems for use in tests. |
| 133 | include $(CLEAR_VARS) |
| 134 | LOCAL_SRC_FILES := $(call all-java-files-under, luni/src/test/filesystems/src) |
| 135 | LOCAL_JAVA_RESOURCE_DIRS := luni/src/test/filesystems/resources |
| 136 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 137 | LOCAL_MODULE := filesystemstest |
| 138 | LOCAL_JAVA_LIBRARIES := core-oj core-libart |
| 139 | LOCAL_DEX_PREOPT := false |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 140 | LOCAL_ERROR_PRONE_FLAGS := -Xep:MissingOverride:OFF |
Shubham Ajmera | cfcde6a | 2017-02-09 13:24:00 +0000 | [diff] [blame] | 141 | include $(BUILD_JAVA_LIBRARY) |
Neil Fuller | 4540094 | 2017-11-24 19:56:15 +0000 | [diff] [blame] | 142 | |
| 143 | filesystemstest_jar := $(intermediates)/$(LOCAL_MODULE).jar |
| 144 | $(filesystemstest_jar): $(LOCAL_BUILT_MODULE) |
Dan Willemsen | 6a6398f | 2017-03-20 10:47:51 -0700 | [diff] [blame] | 145 | $(call copy-file-to-target) |
Neil Fuller | 4540094 | 2017-11-24 19:56:15 +0000 | [diff] [blame] | 146 | |
| 147 | # Build a library just containing files from luni/src/test/parameter_metadata for use in tests. |
| 148 | include $(CLEAR_VARS) |
| 149 | LOCAL_SRC_FILES := $(call all-java-files-under, luni/src/test/parameter_metadata/src) |
| 150 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 151 | LOCAL_MODULE := parameter-metadata-test |
| 152 | LOCAL_JAVA_LIBRARIES := core-oj core-libart |
| 153 | LOCAL_DEX_PREOPT := false |
| 154 | LOCAL_JAVACFLAGS := -parameters |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 155 | LOCAL_ERROR_PRONE_FLAGS := -Xep:MissingOverride:OFF |
Neil Fuller | 4540094 | 2017-11-24 19:56:15 +0000 | [diff] [blame] | 156 | include $(BUILD_JAVA_LIBRARY) |
| 157 | |
| 158 | parameter_metadata_test_jar := $(intermediates)/$(LOCAL_MODULE).jar |
| 159 | $(parameter_metadata_test_jar): $(LOCAL_BUILT_MODULE) |
| 160 | $(call copy-file-to-target) |
| 161 | |
Shubham Ajmera | cfcde6a | 2017-02-09 13:24:00 +0000 | [diff] [blame] | 162 | endif |
| 163 | |
| 164 | ifeq ($(LIBCORE_SKIP_TESTS),) |
Kenny Root | 38375a4 | 2013-04-23 15:50:31 -0700 | [diff] [blame] | 165 | # Make the core-tests library. |
| 166 | include $(CLEAR_VARS) |
Narayan Kamath | 51525b5 | 2013-11-15 18:02:54 +0000 | [diff] [blame] | 167 | LOCAL_SRC_FILES := $(test_src_files) |
Brian Carlstrom | 51ee38b | 2010-07-23 15:57:52 -0700 | [diff] [blame] | 168 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
Shubham Ajmera | cfcde6a | 2017-02-09 13:24:00 +0000 | [diff] [blame] | 169 | # Include individual dex.jar files (jars containing resources and a classes.dex) so that they |
| 170 | # be loaded by tests using ClassLoaders but are not in the main classes.dex. |
Neil Fuller | 4540094 | 2017-11-24 19:56:15 +0000 | [diff] [blame] | 171 | LOCAL_JAVA_RESOURCE_FILES := $(filesystemstest_jar) $(parameter_metadata_test_jar) |
Brian Carlstrom | 51ee38b | 2010-07-23 15:57:52 -0700 | [diff] [blame] | 172 | LOCAL_NO_STANDARD_LIBRARIES := true |
Adam Vartanian | ce69636 | 2017-03-03 14:07:19 +0000 | [diff] [blame] | 173 | LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp bouncycastle |
Paul Duffin | fe0ee8e | 2016-08-12 11:32:44 +0100 | [diff] [blame] | 174 | LOCAL_STATIC_JAVA_LIBRARIES := \ |
Neil Fuller | f04b9af | 2017-05-24 11:48:12 +0100 | [diff] [blame] | 175 | archive-patcher \ |
Paul Duffin | fe0ee8e | 2016-08-12 11:32:44 +0100 | [diff] [blame] | 176 | core-test-rules \ |
| 177 | core-tests-support \ |
Neil Fuller | f04b9af | 2017-05-24 11:48:12 +0100 | [diff] [blame] | 178 | junit-params \ |
Tobias Thierer | 62db9f9 | 2016-11-28 12:24:32 +0000 | [diff] [blame] | 179 | mockftpserver \ |
Adam Vartanian | ce69636 | 2017-03-03 14:07:19 +0000 | [diff] [blame] | 180 | mockito-target \ |
Paul Duffin | fe0ee8e | 2016-08-12 11:32:44 +0100 | [diff] [blame] | 181 | mockwebserver \ |
| 182 | nist-pkix-tests \ |
Tobias Thierer | 62db9f9 | 2016-11-28 12:24:32 +0000 | [diff] [blame] | 183 | slf4j-jdk14 \ |
Neil Fuller | 8e0c349 | 2016-12-09 18:32:10 +0000 | [diff] [blame] | 184 | sqlite-jdbc \ |
Neil Fuller | f04b9af | 2017-05-24 11:48:12 +0100 | [diff] [blame] | 185 | tzdata-testing |
Elliott Hughes | d610834 | 2011-02-22 10:13:54 -0800 | [diff] [blame] | 186 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Narayan Kamath | 85952e2 | 2017-06-14 17:23:34 +0100 | [diff] [blame] | 187 | LOCAL_JACK_FLAGS := $(local_jack_flags) |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 188 | LOCAL_ERROR_PRONE_FLAGS := \ |
| 189 | -Xep:TryFailThrowable:ERROR \ |
| 190 | -Xep:ComparisonOutOfRange:ERROR \ |
| 191 | -Xep:MissingOverride:OFF |
Brian Carlstrom | b094af3 | 2010-05-28 17:37:37 -0700 | [diff] [blame] | 192 | LOCAL_MODULE := core-tests |
Jesse Wilson | 706d535 | 2010-06-08 17:20:09 -0700 | [diff] [blame] | 193 | include $(BUILD_STATIC_JAVA_LIBRARY) |
Elliott Hughes | c5cd6e8 | 2012-10-18 18:13:10 -0700 | [diff] [blame] | 194 | endif |
Jesse Wilson | 706d535 | 2010-06-08 17:20:09 -0700 | [diff] [blame] | 195 | |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 196 | # Make the core-ojtests library. |
| 197 | ifeq ($(LIBCORE_SKIP_TESTS),) |
| 198 | include $(CLEAR_VARS) |
Joachim Sauer | ac12c75 | 2017-01-30 18:47:15 +0000 | [diff] [blame] | 199 | LOCAL_JAVA_RESOURCE_DIRS := $(ojtest_resource_dirs) |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 200 | LOCAL_NO_STANDARD_LIBRARIES := true |
Narayan Kamath | d097a9b | 2016-09-22 17:07:15 +0100 | [diff] [blame] | 201 | LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp bouncycastle |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 202 | LOCAL_STATIC_JAVA_LIBRARIES := testng |
| 203 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Narayan Kamath | 85952e2 | 2017-06-14 17:23:34 +0100 | [diff] [blame] | 204 | LOCAL_JACK_FLAGS := $(local_jack_flags) |
Colin Cross | 96a5529 | 2016-12-21 16:42:56 -0800 | [diff] [blame] | 205 | LOCAL_DX_FLAGS := --core-library |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 206 | LOCAL_MODULE_TAGS := optional |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 207 | LOCAL_MODULE := core-ojtests |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 208 | LOCAL_ERROR_PRONE_FLAGS := -Xep:MissingOverride:OFF |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 209 | include $(BUILD_JAVA_LIBRARY) |
| 210 | endif |
| 211 | |
| 212 | # Make the core-ojtests-public library. Excludes any private API tests. |
| 213 | ifeq ($(LIBCORE_SKIP_TESTS),) |
| 214 | include $(CLEAR_VARS) |
Tobias Thierer | d042dbe | 2018-01-09 20:23:03 +0000 | [diff] [blame] | 215 | # Filter out the following: |
| 216 | # 1.) DeserializeMethodTest and SerializedLambdaTest, because they depends on stub classes |
| 217 | # and won't actually run, and |
| 218 | # 2.) util/stream/boot*. Those directories contain classes in the package java.util.stream; |
| 219 | # excluding them means we don't need LOCAL_PATCH_MODULE := java.base |
| 220 | LOCAL_SRC_FILES := $(filter-out %/DeserializeMethodTest.java %/SerializedLambdaTest.java ojluni/src/test/java/util/stream/boot%,$(ojtest_src_files)) |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 221 | # Include source code as part of JAR |
Joachim Sauer | ac12c75 | 2017-01-30 18:47:15 +0000 | [diff] [blame] | 222 | LOCAL_JAVA_RESOURCE_DIRS := ojluni/src/test/dist $(ojtest_resource_dirs) |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 223 | LOCAL_NO_STANDARD_LIBRARIES := true |
Tobias Thierer | d5e8f8c | 2016-12-22 12:25:26 +0000 | [diff] [blame] | 224 | LOCAL_JAVA_LIBRARIES := \ |
| 225 | bouncycastle \ |
| 226 | core-libart \ |
| 227 | core-oj \ |
| 228 | okhttp \ |
| 229 | testng |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 230 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Narayan Kamath | 85952e2 | 2017-06-14 17:23:34 +0100 | [diff] [blame] | 231 | LOCAL_JACK_FLAGS := $(local_jack_flags) |
Colin Cross | 96a5529 | 2016-12-21 16:42:56 -0800 | [diff] [blame] | 232 | LOCAL_DX_FLAGS := --core-library |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 233 | LOCAL_MODULE_TAGS := optional |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 234 | LOCAL_MODULE := core-ojtests-public |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 235 | LOCAL_ERROR_PRONE_FLAGS := -Xep:MissingOverride:OFF |
Andreas Gampe | 24a2017 | 2018-06-13 11:28:45 -0700 | [diff] [blame] | 236 | # Some tests have known overflow. To not have to add annotations, turn off the overflow check. |
| 237 | LOCAL_ERROR_PRONE_FLAGS += -Xep:ConstantOverflow:OFF |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 238 | include $(BUILD_JAVA_LIBRARY) |
| 239 | endif |
| 240 | |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 241 | # |
| 242 | # Build for the host. |
| 243 | # |
| 244 | |
Elliott Hughes | e983a0b | 2015-01-16 10:47:17 -0800 | [diff] [blame] | 245 | ifeq ($(HOST_OS),linux) |
| 246 | |
Paul Duffin | fe0ee8e | 2016-08-12 11:32:44 +0100 | [diff] [blame] | 247 | # Make the core-tests-hostdex library. |
Ian Rogers | 3deabd2 | 2014-05-23 15:12:42 -0700 | [diff] [blame] | 248 | ifeq ($(LIBCORE_SKIP_TESTS),) |
Brian Carlstrom | d39b1d6 | 2011-03-06 23:15:39 -0800 | [diff] [blame] | 249 | include $(CLEAR_VARS) |
Narayan Kamath | 51525b5 | 2013-11-15 18:02:54 +0000 | [diff] [blame] | 250 | LOCAL_SRC_FILES := $(test_src_files) |
Brian Carlstrom | d39b1d6 | 2011-03-06 23:15:39 -0800 | [diff] [blame] | 251 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
Neil Fuller | 9496b21 | 2014-09-04 11:11:56 +0100 | [diff] [blame] | 252 | LOCAL_NO_STANDARD_LIBRARIES := true |
Tobias Thierer | d5e8f8c | 2016-12-22 12:25:26 +0000 | [diff] [blame] | 253 | LOCAL_JAVA_LIBRARIES := \ |
| 254 | bouncycastle-hostdex \ |
| 255 | core-libart-hostdex \ |
| 256 | core-oj-hostdex \ |
| 257 | core-tests-support-hostdex \ |
| 258 | junit-hostdex \ |
| 259 | mockito-api-hostdex \ |
| 260 | okhttp-hostdex |
| 261 | LOCAL_STATIC_JAVA_LIBRARIES := \ |
Neil Fuller | f04b9af | 2017-05-24 11:48:12 +0100 | [diff] [blame] | 262 | archive-patcher-hostdex \ |
Tobias Thierer | d5e8f8c | 2016-12-22 12:25:26 +0000 | [diff] [blame] | 263 | core-test-rules-hostdex \ |
Neil Fuller | f04b9af | 2017-05-24 11:48:12 +0100 | [diff] [blame] | 264 | junit-params-hostdex \ |
Tobias Thierer | 62db9f9 | 2016-11-28 12:24:32 +0000 | [diff] [blame] | 265 | mockftpserver-hostdex \ |
Tobias Thierer | d5e8f8c | 2016-12-22 12:25:26 +0000 | [diff] [blame] | 266 | mockwebserver-host \ |
| 267 | nist-pkix-tests-host \ |
Tobias Thierer | 62db9f9 | 2016-11-28 12:24:32 +0000 | [diff] [blame] | 268 | slf4j-jdk14-hostdex \ |
Tobias Thierer | d5e8f8c | 2016-12-22 12:25:26 +0000 | [diff] [blame] | 269 | sqlite-jdbc-host \ |
Neil Fuller | f04b9af | 2017-05-24 11:48:12 +0100 | [diff] [blame] | 270 | tzdata-testing-hostdex |
Brian Carlstrom | d39b1d6 | 2011-03-06 23:15:39 -0800 | [diff] [blame] | 271 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Ying Wang | e79ac58 | 2012-08-23 11:25:27 -0700 | [diff] [blame] | 272 | LOCAL_MODULE_TAGS := optional |
Brian Carlstrom | d39b1d6 | 2011-03-06 23:15:39 -0800 | [diff] [blame] | 273 | LOCAL_MODULE := core-tests-hostdex |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 274 | LOCAL_ERROR_PRONE_FLAGS := -Xep:MissingOverride:OFF |
Narayan Kamath | 70e8ce8 | 2013-10-28 14:17:35 +0000 | [diff] [blame] | 275 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
Ian Rogers | 3deabd2 | 2014-05-23 15:12:42 -0700 | [diff] [blame] | 276 | endif |
Kenny Root | ba07db5 | 2013-08-29 13:40:35 -0700 | [diff] [blame] | 277 | |
Igor Murashkin | 6037000 | 2016-04-04 11:53:53 -0700 | [diff] [blame] | 278 | # Make the core-ojtests-hostdex library. |
Igor Murashkin | 4c65c01 | 2016-03-24 20:52:10 +0000 | [diff] [blame] | 279 | ifeq ($(LIBCORE_SKIP_TESTS),) |
| 280 | include $(CLEAR_VARS) |
| 281 | LOCAL_SRC_FILES := $(ojtest_src_files) |
| 282 | LOCAL_NO_STANDARD_LIBRARIES := true |
Tobias Thierer | d5e8f8c | 2016-12-22 12:25:26 +0000 | [diff] [blame] | 283 | LOCAL_JAVA_LIBRARIES := \ |
| 284 | bouncycastle-hostdex \ |
| 285 | core-libart-hostdex \ |
| 286 | core-oj-hostdex \ |
| 287 | okhttp-hostdex |
Igor Murashkin | 4c65c01 | 2016-03-24 20:52:10 +0000 | [diff] [blame] | 288 | LOCAL_STATIC_JAVA_LIBRARIES := testng-hostdex |
| 289 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Colin Cross | abbd52b | 2017-02-24 15:39:22 -0800 | [diff] [blame] | 290 | LOCAL_DX_FLAGS := --core-library |
Igor Murashkin | 4c65c01 | 2016-03-24 20:52:10 +0000 | [diff] [blame] | 291 | LOCAL_MODULE_TAGS := optional |
Igor Murashkin | 4c65c01 | 2016-03-24 20:52:10 +0000 | [diff] [blame] | 292 | LOCAL_MODULE := core-ojtests-hostdex |
Tobias Thierer | d042dbe | 2018-01-09 20:23:03 +0000 | [diff] [blame] | 293 | # ojluni/src/test/java/util/stream/{bootlib,boottest} |
| 294 | # contains tests that are in packages from java.base; |
| 295 | # By default, OpenJDK 9's javac will only compile such |
| 296 | # code if it's declared to also be in java.base at |
| 297 | # compile time. |
| 298 | # |
| 299 | # For now, we use --patch-module to put all sources |
| 300 | # and dependencies from this make target into java.base; |
| 301 | # other source directories in this make target are in |
| 302 | # packages not from java.base; if this becomes a proble |
| 303 | # in future, this could be addressed eg. by splitting |
| 304 | # boot{lib,test} out into a separate make target, |
| 305 | # deleting those tests or moving them to a different |
| 306 | # package. |
| 307 | LOCAL_PATCH_MODULE := java.base |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 308 | LOCAL_ERROR_PRONE_FLAGS := -Xep:MissingOverride:OFF |
Igor Murashkin | 4c65c01 | 2016-03-24 20:52:10 +0000 | [diff] [blame] | 309 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
| 310 | endif |
| 311 | |
Elliott Hughes | e983a0b | 2015-01-16 10:47:17 -0800 | [diff] [blame] | 312 | endif # HOST_OS == linux |
| 313 | |
Paul Duffin | 4321db4 | 2018-01-23 11:43:48 +0000 | [diff] [blame] | 314 | # Archive a copy of the classes.jar in SDK build. |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 315 | full_classes_jar := $(call intermediates-dir-for,JAVA_LIBRARIES,core.current.stubs,,COMMON)/classes.jar |
Paul Duffin | 4321db4 | 2018-01-23 11:43:48 +0000 | [diff] [blame] | 316 | $(call dist-for-goals,sdk win_sdk,$(full_classes_jar):core.current.stubs.jar) |