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 | # |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 91 | # Build for the target (device). |
| 92 | # |
| 93 | |
Kenny Root | 38375a4 | 2013-04-23 15:50:31 -0700 | [diff] [blame] | 94 | ifeq ($(LIBCORE_SKIP_TESTS),) |
Nicolas Geoffray | 2b42260 | 2017-03-01 10:49:31 +0000 | [diff] [blame] | 95 | # A guaranteed unstripped version of core-oj and core-libart. |
| 96 | # The build system may or may not strip the core-oj and core-libart jars, |
| 97 | # but these will not be stripped. See b/24535627. |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 98 | include $(CLEAR_VARS) |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 99 | LOCAL_SRC_FILES := $(patsubst $(LOCAL_PATH)/%,%,$(openjdk_java_files)) |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 100 | LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) |
| 101 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 102 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Narayan Kamath | 85952e2 | 2017-06-14 17:23:34 +0100 | [diff] [blame] | 103 | LOCAL_JACK_FLAGS := $(local_jack_flags) |
Colin Cross | 96a5529 | 2016-12-21 16:42:56 -0800 | [diff] [blame] | 104 | LOCAL_DX_FLAGS := --core-library |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 105 | LOCAL_MODULE_TAGS := optional |
| 106 | LOCAL_DEX_PREOPT := false |
| 107 | LOCAL_MODULE := core-oj-testdex |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 108 | LOCAL_JAVA_LIBRARIES := core-all |
| 109 | LOCAL_NOTICE_FILE := $(LOCAL_PATH)/ojluni/NOTICE |
Neil Fuller | 085fbff | 2017-03-30 18:18:11 +0100 | [diff] [blame] | 110 | LOCAL_REQUIRED_MODULES := tzdata tzlookup.xml |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 111 | LOCAL_CORE_LIBRARY := true |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 112 | include $(BUILD_JAVA_LIBRARY) |
| 113 | |
Paul Duffin | fe0ee8e | 2016-08-12 11:32:44 +0100 | [diff] [blame] | 114 | # Build libcore test rules for target |
| 115 | include $(CLEAR_VARS) |
| 116 | LOCAL_SRC_FILES := $(call all-java-files-under, dalvik/test-rules/src/main test-rules/src/main) |
| 117 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 118 | LOCAL_MODULE := core-test-rules |
Paul Duffin | c347df8 | 2016-11-29 12:17:05 +0000 | [diff] [blame] | 119 | LOCAL_JAVA_LIBRARIES := core-all |
| 120 | LOCAL_STATIC_JAVA_LIBRARIES := junit |
Paul Duffin | fe0ee8e | 2016-08-12 11:32:44 +0100 | [diff] [blame] | 121 | include $(BUILD_STATIC_JAVA_LIBRARY) |
| 122 | |
| 123 | # Build libcore test rules for host |
| 124 | include $(CLEAR_VARS) |
| 125 | LOCAL_SRC_FILES := $(call all-java-files-under, dalvik/test-rules/src/main test-rules/src/main) |
| 126 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 127 | LOCAL_MODULE := core-test-rules-hostdex |
Paul Duffin | 1eac8b3 | 2016-11-25 14:40:21 +0000 | [diff] [blame] | 128 | LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex |
| 129 | LOCAL_STATIC_JAVA_LIBRARIES := junit-hostdex |
Colin Cross | 5c173d7 | 2017-01-19 14:20:20 -0800 | [diff] [blame] | 130 | include $(BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY) |
Paul Duffin | fe0ee8e | 2016-08-12 11:32:44 +0100 | [diff] [blame] | 131 | |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 132 | include $(CLEAR_VARS) |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 133 | LOCAL_SRC_FILES := $(patsubst $(LOCAL_PATH)/%,%,$(non_openjdk_java_files) $(android_icu4j_src_files)) |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 134 | LOCAL_JAVA_RESOURCE_DIRS := $(android_icu4j_resource_dirs) |
| 135 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 136 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Narayan Kamath | 85952e2 | 2017-06-14 17:23:34 +0100 | [diff] [blame] | 137 | LOCAL_JACK_FLAGS := $(local_jack_flags) |
Colin Cross | 96a5529 | 2016-12-21 16:42:56 -0800 | [diff] [blame] | 138 | LOCAL_DX_FLAGS := --core-library |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 139 | LOCAL_MODULE_TAGS := optional |
| 140 | LOCAL_DEX_PREOPT := false |
| 141 | LOCAL_MODULE := core-libart-testdex |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 142 | LOCAL_JAVA_LIBRARIES := core-all |
| 143 | LOCAL_CORE_LIBRARY := true |
Neil Fuller | 085fbff | 2017-03-30 18:18:11 +0100 | [diff] [blame] | 144 | LOCAL_REQUIRED_MODULES := tzdata tzlookup.xml |
Andreas Gampe | 7859026 | 2015-09-30 11:55:03 -0700 | [diff] [blame] | 145 | include $(BUILD_JAVA_LIBRARY) |
| 146 | endif |
| 147 | |
| 148 | ifeq ($(LIBCORE_SKIP_TESTS),) |
Shubham Ajmera | cfcde6a | 2017-02-09 13:24:00 +0000 | [diff] [blame] | 149 | # Build a library just containing files from luni/src/test/filesystems for use in tests. |
| 150 | include $(CLEAR_VARS) |
| 151 | LOCAL_SRC_FILES := $(call all-java-files-under, luni/src/test/filesystems/src) |
| 152 | LOCAL_JAVA_RESOURCE_DIRS := luni/src/test/filesystems/resources |
| 153 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 154 | LOCAL_MODULE := filesystemstest |
| 155 | LOCAL_JAVA_LIBRARIES := core-oj core-libart |
| 156 | LOCAL_DEX_PREOPT := false |
| 157 | include $(BUILD_JAVA_LIBRARY) |
Dan Willemsen | 6a6398f | 2017-03-20 10:47:51 -0700 | [diff] [blame] | 158 | my_filesystemstest_jar := $(intermediates)/filesystemstest.jar |
| 159 | $(my_filesystemstest_jar): $(LOCAL_BUILT_MODULE) |
| 160 | $(call copy-file-to-target) |
Shubham Ajmera | cfcde6a | 2017-02-09 13:24:00 +0000 | [diff] [blame] | 161 | endif |
| 162 | |
| 163 | ifeq ($(LIBCORE_SKIP_TESTS),) |
Kenny Root | 38375a4 | 2013-04-23 15:50:31 -0700 | [diff] [blame] | 164 | # Make the core-tests library. |
| 165 | include $(CLEAR_VARS) |
Narayan Kamath | 51525b5 | 2013-11-15 18:02:54 +0000 | [diff] [blame] | 166 | LOCAL_SRC_FILES := $(test_src_files) |
Brian Carlstrom | 51ee38b | 2010-07-23 15:57:52 -0700 | [diff] [blame] | 167 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
Shubham Ajmera | cfcde6a | 2017-02-09 13:24:00 +0000 | [diff] [blame] | 168 | # Include individual dex.jar files (jars containing resources and a classes.dex) so that they |
| 169 | # be loaded by tests using ClassLoaders but are not in the main classes.dex. |
Dan Willemsen | 6a6398f | 2017-03-20 10:47:51 -0700 | [diff] [blame] | 170 | LOCAL_JAVA_RESOURCE_FILES := $(my_filesystemstest_jar) |
Brian Carlstrom | 51ee38b | 2010-07-23 15:57:52 -0700 | [diff] [blame] | 171 | LOCAL_NO_STANDARD_LIBRARIES := true |
Adam Vartanian | ce69636 | 2017-03-03 14:07:19 +0000 | [diff] [blame] | 172 | LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp bouncycastle |
Paul Duffin | fe0ee8e | 2016-08-12 11:32:44 +0100 | [diff] [blame] | 173 | LOCAL_STATIC_JAVA_LIBRARIES := \ |
Neil Fuller | f04b9af | 2017-05-24 11:48:12 +0100 | [diff] [blame] | 174 | archive-patcher \ |
Paul Duffin | fe0ee8e | 2016-08-12 11:32:44 +0100 | [diff] [blame] | 175 | core-test-rules \ |
| 176 | core-tests-support \ |
Neil Fuller | f04b9af | 2017-05-24 11:48:12 +0100 | [diff] [blame] | 177 | junit-params \ |
Tobias Thierer | 62db9f9 | 2016-11-28 12:24:32 +0000 | [diff] [blame] | 178 | mockftpserver \ |
Adam Vartanian | ce69636 | 2017-03-03 14:07:19 +0000 | [diff] [blame] | 179 | mockito-target \ |
Paul Duffin | fe0ee8e | 2016-08-12 11:32:44 +0100 | [diff] [blame] | 180 | mockwebserver \ |
| 181 | nist-pkix-tests \ |
Tobias Thierer | 62db9f9 | 2016-11-28 12:24:32 +0000 | [diff] [blame] | 182 | slf4j-jdk14 \ |
Neil Fuller | 8e0c349 | 2016-12-09 18:32:10 +0000 | [diff] [blame] | 183 | sqlite-jdbc \ |
Neil Fuller | f04b9af | 2017-05-24 11:48:12 +0100 | [diff] [blame] | 184 | tzdata-testing |
Elliott Hughes | d610834 | 2011-02-22 10:13:54 -0800 | [diff] [blame] | 185 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Narayan Kamath | 85952e2 | 2017-06-14 17:23:34 +0100 | [diff] [blame] | 186 | LOCAL_JACK_FLAGS := $(local_jack_flags) |
Sergio Giro | 2cdb68f | 2016-10-28 20:13:36 +0100 | [diff] [blame] | 187 | LOCAL_ERROR_PRONE_FLAGS := -Xep:TryFailThrowable:ERROR -Xep:ComparisonOutOfRange:ERROR |
Brian Carlstrom | b094af3 | 2010-05-28 17:37:37 -0700 | [diff] [blame] | 188 | LOCAL_MODULE := core-tests |
Jesse Wilson | 706d535 | 2010-06-08 17:20:09 -0700 | [diff] [blame] | 189 | include $(BUILD_STATIC_JAVA_LIBRARY) |
Elliott Hughes | c5cd6e8 | 2012-10-18 18:13:10 -0700 | [diff] [blame] | 190 | endif |
Jesse Wilson | 706d535 | 2010-06-08 17:20:09 -0700 | [diff] [blame] | 191 | |
Tsu Chiang Chuang | 808558f | 2013-08-21 11:46:49 -0700 | [diff] [blame] | 192 | ifeq ($(LIBCORE_SKIP_TESTS),) |
Kenny Root | b397b19 | 2013-08-29 14:24:47 -0700 | [diff] [blame] | 193 | # Make the core-tests-support library. |
| 194 | include $(CLEAR_VARS) |
| 195 | LOCAL_SRC_FILES := $(call all-test-java-files-under,support) |
| 196 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 197 | LOCAL_NO_STANDARD_LIBRARIES := true |
Paul Duffin | c347df8 | 2016-11-29 12:17:05 +0000 | [diff] [blame] | 198 | LOCAL_JAVA_LIBRARIES := core-oj core-libart junit bouncycastle |
Kenny Root | 0435fdb | 2016-03-30 12:52:38 -0700 | [diff] [blame] | 199 | LOCAL_STATIC_JAVA_LIBRARIES := bouncycastle-bcpkix bouncycastle-ocsp |
Kenny Root | b397b19 | 2013-08-29 14:24:47 -0700 | [diff] [blame] | 200 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Narayan Kamath | 85952e2 | 2017-06-14 17:23:34 +0100 | [diff] [blame] | 201 | LOCAL_JACK_FLAGS := $(local_jack_flags) |
Kenny Root | b397b19 | 2013-08-29 14:24:47 -0700 | [diff] [blame] | 202 | LOCAL_MODULE := core-tests-support |
Kenny Root | b397b19 | 2013-08-29 14:24:47 -0700 | [diff] [blame] | 203 | include $(BUILD_STATIC_JAVA_LIBRARY) |
| 204 | endif |
| 205 | |
| 206 | ifeq ($(LIBCORE_SKIP_TESTS),) |
Tsu Chiang Chuang | 808558f | 2013-08-21 11:46:49 -0700 | [diff] [blame] | 207 | # Make the jsr166-tests library. |
| 208 | include $(CLEAR_VARS) |
| 209 | LOCAL_SRC_FILES := $(call all-test-java-files-under, jsr166-tests) |
| 210 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 211 | LOCAL_NO_STANDARD_LIBRARIES := true |
Paul Duffin | c347df8 | 2016-11-29 12:17:05 +0000 | [diff] [blame] | 212 | LOCAL_JAVA_LIBRARIES := core-oj core-libart junit |
Tsu Chiang Chuang | 808558f | 2013-08-21 11:46:49 -0700 | [diff] [blame] | 213 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Narayan Kamath | 85952e2 | 2017-06-14 17:23:34 +0100 | [diff] [blame] | 214 | LOCAL_JACK_FLAGS := $(local_jack_flags) |
Tsu Chiang Chuang | 808558f | 2013-08-21 11:46:49 -0700 | [diff] [blame] | 215 | LOCAL_MODULE := jsr166-tests |
Tsu Chiang Chuang | 808558f | 2013-08-21 11:46:49 -0700 | [diff] [blame] | 216 | include $(BUILD_STATIC_JAVA_LIBRARY) |
| 217 | endif |
| 218 | |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 219 | # Make the core-ojtests library. |
| 220 | ifeq ($(LIBCORE_SKIP_TESTS),) |
| 221 | include $(CLEAR_VARS) |
Joachim Sauer | ac12c75 | 2017-01-30 18:47:15 +0000 | [diff] [blame] | 222 | LOCAL_JAVA_RESOURCE_DIRS := $(ojtest_resource_dirs) |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 223 | LOCAL_NO_STANDARD_LIBRARIES := true |
Narayan Kamath | d097a9b | 2016-09-22 17:07:15 +0100 | [diff] [blame] | 224 | LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp bouncycastle |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 225 | LOCAL_STATIC_JAVA_LIBRARIES := testng |
| 226 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Narayan Kamath | 85952e2 | 2017-06-14 17:23:34 +0100 | [diff] [blame] | 227 | LOCAL_JACK_FLAGS := $(local_jack_flags) |
Colin Cross | 96a5529 | 2016-12-21 16:42:56 -0800 | [diff] [blame] | 228 | LOCAL_DX_FLAGS := --core-library |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 229 | LOCAL_MODULE_TAGS := optional |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 230 | LOCAL_MODULE := core-ojtests |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 231 | # 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 |
| 232 | LOCAL_DEX_PREOPT := false # disable AOT preverification which breaks the build. it will still throw VerifyError at runtime. |
| 233 | include $(BUILD_JAVA_LIBRARY) |
| 234 | endif |
| 235 | |
| 236 | # Make the core-ojtests-public library. Excludes any private API tests. |
| 237 | ifeq ($(LIBCORE_SKIP_TESTS),) |
| 238 | include $(CLEAR_VARS) |
| 239 | # Filter out SerializedLambdaTest because it depends on stub classes and won't actually run. |
Joachim Sauer | 8aeb919 | 2017-01-06 17:05:35 +0000 | [diff] [blame] | 240 | 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. |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 241 | # Include source code as part of JAR |
Joachim Sauer | ac12c75 | 2017-01-30 18:47:15 +0000 | [diff] [blame] | 242 | LOCAL_JAVA_RESOURCE_DIRS := ojluni/src/test/dist $(ojtest_resource_dirs) |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 243 | LOCAL_NO_STANDARD_LIBRARIES := true |
Tobias Thierer | d5e8f8c | 2016-12-22 12:25:26 +0000 | [diff] [blame] | 244 | LOCAL_JAVA_LIBRARIES := \ |
| 245 | bouncycastle \ |
| 246 | core-libart \ |
| 247 | core-oj \ |
| 248 | okhttp \ |
| 249 | testng |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 250 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Narayan Kamath | 85952e2 | 2017-06-14 17:23:34 +0100 | [diff] [blame] | 251 | LOCAL_JACK_FLAGS := $(local_jack_flags) |
Colin Cross | 96a5529 | 2016-12-21 16:42:56 -0800 | [diff] [blame] | 252 | LOCAL_DX_FLAGS := --core-library |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 253 | LOCAL_MODULE_TAGS := optional |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 254 | LOCAL_MODULE := core-ojtests-public |
Igor Murashkin | c8b2c56 | 2016-04-27 15:43:33 -0700 | [diff] [blame] | 255 | # 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 |
| 256 | LOCAL_DEX_PREOPT := false # disable AOT preverification which breaks the build. it will still throw VerifyError at runtime. |
| 257 | include $(BUILD_JAVA_LIBRARY) |
| 258 | endif |
| 259 | |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 260 | # |
| 261 | # Build for the host. |
| 262 | # |
| 263 | |
Elliott Hughes | e983a0b | 2015-01-16 10:47:17 -0800 | [diff] [blame] | 264 | ifeq ($(HOST_OS),linux) |
| 265 | |
Paul Duffin | fe0ee8e | 2016-08-12 11:32:44 +0100 | [diff] [blame] | 266 | # Make the core-tests-hostdex library. |
Ian Rogers | 3deabd2 | 2014-05-23 15:12:42 -0700 | [diff] [blame] | 267 | ifeq ($(LIBCORE_SKIP_TESTS),) |
Brian Carlstrom | d39b1d6 | 2011-03-06 23:15:39 -0800 | [diff] [blame] | 268 | include $(CLEAR_VARS) |
Narayan Kamath | 51525b5 | 2013-11-15 18:02:54 +0000 | [diff] [blame] | 269 | LOCAL_SRC_FILES := $(test_src_files) |
Brian Carlstrom | d39b1d6 | 2011-03-06 23:15:39 -0800 | [diff] [blame] | 270 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
Neil Fuller | 9496b21 | 2014-09-04 11:11:56 +0100 | [diff] [blame] | 271 | LOCAL_NO_STANDARD_LIBRARIES := true |
Tobias Thierer | d5e8f8c | 2016-12-22 12:25:26 +0000 | [diff] [blame] | 272 | LOCAL_JAVA_LIBRARIES := \ |
| 273 | bouncycastle-hostdex \ |
| 274 | core-libart-hostdex \ |
| 275 | core-oj-hostdex \ |
| 276 | core-tests-support-hostdex \ |
| 277 | junit-hostdex \ |
| 278 | mockito-api-hostdex \ |
| 279 | okhttp-hostdex |
| 280 | LOCAL_STATIC_JAVA_LIBRARIES := \ |
Neil Fuller | f04b9af | 2017-05-24 11:48:12 +0100 | [diff] [blame] | 281 | archive-patcher-hostdex \ |
Tobias Thierer | d5e8f8c | 2016-12-22 12:25:26 +0000 | [diff] [blame] | 282 | core-test-rules-hostdex \ |
Neil Fuller | f04b9af | 2017-05-24 11:48:12 +0100 | [diff] [blame] | 283 | junit-params-hostdex \ |
Tobias Thierer | 62db9f9 | 2016-11-28 12:24:32 +0000 | [diff] [blame] | 284 | mockftpserver-hostdex \ |
Tobias Thierer | d5e8f8c | 2016-12-22 12:25:26 +0000 | [diff] [blame] | 285 | mockwebserver-host \ |
| 286 | nist-pkix-tests-host \ |
Tobias Thierer | 62db9f9 | 2016-11-28 12:24:32 +0000 | [diff] [blame] | 287 | slf4j-jdk14-hostdex \ |
Tobias Thierer | d5e8f8c | 2016-12-22 12:25:26 +0000 | [diff] [blame] | 288 | sqlite-jdbc-host \ |
Neil Fuller | f04b9af | 2017-05-24 11:48:12 +0100 | [diff] [blame] | 289 | tzdata-testing-hostdex |
Brian Carlstrom | d39b1d6 | 2011-03-06 23:15:39 -0800 | [diff] [blame] | 290 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Ying Wang | e79ac58 | 2012-08-23 11:25:27 -0700 | [diff] [blame] | 291 | LOCAL_MODULE_TAGS := optional |
Brian Carlstrom | d39b1d6 | 2011-03-06 23:15:39 -0800 | [diff] [blame] | 292 | LOCAL_MODULE := core-tests-hostdex |
Narayan Kamath | 70e8ce8 | 2013-10-28 14:17:35 +0000 | [diff] [blame] | 293 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
Ian Rogers | 3deabd2 | 2014-05-23 15:12:42 -0700 | [diff] [blame] | 294 | endif |
Kenny Root | ba07db5 | 2013-08-29 13:40:35 -0700 | [diff] [blame] | 295 | |
Ian Rogers | 3deabd2 | 2014-05-23 15:12:42 -0700 | [diff] [blame] | 296 | # Make the core-tests-support library. |
| 297 | ifeq ($(LIBCORE_SKIP_TESTS),) |
Kenny Root | ba07db5 | 2013-08-29 13:40:35 -0700 | [diff] [blame] | 298 | include $(CLEAR_VARS) |
| 299 | LOCAL_SRC_FILES := $(call all-test-java-files-under,support) |
| 300 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
Neil Fuller | 9496b21 | 2014-09-04 11:11:56 +0100 | [diff] [blame] | 301 | LOCAL_NO_STANDARD_LIBRARIES := true |
Tobias Thierer | d5e8f8c | 2016-12-22 12:25:26 +0000 | [diff] [blame] | 302 | LOCAL_JAVA_LIBRARIES := \ |
| 303 | bouncycastle-hostdex \ |
| 304 | core-libart-hostdex \ |
| 305 | core-oj-hostdex \ |
| 306 | junit-hostdex |
| 307 | LOCAL_STATIC_JAVA_LIBRARIES := \ |
| 308 | bouncycastle-bcpkix-hostdex \ |
| 309 | bouncycastle-ocsp-hostdex |
Kenny Root | ba07db5 | 2013-08-29 13:40:35 -0700 | [diff] [blame] | 310 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
| 311 | LOCAL_MODULE_TAGS := optional |
| 312 | LOCAL_MODULE := core-tests-support-hostdex |
Narayan Kamath | 70e8ce8 | 2013-10-28 14:17:35 +0000 | [diff] [blame] | 313 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
Elliott Hughes | 67cc34b | 2010-02-19 22:14:19 -0800 | [diff] [blame] | 314 | endif |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 315 | |
Igor Murashkin | 6037000 | 2016-04-04 11:53:53 -0700 | [diff] [blame] | 316 | # Make the core-ojtests-hostdex library. |
Igor Murashkin | 4c65c01 | 2016-03-24 20:52:10 +0000 | [diff] [blame] | 317 | ifeq ($(LIBCORE_SKIP_TESTS),) |
| 318 | include $(CLEAR_VARS) |
| 319 | LOCAL_SRC_FILES := $(ojtest_src_files) |
| 320 | LOCAL_NO_STANDARD_LIBRARIES := true |
Tobias Thierer | d5e8f8c | 2016-12-22 12:25:26 +0000 | [diff] [blame] | 321 | LOCAL_JAVA_LIBRARIES := \ |
| 322 | bouncycastle-hostdex \ |
| 323 | core-libart-hostdex \ |
| 324 | core-oj-hostdex \ |
| 325 | okhttp-hostdex |
Igor Murashkin | 4c65c01 | 2016-03-24 20:52:10 +0000 | [diff] [blame] | 326 | LOCAL_STATIC_JAVA_LIBRARIES := testng-hostdex |
| 327 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Colin Cross | abbd52b | 2017-02-24 15:39:22 -0800 | [diff] [blame] | 328 | LOCAL_DX_FLAGS := --core-library |
Igor Murashkin | 4c65c01 | 2016-03-24 20:52:10 +0000 | [diff] [blame] | 329 | LOCAL_MODULE_TAGS := optional |
Igor Murashkin | 4c65c01 | 2016-03-24 20:52:10 +0000 | [diff] [blame] | 330 | LOCAL_MODULE := core-ojtests-hostdex |
Igor Murashkin | 4c65c01 | 2016-03-24 20:52:10 +0000 | [diff] [blame] | 331 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
| 332 | endif |
| 333 | |
Elliott Hughes | e983a0b | 2015-01-16 10:47:17 -0800 | [diff] [blame] | 334 | endif # HOST_OS == linux |
| 335 | |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 336 | # |
| 337 | # Local droiddoc for faster libcore testing |
| 338 | # |
| 339 | # |
| 340 | # Run with: |
Elliott Hughes | 92fc63e | 2013-02-07 17:05:57 -0800 | [diff] [blame] | 341 | # mm -j32 libcore-docs |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 342 | # |
| 343 | # Main output: |
Elliott Hughes | 92fc63e | 2013-02-07 17:05:57 -0800 | [diff] [blame] | 344 | # ../out/target/common/docs/libcore/reference/packages.html |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 345 | # |
| 346 | # All text for proofreading (or running tools over): |
Elliott Hughes | 92fc63e | 2013-02-07 17:05:57 -0800 | [diff] [blame] | 347 | # ../out/target/common/docs/libcore-proofread.txt |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 348 | # |
| 349 | # TODO list of missing javadoc, etc: |
Elliott Hughes | 92fc63e | 2013-02-07 17:05:57 -0800 | [diff] [blame] | 350 | # ../out/target/common/docs/libcore-docs-todo.html |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 351 | # |
| 352 | # Rerun: |
Elliott Hughes | 92fc63e | 2013-02-07 17:05:57 -0800 | [diff] [blame] | 353 | # rm -rf ../out/target/common/docs/libcore-timestamp && mm -j32 libcore-docs |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 354 | # |
| 355 | include $(CLEAR_VARS) |
| 356 | |
| 357 | # for shared defintion of libcore_to_document |
| 358 | include $(LOCAL_PATH)/Docs.mk |
| 359 | |
Neil Fuller | 4259738 | 2015-10-07 11:00:01 +0100 | [diff] [blame] | 360 | # The libcore_to_document paths are relative to $(TOPDIR). We are in libcore so we must prepend |
| 361 | # ../ to make LOCAL_SRC_FILES relative to $(LOCAL_PATH). |
| 362 | LOCAL_SRC_FILES := $(addprefix ../, $(libcore_to_document)) |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 363 | # rerun doc generation without recompiling the java |
Elliott Hughes | d610834 | 2011-02-22 10:13:54 -0800 | [diff] [blame] | 364 | LOCAL_JAVACFLAGS := $(local_javac_flags) |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 365 | LOCAL_MODULE_CLASS:=JAVA_LIBRARIES |
| 366 | |
| 367 | LOCAL_MODULE := libcore |
| 368 | |
Elliott Hughes | b986327 | 2012-11-08 14:28:29 -0800 | [diff] [blame] | 369 | LOCAL_DROIDDOC_OPTIONS := \ |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 370 | -offlinemode \ |
| 371 | -title "libcore" \ |
| 372 | -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \ |
| 373 | -todo ../$(LOCAL_MODULE)-docs-todo.html \ |
Neil Fuller | 7881b2c | 2016-10-14 16:26:46 +0100 | [diff] [blame] | 374 | -knowntags ./libcore/known_oj_tags.txt \ |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 375 | -hdf android.whichdoc offline |
| 376 | |
Scott Main | 7554309 | 2017-03-08 12:50:03 -0800 | [diff] [blame] | 377 | LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk |
Brian Carlstrom | dc3c152 | 2011-01-05 17:48:05 -0800 | [diff] [blame] | 378 | |
| 379 | include $(BUILD_DROIDDOC) |