blob: 600367562ce7f272916f070ae09f4063cc5c91d5 [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)
Narayan Kamath51525b52013-11-15 18:02:54 +000056test_src_files := $(call all-test-java-files-under,dalvik dom harmony-tests json luni xml)
Igor Murashkina405b7e2016-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 Duffin56066342016-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 Fuller35eb86d2016-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)
89LOCAL_DX_FLAGS := --core-library
90LOCAL_MODULE_TAGS := optional
Neil Fuller976c83e2016-01-27 14:28:20 +000091LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +000092LOCAL_MODULE := core-all
Brian Carlstrom3711c212013-06-25 15:59:29 -070093LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
94LOCAL_REQUIRED_MODULES := tzdata
Piotr Jastrzebski5c3c9df2015-04-20 10:56:00 +010095LOCAL_CORE_LIBRARY := true
Narayan Kamath0ebbfbd2015-07-30 15:01:19 +010096LOCAL_UNINSTALLABLE_MODULE := true
Brian Carlstrom3711c212013-06-25 15:59:29 -070097include $(BUILD_JAVA_LIBRARY)
Dan Bornstein6ac43c22009-10-24 15:33:49 -070098
Narayan Kamathf41eec82015-11-20 12:39:23 +000099include $(CLEAR_VARS)
Narayan Kamath0a57ec22015-07-24 14:34:02 +0100100LOCAL_SRC_FILES := $(openjdk_java_files)
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000101LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs)
Narayan Kamathf41eec82015-11-20 12:39:23 +0000102LOCAL_NO_STANDARD_LIBRARIES := true
103LOCAL_JAVACFLAGS := $(local_javac_flags)
104LOCAL_DX_FLAGS := --core-library
105LOCAL_MODULE_TAGS := optional
Neil Fuller976c83e2016-01-27 14:28:20 +0000106LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Narayan Kamathf41eec82015-11-20 12:39:23 +0000107LOCAL_MODULE := core-oj
Narayan Kamathf41eec82015-11-20 12:39:23 +0000108LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
Narayan Kamath09f993b2015-11-18 09:28:42 +0000109LOCAL_JAVA_LIBRARIES := core-all
Narayan Kamath558a2d12015-12-22 14:37:40 +0000110LOCAL_NOTICE_FILE := $(LOCAL_PATH)/ojluni/NOTICE
Narayan Kamathf41eec82015-11-20 12:39:23 +0000111LOCAL_REQUIRED_MODULES := tzdata
112LOCAL_CORE_LIBRARY := true
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000113include $(BUILD_JAVA_LIBRARY)
114
115# Definitions to make the core library.
116include $(CLEAR_VARS)
Przemyslaw Szczepaniak70b617f2015-11-20 12:01:45 +0000117LOCAL_SRC_FILES := $(non_openjdk_java_files) $(android_icu4j_src_files)
Narayan Kamatha61daf42015-11-24 13:31:36 +0000118LOCAL_JAVA_RESOURCE_DIRS := $(android_icu4j_resource_dirs)
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700119LOCAL_NO_STANDARD_LIBRARIES := true
120LOCAL_JAVACFLAGS := $(local_javac_flags)
121LOCAL_DX_FLAGS := --core-library
122LOCAL_MODULE_TAGS := optional
Neil Fuller976c83e2016-01-27 14:28:20 +0000123LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700124LOCAL_MODULE := core-libart
Narayan Kamath647e4a62015-10-02 10:22:16 +0100125LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/JavaLibrary.mk
Narayan Kamath09f993b2015-11-18 09:28:42 +0000126LOCAL_JAVA_LIBRARIES := core-all
Sebastien Hertz1d6be012016-03-24 09:43:45 +0100127ifeq ($(EMMA_INSTRUMENT),true)
128ifneq ($(EMMA_INSTRUMENT_STATIC),true)
129 # For instrumented build, include Jacoco classes into core-libart.
130 LOCAL_STATIC_JAVA_LIBRARIES := jacocoagent
131endif # EMMA_INSTRUMENT_STATIC
132endif # EMMA_INSTRUMENT
Narayan Kamathb9853192015-09-02 13:38:48 +0100133LOCAL_CORE_LIBRARY := true
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700134LOCAL_REQUIRED_MODULES := tzdata
Narayan Kamathf41eec82015-11-20 12:39:23 +0000135include $(BUILD_JAVA_LIBRARY)
136
Neil Fuller7cf6b7d2016-02-01 18:14:45 +0000137# A library that exists to satisfy javac when
138# compiling source code that contains lambdas.
139include $(CLEAR_VARS)
140LOCAL_SRC_FILES := $(openjdk_lambda_stub_files)
141LOCAL_NO_STANDARD_LIBRARIES := true
142LOCAL_JAVACFLAGS := $(local_javac_flags)
143LOCAL_DX_FLAGS := --core-library
144LOCAL_MODULE_TAGS := optional
145LOCAL_JAVA_LANGUAGE_VERSION := 1.8
146LOCAL_MODULE := core-lambda-stubs
147LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
148LOCAL_JAVA_LIBRARIES := core-all
149LOCAL_NOTICE_FILE := $(LOCAL_PATH)/ojluni/NOTICE
150LOCAL_CORE_LIBRARY := true
151LOCAL_UNINSTALLABLE_MODULE := true
152include $(BUILD_JAVA_LIBRARY)
153
Kenny Root38375a42013-04-23 15:50:31 -0700154ifeq ($(LIBCORE_SKIP_TESTS),)
Andreas Gampe78590262015-09-30 11:55:03 -0700155# A guaranteed unstripped version of core-oj and core-libart. This is required for ART testing in
156# preopted configurations. See b/24535627.
157include $(CLEAR_VARS)
158LOCAL_SRC_FILES := $(openjdk_java_files)
159LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs)
160LOCAL_NO_STANDARD_LIBRARIES := true
161LOCAL_JAVACFLAGS := $(local_javac_flags)
162LOCAL_DX_FLAGS := --core-library
163LOCAL_MODULE_TAGS := optional
164LOCAL_DEX_PREOPT := false
Neil Fuller976c83e2016-01-27 14:28:20 +0000165LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Andreas Gampe78590262015-09-30 11:55:03 -0700166LOCAL_MODULE := core-oj-testdex
167LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
168LOCAL_JAVA_LIBRARIES := core-all
169LOCAL_NOTICE_FILE := $(LOCAL_PATH)/ojluni/NOTICE
170LOCAL_REQUIRED_MODULES := tzdata
171LOCAL_CORE_LIBRARY := true
Andreas Gampe78590262015-09-30 11:55:03 -0700172include $(BUILD_JAVA_LIBRARY)
173
174include $(CLEAR_VARS)
175LOCAL_SRC_FILES := $(non_openjdk_java_files) $(android_icu4j_src_files)
176LOCAL_JAVA_RESOURCE_DIRS := $(android_icu4j_resource_dirs)
177LOCAL_NO_STANDARD_LIBRARIES := true
178LOCAL_JAVACFLAGS := $(local_javac_flags)
179LOCAL_DX_FLAGS := --core-library
180LOCAL_MODULE_TAGS := optional
181LOCAL_DEX_PREOPT := false
Neil Fuller976c83e2016-01-27 14:28:20 +0000182LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Andreas Gampe78590262015-09-30 11:55:03 -0700183LOCAL_MODULE := core-libart-testdex
184LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/JavaLibrary.mk
185LOCAL_JAVA_LIBRARIES := core-all
186LOCAL_CORE_LIBRARY := true
187LOCAL_REQUIRED_MODULES := tzdata
188include $(BUILD_JAVA_LIBRARY)
189endif
190
191ifeq ($(LIBCORE_SKIP_TESTS),)
Kenny Root38375a42013-04-23 15:50:31 -0700192# Make the core-tests library.
193include $(CLEAR_VARS)
Narayan Kamath51525b52013-11-15 18:02:54 +0000194LOCAL_SRC_FILES := $(test_src_files)
Brian Carlstrom51ee38b2010-07-23 15:57:52 -0700195LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
196LOCAL_NO_STANDARD_LIBRARIES := true
Neil Fuller7cf6b7d2016-02-01 18:14:45 +0000197LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs okhttp core-junit bouncycastle mockito-target
Neil Fuller62fba1e2014-05-29 11:52:06 +0100198LOCAL_STATIC_JAVA_LIBRARIES := core-tests-support sqlite-jdbc mockwebserver nist-pkix-tests
Elliott Hughesd6108342011-02-22 10:13:54 -0800199LOCAL_JAVACFLAGS := $(local_javac_flags)
Neil Fuller7cf6b7d2016-02-01 18:14:45 +0000200LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Brian Carlstromb094af32010-05-28 17:37:37 -0700201LOCAL_MODULE := core-tests
Elliott Hughes73d3e262012-08-28 17:56:09 -0700202LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
Jesse Wilson706d5352010-06-08 17:20:09 -0700203include $(BUILD_STATIC_JAVA_LIBRARY)
Elliott Hughesc5cd6e82012-10-18 18:13:10 -0700204endif
Jesse Wilson706d5352010-06-08 17:20:09 -0700205
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700206ifeq ($(LIBCORE_SKIP_TESTS),)
Kenny Rootb397b192013-08-29 14:24:47 -0700207# Make the core-tests-support library.
208include $(CLEAR_VARS)
209LOCAL_SRC_FILES := $(call all-test-java-files-under,support)
210LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
211LOCAL_NO_STANDARD_LIBRARIES := true
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000212LOCAL_JAVA_LIBRARIES := core-oj core-libart core-junit bouncycastle
Kenny Root5a851302016-03-30 12:52:38 -0700213LOCAL_STATIC_JAVA_LIBRARIES := bouncycastle-bcpkix bouncycastle-ocsp
Kenny Rootb397b192013-08-29 14:24:47 -0700214LOCAL_JAVACFLAGS := $(local_javac_flags)
Kenny Rootb397b192013-08-29 14:24:47 -0700215LOCAL_MODULE := core-tests-support
216LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
217include $(BUILD_STATIC_JAVA_LIBRARY)
218endif
219
220ifeq ($(LIBCORE_SKIP_TESTS),)
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700221# Make the jsr166-tests library.
222include $(CLEAR_VARS)
223LOCAL_SRC_FILES := $(call all-test-java-files-under, jsr166-tests)
224LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
225LOCAL_NO_STANDARD_LIBRARIES := true
Przemyslaw Szczepaniake8b323c2016-03-11 15:59:10 +0000226LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs core-junit
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700227LOCAL_JAVACFLAGS := $(local_javac_flags)
228LOCAL_MODULE := jsr166-tests
229LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
230include $(BUILD_STATIC_JAVA_LIBRARY)
231endif
232
Igor Murashkinedabd982016-04-27 15:43:33 -0700233# Make the core-ojtests library.
234ifeq ($(LIBCORE_SKIP_TESTS),)
235 include $(CLEAR_VARS)
236 LOCAL_NO_STANDARD_LIBRARIES := true
237 LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs okhttp bouncycastle
238 LOCAL_STATIC_JAVA_LIBRARIES := testng
239 LOCAL_JAVACFLAGS := $(local_javac_flags)
240 LOCAL_MODULE_TAGS := optional
241 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
242 LOCAL_MODULE := core-ojtests
243 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
244 # 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
245 LOCAL_DEX_PREOPT := false # disable AOT preverification which breaks the build. it will still throw VerifyError at runtime.
246 include $(BUILD_JAVA_LIBRARY)
247endif
248
249# Make the core-ojtests-public library. Excludes any private API tests.
250ifeq ($(LIBCORE_SKIP_TESTS),)
251 include $(CLEAR_VARS)
252 # Filter out SerializedLambdaTest because it depends on stub classes and won't actually run.
253 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.
254 # Include source code as part of JAR
255 LOCAL_JAVA_RESOURCE_DIRS := ojluni/src/test/dist
256 LOCAL_NO_STANDARD_LIBRARIES := true
257 LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs okhttp bouncycastle testng
258 LOCAL_JAVACFLAGS := $(local_javac_flags)
259 LOCAL_MODULE_TAGS := optional
260 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
261 LOCAL_MODULE := core-ojtests-public
262 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
263 # 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
264 LOCAL_DEX_PREOPT := false # disable AOT preverification which breaks the build. it will still throw VerifyError at runtime.
265 include $(BUILD_JAVA_LIBRARY)
266endif
267
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700268#
269# Build for the host.
270#
271
Elliott Hughese983a0b2015-01-16 10:47:17 -0800272ifeq ($(HOST_OS),linux)
273
Ian Rogers3deabd22014-05-23 15:12:42 -0700274include $(CLEAR_VARS)
Narayan Kamath0a57ec22015-07-24 14:34:02 +0100275LOCAL_SRC_FILES := $(call all-java-files-under, dex/src/main)
Tsu Chiang Chuang25963ae2013-07-23 16:39:20 -0700276LOCAL_MODULE_TAGS := optional
277LOCAL_MODULE := dex-host
278include $(BUILD_HOST_JAVA_LIBRARY)
279
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000280include $(CLEAR_VARS)
Neil Fuller35eb86d2016-01-27 21:48:51 +0000281LOCAL_SRC_FILES := $(non_openjdk_java_files) $(openjdk_java_files) $(android_icu4j_src_files) $(openjdk_lambda_stub_files)
Przemyslaw Szczepaniake3b37c22015-09-28 16:24:00 +0100282LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs)
Ian Rogers3deabd22014-05-23 15:12:42 -0700283LOCAL_NO_STANDARD_LIBRARIES := true
284LOCAL_JAVACFLAGS := $(local_javac_flags)
285LOCAL_DX_FLAGS := --core-library
286LOCAL_MODULE_TAGS := optional
Neil Fuller976c83e2016-01-27 14:28:20 +0000287LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000288LOCAL_MODULE := core-all-hostdex
Ian Rogers3deabd22014-05-23 15:12:42 -0700289LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
290LOCAL_REQUIRED_MODULES := tzdata-host
Piotr Jastrzebski5c3c9df2015-04-20 10:56:00 +0100291LOCAL_CORE_LIBRARY := true
Narayan Kamath0ebbfbd2015-07-30 15:01:19 +0100292LOCAL_UNINSTALLABLE_MODULE := true
Ian Rogers3deabd22014-05-23 15:12:42 -0700293include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700294
Narayan Kamathf41eec82015-11-20 12:39:23 +0000295include $(CLEAR_VARS)
Narayan Kamath0a57ec22015-07-24 14:34:02 +0100296LOCAL_SRC_FILES := $(openjdk_java_files)
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000297LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs)
Narayan Kamathf41eec82015-11-20 12:39:23 +0000298LOCAL_NO_STANDARD_LIBRARIES := true
299LOCAL_JAVACFLAGS := $(local_javac_flags)
300LOCAL_DX_FLAGS := --core-library
301LOCAL_MODULE_TAGS := optional
Neil Fuller976c83e2016-01-27 14:28:20 +0000302LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Narayan Kamathf41eec82015-11-20 12:39:23 +0000303LOCAL_MODULE := core-oj-hostdex
Narayan Kamath558a2d12015-12-22 14:37:40 +0000304LOCAL_NOTICE_FILE := $(LOCAL_PATH)/ojluni/NOTICE
Narayan Kamathf41eec82015-11-20 12:39:23 +0000305LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000306LOCAL_JAVA_LIBRARIES := core-all-hostdex
Narayan Kamathf41eec82015-11-20 12:39:23 +0000307LOCAL_REQUIRED_MODULES := tzdata-host
Narayan Kamathf41eec82015-11-20 12:39:23 +0000308LOCAL_CORE_LIBRARY := true
Narayan Kamathf41eec82015-11-20 12:39:23 +0000309include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
310
Kenny Rootba07db52013-08-29 13:40:35 -0700311# Definitions to make the core library.
312include $(CLEAR_VARS)
Przemyslaw Szczepaniak70b617f2015-11-20 12:01:45 +0000313LOCAL_SRC_FILES := $(non_openjdk_java_files) $(android_icu4j_src_files)
Narayan Kamatha61daf42015-11-24 13:31:36 +0000314LOCAL_JAVA_RESOURCE_DIRS := $(android_icu4j_resource_dirs)
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800315LOCAL_NO_STANDARD_LIBRARIES := true
Elliott Hughese983a0b2015-01-16 10:47:17 -0800316LOCAL_JAVACFLAGS := $(local_javac_flags)
317LOCAL_DX_FLAGS := --core-library
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800318LOCAL_MODULE_TAGS := optional
Neil Fuller976c83e2016-01-27 14:28:20 +0000319LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800320LOCAL_MODULE := core-libart-hostdex
321LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000322LOCAL_JAVA_LIBRARIES := core-oj-hostdex
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800323LOCAL_REQUIRED_MODULES := tzdata-host
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800324include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
325
Neil Fullerf2eb9cf2016-02-15 14:39:05 +0000326# A library that exists to satisfy javac when
327# compiling source code that contains lambdas.
328include $(CLEAR_VARS)
329LOCAL_SRC_FILES := $(openjdk_lambda_stub_files)
330LOCAL_NO_STANDARD_LIBRARIES := true
331LOCAL_JAVACFLAGS := $(local_javac_flags)
332LOCAL_DX_FLAGS := --core-library
333LOCAL_MODULE_TAGS := optional
334LOCAL_JAVA_LANGUAGE_VERSION := 1.8
335LOCAL_MODULE := core-lambda-stubs-hostdex
336LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
337LOCAL_JAVA_LIBRARIES := core-all-hostdex
338LOCAL_CORE_LIBRARY := true
339include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
340
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700341# Make the core-tests library.
342ifeq ($(LIBCORE_SKIP_TESTS),)
343 include $(CLEAR_VARS)
344 LOCAL_SRC_FILES := $(test_src_files)
345 LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
346 LOCAL_NO_STANDARD_LIBRARIES := true
Neil Fullerf2eb9cf2016-02-15 14:39:05 +0000347 LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex core-lambda-stubs-hostdex okhttp-hostdex bouncycastle-hostdex core-junit-hostdex core-tests-support-hostdex mockito-api-hostdex
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800348 LOCAL_STATIC_JAVA_LIBRARIES := sqlite-jdbc-host mockwebserver-host nist-pkix-tests-host
349 LOCAL_JAVACFLAGS := $(local_javac_flags)
350 LOCAL_MODULE_TAGS := optional
Neil Fuller6917cb52016-02-15 12:51:39 +0000351 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800352 LOCAL_MODULE := core-tests-hostdex
353 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
354 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
355endif
Elliott Hughesd6108342011-02-22 10:13:54 -0800356
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800357# Make the core-tests-support library.
358ifeq ($(LIBCORE_SKIP_TESTS),)
359 include $(CLEAR_VARS)
360 LOCAL_SRC_FILES := $(call all-test-java-files-under,support)
361 LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
362 LOCAL_NO_STANDARD_LIBRARIES := true
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000363 LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex core-junit-hostdex bouncycastle-hostdex
Kenny Root5a851302016-03-30 12:52:38 -0700364 LOCAL_STATIC_JAVA_LIBRARIES := bouncycastle-bcpkix-hostdex bouncycastle-ocsp-hostdex
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800365 LOCAL_JAVACFLAGS := $(local_javac_flags)
366 LOCAL_MODULE_TAGS := optional
367 LOCAL_MODULE := core-tests-support-hostdex
368 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
369 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800370endif
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800371
Igor Murashkin289e51c2016-04-04 11:53:53 -0700372# Make the core-ojtests-hostdex library.
Igor Murashkina405b7e2016-03-24 20:52:10 +0000373ifeq ($(LIBCORE_SKIP_TESTS),)
374 include $(CLEAR_VARS)
375 LOCAL_SRC_FILES := $(ojtest_src_files)
376 LOCAL_NO_STANDARD_LIBRARIES := true
377 LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex core-lambda-stubs-hostdex okhttp-hostdex bouncycastle-hostdex
378 LOCAL_STATIC_JAVA_LIBRARIES := testng-hostdex
379 LOCAL_JAVACFLAGS := $(local_javac_flags)
380 LOCAL_MODULE_TAGS := optional
381 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
382 LOCAL_MODULE := core-ojtests-hostdex
383 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
384 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
385endif
386
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800387endif # HOST_OS == linux
388
389#
390# Local droiddoc for faster libcore testing
391#
392#
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800393# Run with:
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800394# mm -j32 libcore-docs
395#
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800396# Main output:
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800397# ../out/target/common/docs/libcore/reference/packages.html
398#
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800399# All text for proofreading (or running tools over):
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800400# ../out/target/common/docs/libcore-proofread.txt
401#
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800402# TODO list of missing javadoc, etc:
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800403# ../out/target/common/docs/libcore-docs-todo.html
404#
405# Rerun:
406# rm -rf ../out/target/common/docs/libcore-timestamp && mm -j32 libcore-docs
407#
408include $(CLEAR_VARS)
Ying Wang21ac42d2013-12-04 15:54:36 -0800409
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800410# for shared defintion of libcore_to_document
411include $(LOCAL_PATH)/Docs.mk
412
Neil Fuller42597382015-10-07 11:00:01 +0100413# The libcore_to_document paths are relative to $(TOPDIR). We are in libcore so we must prepend
414# ../ to make LOCAL_SRC_FILES relative to $(LOCAL_PATH).
415LOCAL_SRC_FILES := $(addprefix ../, $(libcore_to_document))
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800416# rerun doc generation without recompiling the java
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800417LOCAL_JAVACFLAGS := $(local_javac_flags)
418LOCAL_MODULE_CLASS:=JAVA_LIBRARIES
419
420LOCAL_MODULE := libcore
Elliott Hughes73d3e262012-08-28 17:56:09 -0700421LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700422
Elliott Hughesb9863272012-11-08 14:28:29 -0800423LOCAL_DROIDDOC_OPTIONS := \
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700424 -offlinemode \
425 -title "libcore" \
426 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
427 -todo ../$(LOCAL_MODULE)-docs-todo.html \
428 -hdf android.whichdoc offline
429
430LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk
431
432include $(BUILD_DROIDDOC)
Narayan Kamath0a57ec22015-07-24 14:34:02 +0100433
434openjdk_java_files :=
435non_openjdk_java_files :=