blob: 211db857dcacc12ebe7e090370c40a00e9b5fbca [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
Narayan Kamath0a57ec22015-07-24 14:34:02 +010040include $(LOCAL_PATH)/openjdk_java_files.mk
41include $(LOCAL_PATH)/non_openjdk_java_files.mk
Jesse Wilson32cfe952010-05-04 16:36:03 -070042
43define all-test-java-files-under
Przemyslaw Szczepaniakebe4f192015-07-09 13:19:15 +010044$(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 -070045endef
46
Dan Bornstein6ac43c22009-10-24 15:33:49 -070047define all-core-resource-dirs
48$(shell cd $(LOCAL_PATH) && ls -d */src/$(1)/{java,resources} 2> /dev/null)
49endef
50
Jesse Wilsond5d35262010-05-12 23:56:14 -070051# The Java files and their associated resources.
Narayan Kamath29c564f2015-07-30 12:05:42 +010052core_resource_dirs := \
53 luni/src/main/java \
54 ojluni/src/main/resources/
Dan Bornstein6ac43c22009-10-24 15:33:49 -070055test_resource_dirs := $(call all-core-resource-dirs,test)
Paul Duffinfe0ee8e2016-08-12 11:32:44 +010056test_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 +000057ojtest_src_files := $(call all-test-java-files-under,ojluni)
Dan Bornstein6ac43c22009-10-24 15:33:49 -070058
Jesse Wilson7898a912010-09-13 15:42:41 -070059ifeq ($(EMMA_INSTRUMENT),true)
Ying Wangff053c32012-08-21 17:20:51 -070060ifneq ($(EMMA_INSTRUMENT_STATIC),true)
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +000061 nojcore_src_files += $(call all-java-files-under, ../external/emma/core ../external/emma/pregenerated)
Jesse Wilson7898a912010-09-13 15:42:41 -070062 core_resource_dirs += ../external/emma/core/res ../external/emma/pregenerated/res
63endif
Ying Wangff053c32012-08-21 17:20:51 -070064endif
Jesse Wilson7898a912010-09-13 15:42:41 -070065
Elliott Hughes48d0b3f2010-12-14 09:48:52 -080066local_javac_flags=-encoding UTF-8
67#local_javac_flags+=-Xlint:all -Xlint:-serial,-deprecation,-unchecked
68local_javac_flags+=-Xmaxwarns 9999999
Dan Bornstein6ac43c22009-10-24 15:33:49 -070069
Narayan Kamath1a0f1842015-09-07 12:59:53 +010070
Dan Bornstein6ac43c22009-10-24 15:33:49 -070071#
Narayan Kamathf37f7812015-04-01 09:34:24 +010072# ICU4J related rules.
73#
Neil Fuller72802992015-10-05 15:39:53 +010074# We compile android_icu4j along with core-libart because we're implementing parts of core-libart
75# in terms of android_icu4j.
76android_icu4j_root := ../external/icu/android_icu4j/
Paul Duffina98463d2016-02-25 16:02:42 +000077android_icu4j_src_files := $(call all-java-files-under,$(android_icu4j_root)/src/main/java)
Neil Fuller72802992015-10-05 15:39:53 +010078android_icu4j_resource_dirs := $(android_icu4j_root)/resources
Narayan Kamathf37f7812015-04-01 09:34:24 +010079
80#
Dan Bornstein6ac43c22009-10-24 15:33:49 -070081# Build for the target (device).
82#
83
Dan Bornstein6ac43c22009-10-24 15:33:49 -070084include $(CLEAR_VARS)
Neil Fuller7d6a54c2016-01-27 21:48:51 +000085LOCAL_SRC_FILES := $(openjdk_java_files) $(non_openjdk_java_files) $(android_icu4j_src_files) $(openjdk_lambda_stub_files)
Neil Fuller72802992015-10-05 15:39:53 +010086LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) $(android_icu4j_resource_dirs)
Brian Carlstrom3711c212013-06-25 15:59:29 -070087LOCAL_NO_STANDARD_LIBRARIES := true
88LOCAL_JAVACFLAGS := $(local_javac_flags)
Brian Carlstrom3711c212013-06-25 15:59:29 -070089LOCAL_MODULE_TAGS := optional
Neil Fuller6c8e0ae2016-01-27 14:28:20 +000090LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +000091LOCAL_MODULE := core-all
Brian Carlstrom3711c212013-06-25 15:59:29 -070092LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
93LOCAL_REQUIRED_MODULES := tzdata
Piotr Jastrzebski5c3c9df2015-04-20 10:56:00 +010094LOCAL_CORE_LIBRARY := true
Narayan Kamath0ebbfbd2015-07-30 15:01:19 +010095LOCAL_UNINSTALLABLE_MODULE := true
Brian Carlstrom3711c212013-06-25 15:59:29 -070096include $(BUILD_JAVA_LIBRARY)
Dan Bornstein6ac43c22009-10-24 15:33:49 -070097
Narayan Kamathf41eec82015-11-20 12:39:23 +000098include $(CLEAR_VARS)
Narayan Kamath0a57ec22015-07-24 14:34:02 +010099LOCAL_SRC_FILES := $(openjdk_java_files)
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000100LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs)
Narayan Kamathf41eec82015-11-20 12:39:23 +0000101LOCAL_NO_STANDARD_LIBRARIES := true
102LOCAL_JAVACFLAGS := $(local_javac_flags)
Narayan Kamathf41eec82015-11-20 12:39:23 +0000103LOCAL_MODULE_TAGS := optional
Neil Fuller6c8e0ae2016-01-27 14:28:20 +0000104LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Narayan Kamathf41eec82015-11-20 12:39:23 +0000105LOCAL_MODULE := core-oj
Narayan Kamathf41eec82015-11-20 12:39:23 +0000106LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
Narayan Kamath09f993b2015-11-18 09:28:42 +0000107LOCAL_JAVA_LIBRARIES := core-all
Narayan Kamath558a2d12015-12-22 14:37:40 +0000108LOCAL_NOTICE_FILE := $(LOCAL_PATH)/ojluni/NOTICE
Narayan Kamathf41eec82015-11-20 12:39:23 +0000109LOCAL_REQUIRED_MODULES := tzdata
110LOCAL_CORE_LIBRARY := true
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000111include $(BUILD_JAVA_LIBRARY)
112
113# Definitions to make the core library.
114include $(CLEAR_VARS)
Przemyslaw Szczepaniak70b617f2015-11-20 12:01:45 +0000115LOCAL_SRC_FILES := $(non_openjdk_java_files) $(android_icu4j_src_files)
Narayan Kamatha61daf42015-11-24 13:31:36 +0000116LOCAL_JAVA_RESOURCE_DIRS := $(android_icu4j_resource_dirs)
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700117LOCAL_NO_STANDARD_LIBRARIES := true
118LOCAL_JAVACFLAGS := $(local_javac_flags)
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700119LOCAL_MODULE_TAGS := optional
Neil Fuller6c8e0ae2016-01-27 14:28:20 +0000120LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700121LOCAL_MODULE := core-libart
Narayan Kamath647e4a62015-10-02 10:22:16 +0100122LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/JavaLibrary.mk
Narayan Kamath09f993b2015-11-18 09:28:42 +0000123LOCAL_JAVA_LIBRARIES := core-all
Sebastien Hertz827e3d42016-03-24 09:43:45 +0100124ifeq ($(EMMA_INSTRUMENT),true)
125ifneq ($(EMMA_INSTRUMENT_STATIC),true)
126 # For instrumented build, include Jacoco classes into core-libart.
127 LOCAL_STATIC_JAVA_LIBRARIES := jacocoagent
128endif # EMMA_INSTRUMENT_STATIC
129endif # EMMA_INSTRUMENT
Narayan Kamathb9853192015-09-02 13:38:48 +0100130LOCAL_CORE_LIBRARY := true
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700131LOCAL_REQUIRED_MODULES := tzdata
Narayan Kamathf41eec82015-11-20 12:39:23 +0000132include $(BUILD_JAVA_LIBRARY)
133
Neil Fuller668d3462016-02-01 18:14:45 +0000134# A library that exists to satisfy javac when
135# compiling source code that contains lambdas.
136include $(CLEAR_VARS)
Narayan Kamath3c9b6312016-08-02 12:37:59 +0100137LOCAL_SRC_FILES := $(openjdk_lambda_stub_files) $(openjdk_lambda_duplicate_stub_files)
Neil Fuller668d3462016-02-01 18:14:45 +0000138LOCAL_NO_STANDARD_LIBRARIES := true
139LOCAL_JAVACFLAGS := $(local_javac_flags)
Neil Fuller668d3462016-02-01 18:14:45 +0000140LOCAL_MODULE_TAGS := optional
141LOCAL_JAVA_LANGUAGE_VERSION := 1.8
142LOCAL_MODULE := core-lambda-stubs
143LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
144LOCAL_JAVA_LIBRARIES := core-all
145LOCAL_NOTICE_FILE := $(LOCAL_PATH)/ojluni/NOTICE
146LOCAL_CORE_LIBRARY := true
147LOCAL_UNINSTALLABLE_MODULE := true
148include $(BUILD_JAVA_LIBRARY)
149
Kenny Root38375a42013-04-23 15:50:31 -0700150ifeq ($(LIBCORE_SKIP_TESTS),)
Andreas Gampe78590262015-09-30 11:55:03 -0700151# A guaranteed unstripped version of core-oj and core-libart. This is required for ART testing in
152# preopted configurations. See b/24535627.
153include $(CLEAR_VARS)
154LOCAL_SRC_FILES := $(openjdk_java_files)
155LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs)
156LOCAL_NO_STANDARD_LIBRARIES := true
157LOCAL_JAVACFLAGS := $(local_javac_flags)
Andreas Gampe78590262015-09-30 11:55:03 -0700158LOCAL_MODULE_TAGS := optional
159LOCAL_DEX_PREOPT := false
Neil Fuller6c8e0ae2016-01-27 14:28:20 +0000160LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Andreas Gampe78590262015-09-30 11:55:03 -0700161LOCAL_MODULE := core-oj-testdex
162LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
163LOCAL_JAVA_LIBRARIES := core-all
164LOCAL_NOTICE_FILE := $(LOCAL_PATH)/ojluni/NOTICE
165LOCAL_REQUIRED_MODULES := tzdata
166LOCAL_CORE_LIBRARY := true
Andreas Gampe78590262015-09-30 11:55:03 -0700167include $(BUILD_JAVA_LIBRARY)
168
Paul Duffinfe0ee8e2016-08-12 11:32:44 +0100169# Build libcore test rules for target
170include $(CLEAR_VARS)
171LOCAL_SRC_FILES := $(call all-java-files-under, dalvik/test-rules/src/main test-rules/src/main)
172LOCAL_NO_STANDARD_LIBRARIES := true
173LOCAL_MODULE := core-test-rules
Paul Duffinc347df82016-11-29 12:17:05 +0000174LOCAL_JAVA_LIBRARIES := core-all
175LOCAL_STATIC_JAVA_LIBRARIES := junit
Paul Duffinfe0ee8e2016-08-12 11:32:44 +0100176include $(BUILD_STATIC_JAVA_LIBRARY)
177
178# Build libcore test rules for host
179include $(CLEAR_VARS)
180LOCAL_SRC_FILES := $(call all-java-files-under, dalvik/test-rules/src/main test-rules/src/main)
181LOCAL_NO_STANDARD_LIBRARIES := true
182LOCAL_MODULE := core-test-rules-hostdex
Paul Duffin1eac8b32016-11-25 14:40:21 +0000183LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex
184LOCAL_STATIC_JAVA_LIBRARIES := junit-hostdex
Colin Cross5c173d72017-01-19 14:20:20 -0800185include $(BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY)
Paul Duffinfe0ee8e2016-08-12 11:32:44 +0100186
Andreas Gampe78590262015-09-30 11:55:03 -0700187include $(CLEAR_VARS)
188LOCAL_SRC_FILES := $(non_openjdk_java_files) $(android_icu4j_src_files)
189LOCAL_JAVA_RESOURCE_DIRS := $(android_icu4j_resource_dirs)
190LOCAL_NO_STANDARD_LIBRARIES := true
191LOCAL_JAVACFLAGS := $(local_javac_flags)
Andreas Gampe78590262015-09-30 11:55:03 -0700192LOCAL_MODULE_TAGS := optional
193LOCAL_DEX_PREOPT := false
Neil Fuller6c8e0ae2016-01-27 14:28:20 +0000194LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Andreas Gampe78590262015-09-30 11:55:03 -0700195LOCAL_MODULE := core-libart-testdex
196LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/JavaLibrary.mk
197LOCAL_JAVA_LIBRARIES := core-all
198LOCAL_CORE_LIBRARY := true
199LOCAL_REQUIRED_MODULES := tzdata
200include $(BUILD_JAVA_LIBRARY)
201endif
202
203ifeq ($(LIBCORE_SKIP_TESTS),)
Kenny Root38375a42013-04-23 15:50:31 -0700204# Make the core-tests library.
205include $(CLEAR_VARS)
Narayan Kamath51525b52013-11-15 18:02:54 +0000206LOCAL_SRC_FILES := $(test_src_files)
Brian Carlstrom51ee38b2010-07-23 15:57:52 -0700207LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
208LOCAL_NO_STANDARD_LIBRARIES := true
Paul Duffinc347df82016-11-29 12:17:05 +0000209LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp junit bouncycastle mockito-target
Paul Duffinfe0ee8e2016-08-12 11:32:44 +0100210LOCAL_STATIC_JAVA_LIBRARIES := \
211 core-test-rules \
212 core-tests-support \
Tobias Thierer62db9f92016-11-28 12:24:32 +0000213 mockftpserver \
Paul Duffinfe0ee8e2016-08-12 11:32:44 +0100214 mockwebserver \
215 nist-pkix-tests \
Tobias Thierer62db9f92016-11-28 12:24:32 +0000216 slf4j-jdk14 \
Neil Fuller8e0c3492016-12-09 18:32:10 +0000217 sqlite-jdbc \
218 tzdata-testing
Elliott Hughesd6108342011-02-22 10:13:54 -0800219LOCAL_JAVACFLAGS := $(local_javac_flags)
Paul Duffin6be83e42016-09-26 12:56:02 +0100220LOCAL_ERROR_PRONE_FLAGS := -Xep:TryFailThrowable:ERROR
Neil Fuller668d3462016-02-01 18:14:45 +0000221LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Brian Carlstromb094af32010-05-28 17:37:37 -0700222LOCAL_MODULE := core-tests
Elliott Hughes73d3e262012-08-28 17:56:09 -0700223LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
Jesse Wilson706d5352010-06-08 17:20:09 -0700224include $(BUILD_STATIC_JAVA_LIBRARY)
Elliott Hughesc5cd6e82012-10-18 18:13:10 -0700225endif
Jesse Wilson706d5352010-06-08 17:20:09 -0700226
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700227ifeq ($(LIBCORE_SKIP_TESTS),)
Kenny Rootb397b192013-08-29 14:24:47 -0700228# Make the core-tests-support library.
229include $(CLEAR_VARS)
230LOCAL_SRC_FILES := $(call all-test-java-files-under,support)
231LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
232LOCAL_NO_STANDARD_LIBRARIES := true
Paul Duffinc347df82016-11-29 12:17:05 +0000233LOCAL_JAVA_LIBRARIES := core-oj core-libart junit bouncycastle
Kenny Root0435fdb2016-03-30 12:52:38 -0700234LOCAL_STATIC_JAVA_LIBRARIES := bouncycastle-bcpkix bouncycastle-ocsp
Kenny Rootb397b192013-08-29 14:24:47 -0700235LOCAL_JAVACFLAGS := $(local_javac_flags)
Kenny Rootb397b192013-08-29 14:24:47 -0700236LOCAL_MODULE := core-tests-support
237LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
238include $(BUILD_STATIC_JAVA_LIBRARY)
239endif
240
241ifeq ($(LIBCORE_SKIP_TESTS),)
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700242# Make the jsr166-tests library.
243include $(CLEAR_VARS)
244LOCAL_SRC_FILES := $(call all-test-java-files-under, jsr166-tests)
245LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
246LOCAL_NO_STANDARD_LIBRARIES := true
Paul Duffinc347df82016-11-29 12:17:05 +0000247LOCAL_JAVA_LIBRARIES := core-oj core-libart junit
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700248LOCAL_JAVACFLAGS := $(local_javac_flags)
249LOCAL_MODULE := jsr166-tests
Przemyslaw Szczepaniak087f0ca2016-03-15 12:38:36 +0000250LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700251LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
252include $(BUILD_STATIC_JAVA_LIBRARY)
253endif
254
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700255# Make the core-ojtests library.
256ifeq ($(LIBCORE_SKIP_TESTS),)
257 include $(CLEAR_VARS)
Joachim Sauer8c572572016-12-20 15:45:10 +0000258 LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700259 LOCAL_NO_STANDARD_LIBRARIES := true
Narayan Kamathd097a9b2016-09-22 17:07:15 +0100260 LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp bouncycastle
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700261 LOCAL_STATIC_JAVA_LIBRARIES := testng
262 LOCAL_JAVACFLAGS := $(local_javac_flags)
263 LOCAL_MODULE_TAGS := optional
264 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
265 LOCAL_MODULE := core-ojtests
266 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
267 # 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
268 LOCAL_DEX_PREOPT := false # disable AOT preverification which breaks the build. it will still throw VerifyError at runtime.
269 include $(BUILD_JAVA_LIBRARY)
270endif
271
272# Make the core-ojtests-public library. Excludes any private API tests.
273ifeq ($(LIBCORE_SKIP_TESTS),)
274 include $(CLEAR_VARS)
275 # Filter out SerializedLambdaTest because it depends on stub classes and won't actually run.
Joachim Sauer8aeb9192017-01-06 17:05:35 +0000276 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 -0700277 # Include source code as part of JAR
Joachim Sauer8c572572016-12-20 15:45:10 +0000278 LOCAL_JAVA_RESOURCE_DIRS := ojluni/src/test/dist $(test_resource_dirs)
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700279 LOCAL_NO_STANDARD_LIBRARIES := true
Tobias Thiererd5e8f8c2016-12-22 12:25:26 +0000280 LOCAL_JAVA_LIBRARIES := \
281 bouncycastle \
282 core-libart \
283 core-oj \
284 okhttp \
285 testng
Igor Murashkinc8b2c562016-04-27 15:43:33 -0700286 LOCAL_JAVACFLAGS := $(local_javac_flags)
287 LOCAL_MODULE_TAGS := optional
288 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
289 LOCAL_MODULE := core-ojtests-public
290 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
291 # 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
292 LOCAL_DEX_PREOPT := false # disable AOT preverification which breaks the build. it will still throw VerifyError at runtime.
293 include $(BUILD_JAVA_LIBRARY)
294endif
295
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700296#
297# Build for the host.
298#
299
Elliott Hughese983a0b2015-01-16 10:47:17 -0800300ifeq ($(HOST_OS),linux)
301
Ian Rogers3deabd22014-05-23 15:12:42 -0700302include $(CLEAR_VARS)
Narayan Kamath0a57ec22015-07-24 14:34:02 +0100303LOCAL_SRC_FILES := $(call all-java-files-under, dex/src/main)
Tsu Chiang Chuang25963ae2013-07-23 16:39:20 -0700304LOCAL_MODULE_TAGS := optional
305LOCAL_MODULE := dex-host
306include $(BUILD_HOST_JAVA_LIBRARY)
307
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000308include $(CLEAR_VARS)
Neil Fuller7d6a54c2016-01-27 21:48:51 +0000309LOCAL_SRC_FILES := $(non_openjdk_java_files) $(openjdk_java_files) $(android_icu4j_src_files) $(openjdk_lambda_stub_files)
Przemyslaw Szczepaniake3b37c22015-09-28 16:24:00 +0100310LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs)
Ian Rogers3deabd22014-05-23 15:12:42 -0700311LOCAL_NO_STANDARD_LIBRARIES := true
312LOCAL_JAVACFLAGS := $(local_javac_flags)
Ian Rogers3deabd22014-05-23 15:12:42 -0700313LOCAL_MODULE_TAGS := optional
Neil Fuller6c8e0ae2016-01-27 14:28:20 +0000314LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000315LOCAL_MODULE := core-all-hostdex
Ian Rogers3deabd22014-05-23 15:12:42 -0700316LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
317LOCAL_REQUIRED_MODULES := tzdata-host
Piotr Jastrzebski5c3c9df2015-04-20 10:56:00 +0100318LOCAL_CORE_LIBRARY := true
Narayan Kamath0ebbfbd2015-07-30 15:01:19 +0100319LOCAL_UNINSTALLABLE_MODULE := true
Ian Rogers3deabd22014-05-23 15:12:42 -0700320include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700321
Narayan Kamathf41eec82015-11-20 12:39:23 +0000322include $(CLEAR_VARS)
Narayan Kamath0a57ec22015-07-24 14:34:02 +0100323LOCAL_SRC_FILES := $(openjdk_java_files)
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000324LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs)
Narayan Kamathf41eec82015-11-20 12:39:23 +0000325LOCAL_NO_STANDARD_LIBRARIES := true
326LOCAL_JAVACFLAGS := $(local_javac_flags)
Narayan Kamathf41eec82015-11-20 12:39:23 +0000327LOCAL_MODULE_TAGS := optional
Neil Fuller6c8e0ae2016-01-27 14:28:20 +0000328LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Narayan Kamathf41eec82015-11-20 12:39:23 +0000329LOCAL_MODULE := core-oj-hostdex
Narayan Kamath558a2d12015-12-22 14:37:40 +0000330LOCAL_NOTICE_FILE := $(LOCAL_PATH)/ojluni/NOTICE
Narayan Kamathf41eec82015-11-20 12:39:23 +0000331LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000332LOCAL_JAVA_LIBRARIES := core-all-hostdex
Narayan Kamathf41eec82015-11-20 12:39:23 +0000333LOCAL_REQUIRED_MODULES := tzdata-host
Narayan Kamathf41eec82015-11-20 12:39:23 +0000334LOCAL_CORE_LIBRARY := true
Narayan Kamathf41eec82015-11-20 12:39:23 +0000335include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
336
Kenny Rootba07db52013-08-29 13:40:35 -0700337# Definitions to make the core library.
338include $(CLEAR_VARS)
Przemyslaw Szczepaniak70b617f2015-11-20 12:01:45 +0000339LOCAL_SRC_FILES := $(non_openjdk_java_files) $(android_icu4j_src_files)
Narayan Kamatha61daf42015-11-24 13:31:36 +0000340LOCAL_JAVA_RESOURCE_DIRS := $(android_icu4j_resource_dirs)
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800341LOCAL_NO_STANDARD_LIBRARIES := true
Elliott Hughese983a0b2015-01-16 10:47:17 -0800342LOCAL_JAVACFLAGS := $(local_javac_flags)
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800343LOCAL_MODULE_TAGS := optional
Neil Fuller6c8e0ae2016-01-27 14:28:20 +0000344LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800345LOCAL_MODULE := core-libart-hostdex
346LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000347LOCAL_JAVA_LIBRARIES := core-oj-hostdex
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800348LOCAL_REQUIRED_MODULES := tzdata-host
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800349include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
350
Neil Fuller3375f982016-02-15 14:39:05 +0000351# A library that exists to satisfy javac when
352# compiling source code that contains lambdas.
353include $(CLEAR_VARS)
Narayan Kamath3c9b6312016-08-02 12:37:59 +0100354LOCAL_SRC_FILES := $(openjdk_lambda_stub_files) $(openjdk_lambda_duplicate_stub_files)
Neil Fuller3375f982016-02-15 14:39:05 +0000355LOCAL_NO_STANDARD_LIBRARIES := true
356LOCAL_JAVACFLAGS := $(local_javac_flags)
Neil Fuller3375f982016-02-15 14:39:05 +0000357LOCAL_MODULE_TAGS := optional
358LOCAL_JAVA_LANGUAGE_VERSION := 1.8
359LOCAL_MODULE := core-lambda-stubs-hostdex
360LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
361LOCAL_JAVA_LIBRARIES := core-all-hostdex
362LOCAL_CORE_LIBRARY := true
363include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
364
Paul Duffinfe0ee8e2016-08-12 11:32:44 +0100365# Make the core-tests-hostdex library.
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800366ifeq ($(LIBCORE_SKIP_TESTS),)
367 include $(CLEAR_VARS)
368 LOCAL_SRC_FILES := $(test_src_files)
369 LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
370 LOCAL_NO_STANDARD_LIBRARIES := true
Tobias Thiererd5e8f8c2016-12-22 12:25:26 +0000371 LOCAL_JAVA_LIBRARIES := \
372 bouncycastle-hostdex \
373 core-libart-hostdex \
374 core-oj-hostdex \
375 core-tests-support-hostdex \
376 junit-hostdex \
377 mockito-api-hostdex \
378 okhttp-hostdex
379 LOCAL_STATIC_JAVA_LIBRARIES := \
380 core-test-rules-hostdex \
Tobias Thierer62db9f92016-11-28 12:24:32 +0000381 mockftpserver-hostdex \
Tobias Thiererd5e8f8c2016-12-22 12:25:26 +0000382 mockwebserver-host \
383 nist-pkix-tests-host \
Tobias Thierer62db9f92016-11-28 12:24:32 +0000384 slf4j-jdk14-hostdex \
Tobias Thiererd5e8f8c2016-12-22 12:25:26 +0000385 sqlite-jdbc-host \
386 tzdata-testing-hostdex
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800387 LOCAL_JAVACFLAGS := $(local_javac_flags)
388 LOCAL_MODULE_TAGS := optional
Neil Fuller4c6a1ee2016-02-15 12:51:39 +0000389 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800390 LOCAL_MODULE := core-tests-hostdex
391 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
392 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
393endif
Elliott Hughesd6108342011-02-22 10:13:54 -0800394
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800395# Make the core-tests-support library.
396ifeq ($(LIBCORE_SKIP_TESTS),)
397 include $(CLEAR_VARS)
398 LOCAL_SRC_FILES := $(call all-test-java-files-under,support)
399 LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
400 LOCAL_NO_STANDARD_LIBRARIES := true
Tobias Thiererd5e8f8c2016-12-22 12:25:26 +0000401 LOCAL_JAVA_LIBRARIES := \
402 bouncycastle-hostdex \
403 core-libart-hostdex \
404 core-oj-hostdex \
405 junit-hostdex
406 LOCAL_STATIC_JAVA_LIBRARIES := \
407 bouncycastle-bcpkix-hostdex \
408 bouncycastle-ocsp-hostdex
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800409 LOCAL_JAVACFLAGS := $(local_javac_flags)
410 LOCAL_MODULE_TAGS := optional
411 LOCAL_MODULE := core-tests-support-hostdex
412 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
413 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800414endif
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800415
Igor Murashkin60370002016-04-04 11:53:53 -0700416# Make the core-ojtests-hostdex library.
Igor Murashkin4c65c012016-03-24 20:52:10 +0000417ifeq ($(LIBCORE_SKIP_TESTS),)
418 include $(CLEAR_VARS)
419 LOCAL_SRC_FILES := $(ojtest_src_files)
420 LOCAL_NO_STANDARD_LIBRARIES := true
Tobias Thiererd5e8f8c2016-12-22 12:25:26 +0000421 LOCAL_JAVA_LIBRARIES := \
422 bouncycastle-hostdex \
423 core-libart-hostdex \
424 core-oj-hostdex \
425 okhttp-hostdex
Igor Murashkin4c65c012016-03-24 20:52:10 +0000426 LOCAL_STATIC_JAVA_LIBRARIES := testng-hostdex
427 LOCAL_JAVACFLAGS := $(local_javac_flags)
428 LOCAL_MODULE_TAGS := optional
429 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
430 LOCAL_MODULE := core-ojtests-hostdex
431 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
432 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
433endif
434
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800435endif # HOST_OS == linux
436
437#
438# Local droiddoc for faster libcore testing
439#
440#
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800441# Run with:
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800442# mm -j32 libcore-docs
443#
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800444# Main output:
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800445# ../out/target/common/docs/libcore/reference/packages.html
446#
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800447# All text for proofreading (or running tools over):
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800448# ../out/target/common/docs/libcore-proofread.txt
449#
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800450# TODO list of missing javadoc, etc:
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800451# ../out/target/common/docs/libcore-docs-todo.html
452#
453# Rerun:
454# rm -rf ../out/target/common/docs/libcore-timestamp && mm -j32 libcore-docs
455#
456include $(CLEAR_VARS)
Ying Wang21ac42d2013-12-04 15:54:36 -0800457
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800458# for shared defintion of libcore_to_document
459include $(LOCAL_PATH)/Docs.mk
460
Neil Fuller42597382015-10-07 11:00:01 +0100461# The libcore_to_document paths are relative to $(TOPDIR). We are in libcore so we must prepend
462# ../ to make LOCAL_SRC_FILES relative to $(LOCAL_PATH).
463LOCAL_SRC_FILES := $(addprefix ../, $(libcore_to_document))
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800464# rerun doc generation without recompiling the java
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800465LOCAL_JAVACFLAGS := $(local_javac_flags)
466LOCAL_MODULE_CLASS:=JAVA_LIBRARIES
467
468LOCAL_MODULE := libcore
Elliott Hughes73d3e262012-08-28 17:56:09 -0700469LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700470
Elliott Hughesb9863272012-11-08 14:28:29 -0800471LOCAL_DROIDDOC_OPTIONS := \
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700472 -offlinemode \
473 -title "libcore" \
474 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
475 -todo ../$(LOCAL_MODULE)-docs-todo.html \
Neil Fuller7881b2c2016-10-14 16:26:46 +0100476 -knowntags ./libcore/known_oj_tags.txt \
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700477 -hdf android.whichdoc offline
478
479LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk
480
481include $(BUILD_DROIDDOC)
Narayan Kamath0a57ec22015-07-24 14:34:02 +0100482
483openjdk_java_files :=
484non_openjdk_java_files :=