JavaLibrary.mk revision 7ee3a061452c5a7e5c8e661219a1f08a14171858
17ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes# -*- mode: makefile -*- 26ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# Copyright (C) 2007 The Android Open Source Project 36ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# 46ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# Licensed under the Apache License, Version 2.0 (the "License"); 56ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# you may not use this file except in compliance with the License. 66ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# You may obtain a copy of the License at 76ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# 86ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# http://www.apache.org/licenses/LICENSE-2.0 96ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# 106ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# Unless required by applicable law or agreed to in writing, software 116ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# distributed under the License is distributed on an "AS IS" BASIS, 126ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 136ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# See the License for the specific language governing permissions and 146ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# limitations under the License. 156ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 166ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# 176ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# Definitions for building the Java library and associated tests. 186ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# 196ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 206ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# 216ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# Common definitions for host and target. 226ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# 236ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 246ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# The core library is divided into modules. Each module has a separate 256ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# Java source directory, and some (hopefully eventually all) also have 266ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# a directory for tests. 276ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 286ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteindefine all-core-java-files 296ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find */src/$(1)/java -name "*.java")) 306ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteinendef 316ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 327ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesdefine all-test-java-files-under 337ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(1)/src/test/java -name "*.java")) 347ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesendef 357ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 366ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# Redirect ls stderr to /dev/null because the corresponding resources 376ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# directories don't always exist. 386ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteindefine all-core-resource-dirs 397ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes$(shell cd $(LOCAL_PATH) && ls -d */src/test/{java,resources} 2> /dev/null) 406ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteinendef 416ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 426ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# The core Java files and associated resources. 436ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteincore_src_files := $(call all-core-java-files,main) 446ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteincore_resource_dirs := $(call all-core-resource-dirs,main) 456ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 467ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes# The tests' associated resources. 477ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughestest_resource_dirs := $(call all-core-resource-dirs) 486ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 496ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 506ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# 516ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# Build for the target (device). 526ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# 536ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 546ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# Definitions to make the core library. 556ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 566ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteininclude $(CLEAR_VARS) 576ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 586ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_SRC_FILES := $(core_src_files) 596ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) 606ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 616ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_NO_STANDARD_LIBRARIES := true 626ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_DX_FLAGS := --core-library 636ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 646ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_NO_EMMA_INSTRUMENT := true 656ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_NO_EMMA_COMPILE := true 666ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 676ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_MODULE := core 686ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 696ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteininclude $(BUILD_JAVA_LIBRARY) 706ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 716ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteincore-intermediates := ${intermediates} 726ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 736ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 747ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 757ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 767ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes# Definitions to make the core-tests libraries. 777ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes# 787ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes# We make a library per module, because otherwise the .jar files get too 797ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes# large, to the point that dx(1) can't cope (and the build is 807ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes# ridiculously slow). 817ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes# 827ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes# TODO: DalvikRunner will make this nonsense obsolete. 837ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 847ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 857ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,annotation) 867ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 877ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 887ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 897ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 907ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 917ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-annotation 927ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 937ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 947ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 957ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,archive) 967ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 977ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 987ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 997ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 1007ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 1017ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-archive 1027ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 1037ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 1047ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 1057ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,concurrent) 1067ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 1077ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 1087ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 1097ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 1107ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 1117ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-concurrent 1127ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 1137ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 1147ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 1157ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,crypto) 1167ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 1177ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 1187ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 1197ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 1207ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 1217ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-crypto 1227ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 1237ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 1247ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 1257ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,dom) 1267ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 1277ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 1287ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 1297ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 1307ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 1317ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-dom 1327ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 1337ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 1347ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 1357ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,icu) 1367ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 1377ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 1387ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 1397ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 1407ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 1417ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-icu 1427ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 1437ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 1447ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 1457ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,logging) 1467ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 1477ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 1487ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 1497ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 1507ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 1517ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-logging 1527ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 1537ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 1547ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 1557ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,luni-kernel) 1567ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 1577ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 1587ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 1597ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 1607ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 1617ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-luni-kernel 1627ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 1637ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 1647ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 1657ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,luni) 1667ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 1677ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 1687ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes# This module contains the top-level "tests.AllTests" that ties everything 1697ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes# together, so it has compile-time dependencies on all the other test 1707ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes# libraries. 1717ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes# TODO: we should have a bogus module that just contains tests.AllTests for speed. 1727ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 1737ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES += core-tests-annotation core-tests-archive 1747ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES += core-tests-concurrent core-tests-crypto 1757ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES += core-tests-dom core-tests-icu core-tests-logging 1767ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES += core-tests-luni-kernel core-tests-math core-tests-nio 1777ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES += core-tests-nio_char core-tests-prefs core-tests-regex 1787ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES += core-tests-security core-tests-sql core-tests-suncompat 1797ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES += core-tests-text core-tests-x-net core-tests-xml 1807ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 1817ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 1827ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-luni 1837ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 1847ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 1857ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 1867ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,math) 1877ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 1887ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 1897ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 1907ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 1917ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 1927ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-math 1937ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 1947ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 1957ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 1967ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,nio) 1977ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 1987ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 1997ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 2007ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 2017ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 2027ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-nio 2037ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 2047ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 2057ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 2067ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,nio_char) 2077ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 2087ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 2097ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 2107ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 2117ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 2127ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-nio_char 2137ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 2146ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 2156ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteininclude $(CLEAR_VARS) 2167ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,prefs) 2177ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 2187ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 2197ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 2207ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 2217ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 2227ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-prefs 2237ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 2246ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 2257ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 2267ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,regex) 2276ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 2287ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 2297ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 2307ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 2317ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 2327ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-regex 2337ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 2347ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 2357ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 2367ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,security) 2377ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 2387ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 2397ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 2407ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 2417ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 2427ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-security 2437ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 2446ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 2457ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 2467ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,sql) 2477ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 2487ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 2497ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 2507ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 2517ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 2527ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-sql 2537ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 2547ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 2557ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 2567ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,suncompat) 2577ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 2587ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 2597ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 2607ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 2617ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 2627ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-suncompat 2637ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 2647ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 2657ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 2667ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,support) 2677ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 2686ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_NO_STANDARD_LIBRARIES := true 269e75be427785cf47b8236558c96d86beb976802d7Jesse WilsonLOCAL_JAVA_LIBRARIES := core caliper 2706ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_DX_FLAGS := --core-library 2717ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 2727ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-support 2737ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 2746ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 2757ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 2767ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,text) 2777ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 2787ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 2797ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 2807ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 2817ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 2827ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-text 2837ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 2847ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 2857ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 2867ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,x-net) 2877ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 2887ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 2897ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 2907ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 2916ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_MODULE_TAGS := tests 2927ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-x-net 2937ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 2946ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 2957ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesinclude $(CLEAR_VARS) 2967ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_SRC_FILES := $(call all-test-java-files-under,xml) 2977ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) 2987ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_NO_STANDARD_LIBRARIES := true 2997ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_JAVA_LIBRARIES := core caliper core-tests-support 3007ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_DX_FLAGS := --core-library 3017ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE_TAGS := tests 3027ee3a061452c5a7e5c8e661219a1f08a14171858Elliott HughesLOCAL_MODULE := core-tests-xml 3036ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteininclude $(BUILD_JAVA_LIBRARY) 3046ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3056ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3066ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3077ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughes 3086ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# This one's tricky. One of our tests needs to have a 3096ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# resource with a "#" in its name, but Perforce doesn't 3106ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# allow us to submit such a file. So we create it here 3116ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# on-the-fly. 3126ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinTMP_RESOURCE_DIR := $(OUT_DIR)/tmp/ 3136ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinTMP_RESOURCE_FILE := org/apache/harmony/luni/tests/java/lang/test\#.properties 3146ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3156ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein$(TMP_RESOURCE_DIR)$(TMP_RESOURCE_FILE): 3166ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein @mkdir -p $(dir $@) 3176ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein @echo "Hello, world!" > $@ 3186ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3196ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_EXTRA_JAR_ARGS := $(extra_jar_args) -C $(TMP_RESOURCE_DIR) $(TMP_RESOURCE_FILE) 3206ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein$(LOCAL_INTERMEDIATE_TARGETS): $(TMP_RESOURCE_DIR)$(TMP_RESOURCE_FILE) 3216ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3226ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# Definitions for building a version of the core-tests.jar 3236ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# that is suitable for execution on the RI. This JAR would 3246ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# be better located in $HOST_OUT_JAVA_LIBRARIES, but it is 3256ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# not possible to refer to that from a shell script (the 3266ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# variable is not exported from envsetup.sh). There is also 3276ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# some trickery involved: we need to include some classes 3286ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# that reside in core.jar, but since we cannot incldue the 3296ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# whole core.jar in the RI classpath, we copy those classses 3306ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# over to our new file. 3316ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinHOST_CORE_JAR := $(HOST_COMMON_OUT_ROOT)/core-tests.jar 3326ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3336ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein$(HOST_CORE_JAR): PRIVATE_LOCAL_BUILT_MODULE := $(LOCAL_BUILT_MODULE) 3346ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein$(HOST_CORE_JAR): PRIVATE_CORE_INTERMEDIATES := $(core-intermediates) 3356ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein$(HOST_CORE_JAR): $(LOCAL_BUILT_MODULE) 3366ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein @rm -rf $(dir $<)/hostctsclasses 3376ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein $(call unzip-jar-files,$(dir $<)classes.jar,$(dir $<)hostctsclasses) 3386ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein @unzip -qx -o $(PRIVATE_CORE_INTERMEDIATES)/classes.jar dalvik/annotation/* -d $(dir $<)hostctsclasses 3396ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein @cp $< $@ 3406ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein @jar uf $@ -C $(dir $<)hostctsclasses . 3416ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3426ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein$(LOCAL_INSTALLED_MODULE): $(HOST_CORE_JAR) 3436ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3446ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein$(LOCAL_INSTALLED_MODULE): run-core-tests 3456ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3466ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# Definitions to copy the core-tests runner script. 3476ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3486ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteininclude $(CLEAR_VARS) 3496ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_SRC_FILES := run-core-tests 3506ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_MODULE_CLASS := EXECUTABLES 3516ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_MODULE_TAGS := tests 3526ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_MODULE := run-core-tests 3536ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteininclude $(BUILD_PREBUILT) 3546ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3556ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteininclude $(CLEAR_VARS) 3566ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_SRC_FILES := run-core-tests-on-ri 3576ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_IS_HOST_MODULE := true 3586ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_MODULE_CLASS := EXECUTABLES 3596ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_MODULE_TAGS := tests 3606ac43c29e4f1918d40441178c22bfca7409101beDan BornsteinLOCAL_MODULE := run-core-tests-on-ri 3616ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteininclude $(BUILD_PREBUILT) 3626ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3636ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3646ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# 3656ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# Build for the host. 3666ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein# 3676ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3686ac43c29e4f1918d40441178c22bfca7409101beDan Bornsteinifeq ($(WITH_HOST_DALVIK),true) 3696ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3706ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein # Definitions to make the core library. 3716ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3726ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein include $(CLEAR_VARS) 3736ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3746ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein LOCAL_SRC_FILES := $(core_src_files) 3756ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) 3766ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3776ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein LOCAL_NO_STANDARD_LIBRARIES := true 3786ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein LOCAL_DX_FLAGS := --core-library 3796ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3806ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein LOCAL_NO_EMMA_INSTRUMENT := true 3816ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein LOCAL_NO_EMMA_COMPILE := true 3826ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3836ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein LOCAL_MODULE := core 3846ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3856ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein include $(BUILD_HOST_JAVA_LIBRARY) 3866ac43c29e4f1918d40441178c22bfca7409101beDan Bornstein 3877ee3a061452c5a7e5c8e661219a1f08a14171858Elliott Hughesendif 388