blob: 6114ad21b360a58b73c7ef5a17613a6bc2351303 [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 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)
137LOCAL_SRC_FILES := $(openjdk_lambda_stub_files)
138LOCAL_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
169include $(CLEAR_VARS)
170LOCAL_SRC_FILES := $(non_openjdk_java_files) $(android_icu4j_src_files)
171LOCAL_JAVA_RESOURCE_DIRS := $(android_icu4j_resource_dirs)
172LOCAL_NO_STANDARD_LIBRARIES := true
173LOCAL_JAVACFLAGS := $(local_javac_flags)
Andreas Gampe78590262015-09-30 11:55:03 -0700174LOCAL_MODULE_TAGS := optional
175LOCAL_DEX_PREOPT := false
Neil Fuller6c8e0ae2016-01-27 14:28:20 +0000176LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Andreas Gampe78590262015-09-30 11:55:03 -0700177LOCAL_MODULE := core-libart-testdex
178LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/JavaLibrary.mk
179LOCAL_JAVA_LIBRARIES := core-all
180LOCAL_CORE_LIBRARY := true
181LOCAL_REQUIRED_MODULES := tzdata
182include $(BUILD_JAVA_LIBRARY)
183endif
184
185ifeq ($(LIBCORE_SKIP_TESTS),)
Kenny Root38375a42013-04-23 15:50:31 -0700186# Make the core-tests library.
187include $(CLEAR_VARS)
Narayan Kamath51525b52013-11-15 18:02:54 +0000188LOCAL_SRC_FILES := $(test_src_files)
Brian Carlstrom51ee38b2010-07-23 15:57:52 -0700189LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
190LOCAL_NO_STANDARD_LIBRARIES := true
Paul Duffin7c19e312016-04-13 14:12:43 +0100191LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs okhttp core-junit junit4-target bouncycastle mockito-target
Neil Fuller62fba1e2014-05-29 11:52:06 +0100192LOCAL_STATIC_JAVA_LIBRARIES := core-tests-support sqlite-jdbc mockwebserver nist-pkix-tests
Elliott Hughesd6108342011-02-22 10:13:54 -0800193LOCAL_JAVACFLAGS := $(local_javac_flags)
Neil Fuller668d3462016-02-01 18:14:45 +0000194LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Brian Carlstromb094af32010-05-28 17:37:37 -0700195LOCAL_MODULE := core-tests
Elliott Hughes73d3e262012-08-28 17:56:09 -0700196LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
Jesse Wilson706d5352010-06-08 17:20:09 -0700197include $(BUILD_STATIC_JAVA_LIBRARY)
Elliott Hughesc5cd6e82012-10-18 18:13:10 -0700198endif
Jesse Wilson706d5352010-06-08 17:20:09 -0700199
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700200ifeq ($(LIBCORE_SKIP_TESTS),)
Kenny Rootb397b192013-08-29 14:24:47 -0700201# Make the core-tests-support library.
202include $(CLEAR_VARS)
203LOCAL_SRC_FILES := $(call all-test-java-files-under,support)
204LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
205LOCAL_NO_STANDARD_LIBRARIES := true
Paul Duffin7c19e312016-04-13 14:12:43 +0100206LOCAL_JAVA_LIBRARIES := core-oj core-libart core-junit junit4-target bouncycastle
Kenny Root0435fdb2016-03-30 12:52:38 -0700207LOCAL_STATIC_JAVA_LIBRARIES := bouncycastle-bcpkix bouncycastle-ocsp
Kenny Rootb397b192013-08-29 14:24:47 -0700208LOCAL_JAVACFLAGS := $(local_javac_flags)
Kenny Rootb397b192013-08-29 14:24:47 -0700209LOCAL_MODULE := core-tests-support
210LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
211include $(BUILD_STATIC_JAVA_LIBRARY)
212endif
213
214ifeq ($(LIBCORE_SKIP_TESTS),)
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700215# Make the jsr166-tests library.
216include $(CLEAR_VARS)
217LOCAL_SRC_FILES := $(call all-test-java-files-under, jsr166-tests)
218LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
219LOCAL_NO_STANDARD_LIBRARIES := true
Paul Duffin7c19e312016-04-13 14:12:43 +0100220LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs core-junit junit4-target
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700221LOCAL_JAVACFLAGS := $(local_javac_flags)
222LOCAL_MODULE := jsr166-tests
Przemyslaw Szczepaniak087f0ca2016-03-15 12:38:36 +0000223LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Tsu Chiang Chuang808558f2013-08-21 11:46:49 -0700224LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
225include $(BUILD_STATIC_JAVA_LIBRARY)
226endif
227
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700228#
229# Build for the host.
230#
231
Elliott Hughese983a0b2015-01-16 10:47:17 -0800232ifeq ($(HOST_OS),linux)
233
Ian Rogers3deabd22014-05-23 15:12:42 -0700234include $(CLEAR_VARS)
Narayan Kamath0a57ec22015-07-24 14:34:02 +0100235LOCAL_SRC_FILES := $(call all-java-files-under, dex/src/main)
Tsu Chiang Chuang25963ae2013-07-23 16:39:20 -0700236LOCAL_MODULE_TAGS := optional
237LOCAL_MODULE := dex-host
238include $(BUILD_HOST_JAVA_LIBRARY)
239
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000240include $(CLEAR_VARS)
Neil Fuller7d6a54c2016-01-27 21:48:51 +0000241LOCAL_SRC_FILES := $(non_openjdk_java_files) $(openjdk_java_files) $(android_icu4j_src_files) $(openjdk_lambda_stub_files)
Przemyslaw Szczepaniake3b37c22015-09-28 16:24:00 +0100242LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs)
Ian Rogers3deabd22014-05-23 15:12:42 -0700243LOCAL_NO_STANDARD_LIBRARIES := true
244LOCAL_JAVACFLAGS := $(local_javac_flags)
Ian Rogers3deabd22014-05-23 15:12:42 -0700245LOCAL_MODULE_TAGS := optional
Neil Fuller6c8e0ae2016-01-27 14:28:20 +0000246LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000247LOCAL_MODULE := core-all-hostdex
Ian Rogers3deabd22014-05-23 15:12:42 -0700248LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
249LOCAL_REQUIRED_MODULES := tzdata-host
Piotr Jastrzebski5c3c9df2015-04-20 10:56:00 +0100250LOCAL_CORE_LIBRARY := true
Narayan Kamath0ebbfbd2015-07-30 15:01:19 +0100251LOCAL_UNINSTALLABLE_MODULE := true
Ian Rogers3deabd22014-05-23 15:12:42 -0700252include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700253
Narayan Kamathf41eec82015-11-20 12:39:23 +0000254include $(CLEAR_VARS)
Narayan Kamath0a57ec22015-07-24 14:34:02 +0100255LOCAL_SRC_FILES := $(openjdk_java_files)
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000256LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs)
Narayan Kamathf41eec82015-11-20 12:39:23 +0000257LOCAL_NO_STANDARD_LIBRARIES := true
258LOCAL_JAVACFLAGS := $(local_javac_flags)
Narayan Kamathf41eec82015-11-20 12:39:23 +0000259LOCAL_MODULE_TAGS := optional
Neil Fuller6c8e0ae2016-01-27 14:28:20 +0000260LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Narayan Kamathf41eec82015-11-20 12:39:23 +0000261LOCAL_MODULE := core-oj-hostdex
Narayan Kamath558a2d12015-12-22 14:37:40 +0000262LOCAL_NOTICE_FILE := $(LOCAL_PATH)/ojluni/NOTICE
Narayan Kamathf41eec82015-11-20 12:39:23 +0000263LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000264LOCAL_JAVA_LIBRARIES := core-all-hostdex
Narayan Kamathf41eec82015-11-20 12:39:23 +0000265LOCAL_REQUIRED_MODULES := tzdata-host
Narayan Kamathf41eec82015-11-20 12:39:23 +0000266LOCAL_CORE_LIBRARY := true
Narayan Kamathf41eec82015-11-20 12:39:23 +0000267include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
268
Kenny Rootba07db52013-08-29 13:40:35 -0700269# Definitions to make the core library.
270include $(CLEAR_VARS)
Przemyslaw Szczepaniak70b617f2015-11-20 12:01:45 +0000271LOCAL_SRC_FILES := $(non_openjdk_java_files) $(android_icu4j_src_files)
Narayan Kamatha61daf42015-11-24 13:31:36 +0000272LOCAL_JAVA_RESOURCE_DIRS := $(android_icu4j_resource_dirs)
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800273LOCAL_NO_STANDARD_LIBRARIES := true
Elliott Hughese983a0b2015-01-16 10:47:17 -0800274LOCAL_JAVACFLAGS := $(local_javac_flags)
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800275LOCAL_MODULE_TAGS := optional
Neil Fuller6c8e0ae2016-01-27 14:28:20 +0000276LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800277LOCAL_MODULE := core-libart-hostdex
278LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
Piotr Jastrzebski51b1b692015-02-16 15:01:09 +0000279LOCAL_JAVA_LIBRARIES := core-oj-hostdex
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800280LOCAL_REQUIRED_MODULES := tzdata-host
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800281include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
282
Neil Fuller3375f982016-02-15 14:39:05 +0000283# A library that exists to satisfy javac when
284# compiling source code that contains lambdas.
285include $(CLEAR_VARS)
286LOCAL_SRC_FILES := $(openjdk_lambda_stub_files)
287LOCAL_NO_STANDARD_LIBRARIES := true
288LOCAL_JAVACFLAGS := $(local_javac_flags)
Neil Fuller3375f982016-02-15 14:39:05 +0000289LOCAL_MODULE_TAGS := optional
290LOCAL_JAVA_LANGUAGE_VERSION := 1.8
291LOCAL_MODULE := core-lambda-stubs-hostdex
292LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
293LOCAL_JAVA_LIBRARIES := core-all-hostdex
294LOCAL_CORE_LIBRARY := true
295include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
296
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700297# Make the core-tests library.
298ifeq ($(LIBCORE_SKIP_TESTS),)
299 include $(CLEAR_VARS)
300 LOCAL_SRC_FILES := $(test_src_files)
301 LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
302 LOCAL_NO_STANDARD_LIBRARIES := true
Paul Duffin7c19e312016-04-13 14:12:43 +0100303 LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex core-lambda-stubs-hostdex okhttp-hostdex bouncycastle-hostdex core-junit-hostdex junit4-target-hostdex core-tests-support-hostdex mockito-api-hostdex
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800304 LOCAL_STATIC_JAVA_LIBRARIES := sqlite-jdbc-host mockwebserver-host nist-pkix-tests-host
305 LOCAL_JAVACFLAGS := $(local_javac_flags)
306 LOCAL_MODULE_TAGS := optional
Neil Fuller4c6a1ee2016-02-15 12:51:39 +0000307 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800308 LOCAL_MODULE := core-tests-hostdex
309 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
310 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
311endif
Elliott Hughesd6108342011-02-22 10:13:54 -0800312
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800313# Make the core-tests-support library.
314ifeq ($(LIBCORE_SKIP_TESTS),)
315 include $(CLEAR_VARS)
316 LOCAL_SRC_FILES := $(call all-test-java-files-under,support)
317 LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
318 LOCAL_NO_STANDARD_LIBRARIES := true
Paul Duffin7c19e312016-04-13 14:12:43 +0100319 LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex core-junit-hostdex junit4-target-hostdex bouncycastle-hostdex
Kenny Root0435fdb2016-03-30 12:52:38 -0700320 LOCAL_STATIC_JAVA_LIBRARIES := bouncycastle-bcpkix-hostdex bouncycastle-ocsp-hostdex
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800321 LOCAL_JAVACFLAGS := $(local_javac_flags)
322 LOCAL_MODULE_TAGS := optional
323 LOCAL_MODULE := core-tests-support-hostdex
324 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
325 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800326endif
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800327
Igor Murashkin60370002016-04-04 11:53:53 -0700328# Make the core-ojtests-hostdex library.
Igor Murashkin4c65c012016-03-24 20:52:10 +0000329ifeq ($(LIBCORE_SKIP_TESTS),)
330 include $(CLEAR_VARS)
331 LOCAL_SRC_FILES := $(ojtest_src_files)
332 LOCAL_NO_STANDARD_LIBRARIES := true
333 LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex core-lambda-stubs-hostdex okhttp-hostdex bouncycastle-hostdex
334 LOCAL_STATIC_JAVA_LIBRARIES := testng-hostdex
335 LOCAL_JAVACFLAGS := $(local_javac_flags)
336 LOCAL_MODULE_TAGS := optional
337 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
338 LOCAL_MODULE := core-ojtests-hostdex
339 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
340 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
341endif
342
Igor Murashkin60370002016-04-04 11:53:53 -0700343# Make the core-ojtests library.
344ifeq ($(LIBCORE_SKIP_TESTS),)
345 include $(CLEAR_VARS)
346 LOCAL_NO_STANDARD_LIBRARIES := true
347 LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs okhttp bouncycastle
348 LOCAL_STATIC_JAVA_LIBRARIES := testng
349 LOCAL_JAVACFLAGS := $(local_javac_flags)
350 LOCAL_MODULE_TAGS := optional
351 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
352 LOCAL_MODULE := core-ojtests
353 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
354 # 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
355 LOCAL_DEX_PREOPT := false # disable AOT preverification which breaks the build. it will still throw VerifyError at runtime.
356 include $(BUILD_JAVA_LIBRARY)
357endif
358
359
360# Make the core-ojtests-public library. Excludes any private API tests.
361ifeq ($(LIBCORE_SKIP_TESTS),)
362 include $(CLEAR_VARS)
363 # Filter out SerializedLambdaTest because it depends on stub classes and won't actually run.
364 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.
365 # Include source code as part of JAR
366 LOCAL_JAVA_RESOURCE_DIRS := ojluni/src/test/dist
367 LOCAL_NO_STANDARD_LIBRARIES := true
368 LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs okhttp bouncycastle testng
369 LOCAL_JAVACFLAGS := $(local_javac_flags)
370 LOCAL_MODULE_TAGS := optional
371 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
372 LOCAL_MODULE := core-ojtests-public
373 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
374 # 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
375 LOCAL_DEX_PREOPT := false # disable AOT preverification which breaks the build. it will still throw VerifyError at runtime.
376 include $(BUILD_JAVA_LIBRARY)
377endif
378
379
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800380endif # HOST_OS == linux
381
382#
383# Local droiddoc for faster libcore testing
384#
385#
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800386# Run with:
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800387# mm -j32 libcore-docs
388#
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800389# Main output:
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800390# ../out/target/common/docs/libcore/reference/packages.html
391#
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800392# All text for proofreading (or running tools over):
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800393# ../out/target/common/docs/libcore-proofread.txt
394#
Elliott Hughes92fc63e2013-02-07 17:05:57 -0800395# TODO list of missing javadoc, etc:
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800396# ../out/target/common/docs/libcore-docs-todo.html
397#
398# Rerun:
399# rm -rf ../out/target/common/docs/libcore-timestamp && mm -j32 libcore-docs
400#
401include $(CLEAR_VARS)
Ying Wang21ac42d2013-12-04 15:54:36 -0800402
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800403# for shared defintion of libcore_to_document
404include $(LOCAL_PATH)/Docs.mk
405
Neil Fuller42597382015-10-07 11:00:01 +0100406# The libcore_to_document paths are relative to $(TOPDIR). We are in libcore so we must prepend
407# ../ to make LOCAL_SRC_FILES relative to $(LOCAL_PATH).
408LOCAL_SRC_FILES := $(addprefix ../, $(libcore_to_document))
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800409# rerun doc generation without recompiling the java
Brian Carlstromdc3c1522011-01-05 17:48:05 -0800410LOCAL_JAVACFLAGS := $(local_javac_flags)
411LOCAL_MODULE_CLASS:=JAVA_LIBRARIES
412
413LOCAL_MODULE := libcore
Elliott Hughes73d3e262012-08-28 17:56:09 -0700414LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700415
Elliott Hughesb9863272012-11-08 14:28:29 -0800416LOCAL_DROIDDOC_OPTIONS := \
Dan Bornstein6ac43c22009-10-24 15:33:49 -0700417 -offlinemode \
418 -title "libcore" \
419 -proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
420 -todo ../$(LOCAL_MODULE)-docs-todo.html \
421 -hdf android.whichdoc offline
422
423LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk
424
425include $(BUILD_DROIDDOC)
Narayan Kamath0a57ec22015-07-24 14:34:02 +0100426
427openjdk_java_files :=
428non_openjdk_java_files :=