blob: 4ebf2d8d3cbe39b9c38f93785fa9b0f97490fde7 [file] [log] [blame]
Elliott Hughes7ee3a062010-02-18 17:20:15 -08001# -*- mode: makefile -*-
Dan Bornstein6ac43c22009-10-24 15:33:49 -07002# 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 Wilsond5d35262010-05-12 23:56:14 -070024# 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 Bornstein6ac43c22009-10-24 15:33:49 -070039
Jesse Wilson32cfe952010-05-04 16:36:03 -070040define all-test-java-files-under
Przemyslaw Szczepaniakebe4f192015-07-09 13:19:15 +010041$(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 Bornstein6ac43c22009-10-24 15:33:49 -070042endef
43
Dan Bornstein6ac43c22009-10-24 15:33:49 -070044define all-core-resource-dirs
45$(shell cd $(LOCAL_PATH) && ls -d */src/$(1)/{java,resources} 2> /dev/null)
46endef
47
Jesse Wilsond5d35262010-05-12 23:56:14 -070048# The Java files and their associated resources.
Narayan Kamath29c564f2015-07-30 12:05:42 +010049core_resource_dirs := \
50 luni/src/main/java \
51 ojluni/src/main/resources/
Joachim Sauerac12c752017-01-30 18:47:15 +000052test_resource_dirs := $(filter-out ojluni/%,$(call all-core-resource-dirs,test))
Paul Duffinfe0ee8e2016-08-12 11:32:44 +010053test_src_files := $(call all-test-java-files-under,dalvik dalvik/test-rules dom harmony-tests json luni xml)
Igor Murashkin4c65c012016-03-24 20:52:10 +000054ojtest_src_files := $(call all-test-java-files-under,ojluni)
Joachim Sauerac12c752017-01-30 18:47:15 +000055ojtest_resource_dirs := $(filter ojluni/%,$(call all-core-resource-dirs,test))
Dan Bornstein6ac43c22009-10-24 15:33:49 -070056
Jesse Wilson7898a912010-09-13 15:42:41 -070057ifeq ($(EMMA_INSTRUMENT),true)
Ying Wangff053c32012-08-21 17:20:51 -070058ifneq ($(EMMA_INSTRUMENT_STATIC),true)
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +000059 nojcore_src_files += $(call all-java-files-under, ../external/emma/core ../external/emma/pregenerated)
Jesse Wilson7898a912010-09-13 15:42:41 -070060 core_resource_dirs += ../external/emma/core/res ../external/emma/pregenerated/res
61endif
Ying Wangff053c32012-08-21 17:20:51 -070062endif
Jesse Wilson7898a912010-09-13 15:42:41 -070063
Elliott Hughes48d0b3f2010-12-14 09:48:52 -080064local_javac_flags=-encoding UTF-8
65#local_javac_flags+=-Xlint:all -Xlint:-serial,-deprecation,-unchecked
66local_javac_flags+=-Xmaxwarns 9999999
Dan Bornstein6ac43c22009-10-24 15:33:49 -070067
Narayan Kamath85952e22017-06-14 17:23:34 +010068# 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.
74ifneq (,$(PRODUCT_MINIMIZE_JAVA_DEBUG_INFO))
75ifneq (,$(filter userdebug user,$(TARGET_BUILD_VARIANT)))
76local_javac_flags+= -g:source,lines
77local_jack_flags+= -D jack.dex.debug.vars=false -D jack.dex.debug.vars.synthetic=false
78endif
79endif
Narayan Kamath1a0f1842015-09-07 12:59:53 +010080
Dan Bornstein6ac43c22009-10-24 15:33:49 -070081#
Narayan Kamathf37f7812015-04-01 09:34:24 +010082# ICU4J related rules.
83#
Neil Fuller72802992015-10-05 15:39:53 +010084# We compile android_icu4j along with core-libart because we're implementing parts of core-libart
85# in terms of android_icu4j.
86android_icu4j_root := ../external/icu/android_icu4j/
Paul Duffina98463d2016-02-25 16:02:42 +000087android_icu4j_src_files := $(call all-java-files-under,$(android_icu4j_root)/src/main/java)
Neil Fuller72802992015-10-05 15:39:53 +010088android_icu4j_resource_dirs := $(android_icu4j_root)/resources
Narayan Kamathf37f7812015-04-01 09:34:24 +010089
90#
Dan Bornstein6ac43c22009-10-24 15:33:49 -070091# Build for the target (device).
92#
93
Kenny Root38375a42013-04-23 15:50:31 -070094ifeq ($(LIBCORE_SKIP_TESTS),)
Nicolas Geoffray2b422602017-03-01 10:49:31 +000095# 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 Gampe78590262015-09-30 11:55:03 -070098include $(CLEAR_VARS)
Colin Crossaf0b54c2017-09-27 17:22:32 -070099LOCAL_SRC_FILES := $(patsubst $(LOCAL_PATH)/%,%,$(openjdk_java_files))
Andreas Gampe78590262015-09-30 11:55:03 -0700100LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs)
101LOCAL_NO_STANDARD_LIBRARIES := true
102LOCAL_JAVACFLAGS := $(local_javac_flags)
Narayan Kamath85952e22017-06-14 17:23:34 +0100103LOCAL_JACK_FLAGS := $(local_jack_flags)
Colin Cross96a55292016-12-21 16:42:56 -0800104LOCAL_DX_FLAGS := --core-library
Andreas Gampe78590262015-09-30 11:55:03 -0700105LOCAL_MODULE_TAGS := optional
106LOCAL_DEX_PREOPT := false
107LOCAL_MODULE := core-oj-testdex
Andreas Gampe78590262015-09-30 11:55:03 -0700108LOCAL_JAVA_LIBRARIES := core-all
109LOCAL_NOTICE_FILE := $(LOCAL_PATH)/ojluni/NOTICE
Neil Fuller085fbff2017-03-30 18:18:11 +0100110LOCAL_REQUIRED_MODULES := tzdata tzlookup.xml
Andreas Gampe78590262015-09-30 11:55:03 -0700111LOCAL_CORE_LIBRARY := true
Andreas Gampe78590262015-09-30 11:55:03 -0700112include $(BUILD_JAVA_LIBRARY)
113
Paul Duffinfe0ee8e2016-08-12 11:32:44 +0100114# Build libcore test rules for target
115include $(CLEAR_VARS)
116LOCAL_SRC_FILES := $(call all-java-files-under, dalvik/test-rules/src/main test-rules/src/main)
117LOCAL_NO_STANDARD_LIBRARIES := true
118LOCAL_MODULE := core-test-rules
Paul Duffinc347df82016-11-29 12:17:05 +0000119LOCAL_JAVA_LIBRARIES := core-all
120LOCAL_STATIC_JAVA_LIBRARIES := junit
Paul Duffinfe0ee8e2016-08-12 11:32:44 +0100121include $(BUILD_STATIC_JAVA_LIBRARY)
122
123# Build libcore test rules for host
124include $(CLEAR_VARS)
125LOCAL_SRC_FILES := $(call all-java-files-under, dalvik/test-rules/src/main test-rules/src/main)
126LOCAL_NO_STANDARD_LIBRARIES := true
127LOCAL_MODULE := core-test-rules-hostdex
Paul Duffin1eac8b32016-11-25 14:40:21 +0000128LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex
129LOCAL_STATIC_JAVA_LIBRARIES := junit-hostdex
Colin Cross5c173d72017-01-19 14:20:20 -0800130include $(BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY)
Paul Duffinfe0ee8e2016-08-12 11:32:44 +0100131
Andreas Gampe78590262015-09-30 11:55:03 -0700132include $(CLEAR_VARS)
Colin Crossaf0b54c2017-09-27 17:22:32 -0700133LOCAL_SRC_FILES := $(patsubst $(LOCAL_PATH)/%,%,$(non_openjdk_java_files) $(android_icu4j_src_files))
Andreas Gampe78590262015-09-30 11:55:03 -0700134LOCAL_JAVA_RESOURCE_DIRS := $(android_icu4j_resource_dirs)
135LOCAL_NO_STANDARD_LIBRARIES := true
136LOCAL_JAVACFLAGS := $(local_javac_flags)
Narayan Kamath85952e22017-06-14 17:23:34 +0100137LOCAL_JACK_FLAGS := $(local_jack_flags)
Colin Cross96a55292016-12-21 16:42:56 -0800138LOCAL_DX_FLAGS := --core-library
Andreas Gampe78590262015-09-30 11:55:03 -0700139LOCAL_MODULE_TAGS := optional
140LOCAL_DEX_PREOPT := false
141LOCAL_MODULE := core-libart-testdex
Andreas Gampe78590262015-09-30 11:55:03 -0700142LOCAL_JAVA_LIBRARIES := core-all
143LOCAL_CORE_LIBRARY := true
Neil Fuller085fbff2017-03-30 18:18:11 +0100144LOCAL_REQUIRED_MODULES := tzdata tzlookup.xml
Andreas Gampe78590262015-09-30 11:55:03 -0700145include $(BUILD_JAVA_LIBRARY)
146endif
147
148ifeq ($(LIBCORE_SKIP_TESTS),)
Shubham Ajmeracfcde6a2017-02-09 13:24:00 +0000149# Build a library just containing files from luni/src/test/filesystems for use in tests.
150include $(CLEAR_VARS)
151LOCAL_SRC_FILES := $(call all-java-files-under, luni/src/test/filesystems/src)
152LOCAL_JAVA_RESOURCE_DIRS := luni/src/test/filesystems/resources
153LOCAL_NO_STANDARD_LIBRARIES := true
154LOCAL_MODULE := filesystemstest
155LOCAL_JAVA_LIBRARIES := core-oj core-libart
156LOCAL_DEX_PREOPT := false
157include $(BUILD_JAVA_LIBRARY)
Dan Willemsen6a6398f2017-03-20 10:47:51 -0700158my_filesystemstest_jar := $(intermediates)/filesystemstest.jar
159$(my_filesystemstest_jar): $(LOCAL_BUILT_MODULE)
160 $(call copy-file-to-target)
Shubham Ajmeracfcde6a2017-02-09 13:24:00 +0000161endif
162
163ifeq ($(LIBCORE_SKIP_TESTS),)
Kenny Root38375a42013-04-23 15:50:31 -0700164# Make the core-tests library.
165include $(CLEAR_VARS)
Narayan Kamath51525b52013-11-15 18:02:54 +0000166LOCAL_SRC_FILES := $(test_src_files)
Brian Carlstrom51ee38b2010-07-23 15:57:52 -0700167LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
Shubham Ajmeracfcde6a2017-02-09 13:24:00 +0000168# 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 Willemsen6a6398f2017-03-20 10:47:51 -0700170LOCAL_JAVA_RESOURCE_FILES := $(my_filesystemstest_jar)
Brian Carlstrom51ee38b2010-07-23 15:57:52 -0700171LOCAL_NO_STANDARD_LIBRARIES := true
Adam Vartaniance696362017-03-03 14:07:19 +0000172LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp bouncycastle
Paul Duffinfe0ee8e2016-08-12 11:32:44 +0100173LOCAL_STATIC_JAVA_LIBRARIES := \
Neil Fullerf04b9af2017-05-24 11:48:12 +0100174 archive-patcher \
Paul Duffinfe0ee8e2016-08-12 11:32:44 +0100175 core-test-rules \
176 core-tests-support \
Neil Fullerf04b9af2017-05-24 11:48:12 +0100177 junit-params \
Tobias Thierer62db9f92016-11-28 12:24:32 +0000178 mockftpserver \
Adam Vartaniance696362017-03-03 14:07:19 +0000179 mockito-target \
Paul Duffinfe0ee8e2016-08-12 11:32:44 +0100180 mockwebserver \
181 nist-pkix-tests \
Tobias Thierer62db9f92016-11-28 12:24:32 +0000182 slf4j-jdk14 \
Neil Fuller8e0c3492016-12-09 18:32:10 +0000183 sqlite-jdbc \
Neil Fullerf04b9af2017-05-24 11:48:12 +0100184 tzdata-testing
Elliott Hughesd6108342011-02-22 10:13:54 -0800185LOCAL_JAVACFLAGS := $(local_javac_flags)
Narayan Kamath85952e22017-06-14 17:23:34 +0100186LOCAL_JACK_FLAGS := $(local_jack_flags)
Sergio Giro2cdb68f2016-10-28 20:13:36 +0100187LOCAL_ERROR_PRONE_FLAGS := -Xep:TryFailThrowable:ERROR -Xep:ComparisonOutOfRange:ERROR
Brian Carlstromb094af32010-05-28 17:37:37 -0700188LOCAL_MODULE := core-tests
Jesse Wilson706d5352010-06-08 17:20:09 -0700189include $(BUILD_STATIC_JAVA_LIBRARY)
Elliott Hughesc5cd6e82012-10-18 18:13:10 -0700190endif
Jesse Wilson706d5352010-06-08 17:20:09 -0700191
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700192ifeq ($(LIBCORE_SKIP_TESTS),)
Kenny Rootb397b192013-08-29 14:24:47 -0700193# Make the core-tests-support library.
194include $(CLEAR_VARS)
195LOCAL_SRC_FILES := $(call all-test-java-files-under,support)
196LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
197LOCAL_NO_STANDARD_LIBRARIES := true
Paul Duffinc347df82016-11-29 12:17:05 +0000198LOCAL_JAVA_LIBRARIES := core-oj core-libart junit bouncycastle
Kenny Root0435fdb2016-03-30 12:52:38 -0700199LOCAL_STATIC_JAVA_LIBRARIES := bouncycastle-bcpkix bouncycastle-ocsp
Kenny Rootb397b192013-08-29 14:24:47 -0700200LOCAL_JAVACFLAGS := $(local_javac_flags)
Narayan Kamath85952e22017-06-14 17:23:34 +0100201LOCAL_JACK_FLAGS := $(local_jack_flags)
Kenny Rootb397b192013-08-29 14:24:47 -0700202LOCAL_MODULE := core-tests-support
Kenny Rootb397b192013-08-29 14:24:47 -0700203include $(BUILD_STATIC_JAVA_LIBRARY)
204endif
205
206ifeq ($(LIBCORE_SKIP_TESTS),)
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700207# Make the jsr166-tests library.
208include $(CLEAR_VARS)
209LOCAL_SRC_FILES := $(call all-test-java-files-under, jsr166-tests)
210LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
211LOCAL_NO_STANDARD_LIBRARIES := true
Paul Duffinc347df82016-11-29 12:17:05 +0000212LOCAL_JAVA_LIBRARIES := core-oj core-libart junit
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700213LOCAL_JAVACFLAGS := $(local_javac_flags)
Narayan Kamath85952e22017-06-14 17:23:34 +0100214LOCAL_JACK_FLAGS := $(local_jack_flags)
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700215LOCAL_MODULE := jsr166-tests
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700216include $(BUILD_STATIC_JAVA_LIBRARY)
217endif
218
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700219# Make the core-ojtests library.
220ifeq ($(LIBCORE_SKIP_TESTS),)
221 include $(CLEAR_VARS)
Joachim Sauerac12c752017-01-30 18:47:15 +0000222 LOCAL_JAVA_RESOURCE_DIRS := $(ojtest_resource_dirs)
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700223 LOCAL_NO_STANDARD_LIBRARIES := true
Narayan Kamathd097a9b2016-09-22 17:07:15 +0100224 LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp bouncycastle
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700225 LOCAL_STATIC_JAVA_LIBRARIES := testng
226 LOCAL_JAVACFLAGS := $(local_javac_flags)
Narayan Kamath85952e22017-06-14 17:23:34 +0100227 LOCAL_JACK_FLAGS := $(local_jack_flags)
Colin Cross96a55292016-12-21 16:42:56 -0800228 LOCAL_DX_FLAGS := --core-library
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700229 LOCAL_MODULE_TAGS := optional
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700230 LOCAL_MODULE := core-ojtests
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700231 # 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)
234endif
235
236# Make the core-ojtests-public library. Excludes any private API tests.
237ifeq ($(LIBCORE_SKIP_TESTS),)
238 include $(CLEAR_VARS)
239 # Filter out SerializedLambdaTest because it depends on stub classes and won't actually run.
Joachim Sauer8aeb9192017-01-06 17:05:35 +0000240 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 Murashkinc8b2c562016-04-27 15:43:33 -0700241 # Include source code as part of JAR
Joachim Sauerac12c752017-01-30 18:47:15 +0000242 LOCAL_JAVA_RESOURCE_DIRS := ojluni/src/test/dist $(ojtest_resource_dirs)
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700243 LOCAL_NO_STANDARD_LIBRARIES := true
Tobias Thiererd5e8f8c2016-12-22 12:25:26 +0000244 LOCAL_JAVA_LIBRARIES := \
245 bouncycastle \
246 core-libart \
247 core-oj \
248 okhttp \
249 testng
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700250 LOCAL_JAVACFLAGS := $(local_javac_flags)
Narayan Kamath85952e22017-06-14 17:23:34 +0100251 LOCAL_JACK_FLAGS := $(local_jack_flags)
Colin Cross96a55292016-12-21 16:42:56 -0800252 LOCAL_DX_FLAGS := --core-library
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700253 LOCAL_MODULE_TAGS := optional
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700254 LOCAL_MODULE := core-ojtests-public
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700255 # 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)
258endif
259
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700260#
261# Build for the host.
262#
263
Elliott Hughese983a0b2015-01-16 10:47:17 -0800264ifeq ($(HOST_OS),linux)
265
Paul Duffinfe0ee8e2016-08-12 11:32:44 +0100266# Make the core-tests-hostdex library.
Ian Rogers3deabd22014-05-23 15:12:42 -0700267ifeq ($(LIBCORE_SKIP_TESTS),)
Brian Carlstromd39b1d62011-03-06 23:15:39 -0800268 include $(CLEAR_VARS)
Narayan Kamath51525b52013-11-15 18:02:54 +0000269 LOCAL_SRC_FILES := $(test_src_files)
Brian Carlstromd39b1d62011-03-06 23:15:39 -0800270 LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
Neil Fuller9496b212014-09-04 11:11:56 +0100271 LOCAL_NO_STANDARD_LIBRARIES := true
Tobias Thiererd5e8f8c2016-12-22 12:25:26 +0000272 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 Fullerf04b9af2017-05-24 11:48:12 +0100281 archive-patcher-hostdex \
Tobias Thiererd5e8f8c2016-12-22 12:25:26 +0000282 core-test-rules-hostdex \
Neil Fullerf04b9af2017-05-24 11:48:12 +0100283 junit-params-hostdex \
Tobias Thierer62db9f92016-11-28 12:24:32 +0000284 mockftpserver-hostdex \
Tobias Thiererd5e8f8c2016-12-22 12:25:26 +0000285 mockwebserver-host \
286 nist-pkix-tests-host \
Tobias Thierer62db9f92016-11-28 12:24:32 +0000287 slf4j-jdk14-hostdex \
Tobias Thiererd5e8f8c2016-12-22 12:25:26 +0000288 sqlite-jdbc-host \
Neil Fullerf04b9af2017-05-24 11:48:12 +0100289 tzdata-testing-hostdex
Brian Carlstromd39b1d62011-03-06 23:15:39 -0800290 LOCAL_JAVACFLAGS := $(local_javac_flags)
Ying Wange79ac582012-08-23 11:25:27 -0700291 LOCAL_MODULE_TAGS := optional
Brian Carlstromd39b1d62011-03-06 23:15:39 -0800292 LOCAL_MODULE := core-tests-hostdex
Narayan Kamath70e8ce82013-10-28 14:17:35 +0000293 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
Ian Rogers3deabd22014-05-23 15:12:42 -0700294endif
Kenny Rootba07db52013-08-29 13:40:35 -0700295
Ian Rogers3deabd22014-05-23 15:12:42 -0700296# Make the core-tests-support library.
297ifeq ($(LIBCORE_SKIP_TESTS),)
Kenny Rootba07db52013-08-29 13:40:35 -0700298 include $(CLEAR_VARS)
299 LOCAL_SRC_FILES := $(call all-test-java-files-under,support)
300 LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
Neil Fuller9496b212014-09-04 11:11:56 +0100301 LOCAL_NO_STANDARD_LIBRARIES := true
Tobias Thiererd5e8f8c2016-12-22 12:25:26 +0000302 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 Rootba07db52013-08-29 13:40:35 -0700310 LOCAL_JAVACFLAGS := $(local_javac_flags)
311 LOCAL_MODULE_TAGS := optional
312 LOCAL_MODULE := core-tests-support-hostdex
Narayan Kamath70e8ce82013-10-28 14:17:35 +0000313 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
Elliott Hughes67cc34b2010-02-19 22:14:19 -0800314endif
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800315
Igor Murashkin60370002016-04-04 11:53:53 -0700316# Make the core-ojtests-hostdex library.
Igor Murashkin4c65c012016-03-24 20:52:10 +0000317ifeq ($(LIBCORE_SKIP_TESTS),)
318 include $(CLEAR_VARS)
319 LOCAL_SRC_FILES := $(ojtest_src_files)
320 LOCAL_NO_STANDARD_LIBRARIES := true
Tobias Thiererd5e8f8c2016-12-22 12:25:26 +0000321 LOCAL_JAVA_LIBRARIES := \
322 bouncycastle-hostdex \
323 core-libart-hostdex \
324 core-oj-hostdex \
325 okhttp-hostdex
Igor Murashkin4c65c012016-03-24 20:52:10 +0000326 LOCAL_STATIC_JAVA_LIBRARIES := testng-hostdex
327 LOCAL_JAVACFLAGS := $(local_javac_flags)
Colin Crossabbd52b2017-02-24 15:39:22 -0800328 LOCAL_DX_FLAGS := --core-library
Igor Murashkin4c65c012016-03-24 20:52:10 +0000329 LOCAL_MODULE_TAGS := optional
Igor Murashkin4c65c012016-03-24 20:52:10 +0000330 LOCAL_MODULE := core-ojtests-hostdex
Igor Murashkin4c65c012016-03-24 20:52:10 +0000331 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
332endif
333
Elliott Hughese983a0b2015-01-16 10:47:17 -0800334endif # HOST_OS == linux
335
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800336#
337# Local droiddoc for faster libcore testing
338#
339#
340# Run with:
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800341# mm -j32 libcore-docs
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800342#
343# Main output:
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800344# ../out/target/common/docs/libcore/reference/packages.html
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800345#
346# All text for proofreading (or running tools over):
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800347# ../out/target/common/docs/libcore-proofread.txt
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800348#
349# TODO list of missing javadoc, etc:
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800350# ../out/target/common/docs/libcore-docs-todo.html
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800351#
352# Rerun:
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800353# rm -rf ../out/target/common/docs/libcore-timestamp && mm -j32 libcore-docs
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800354#
355include $(CLEAR_VARS)
356
357# for shared defintion of libcore_to_document
358include $(LOCAL_PATH)/Docs.mk
359
Neil Fuller42597382015-10-07 11:00:01 +0100360# 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).
362LOCAL_SRC_FILES := $(addprefix ../, $(libcore_to_document))
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800363# rerun doc generation without recompiling the java
Elliott Hughesd6108342011-02-22 10:13:54 -0800364LOCAL_JAVACFLAGS := $(local_javac_flags)
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800365LOCAL_MODULE_CLASS:=JAVA_LIBRARIES
366
367LOCAL_MODULE := libcore
368
Elliott Hughesb9863272012-11-08 14:28:29 -0800369LOCAL_DROIDDOC_OPTIONS := \
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800370 -offlinemode \
371 -title "libcore" \
372 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
373 -todo ../$(LOCAL_MODULE)-docs-todo.html \
Neil Fuller7881b2c2016-10-14 16:26:46 +0100374 -knowntags ./libcore/known_oj_tags.txt \
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800375 -hdf android.whichdoc offline
376
Scott Main75543092017-03-08 12:50:03 -0800377LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=external/doclava/res/assets/templates-sdk
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800378
379include $(BUILD_DROIDDOC)