Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 1 | # -*- mode: makefile -*- |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 2 | # 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 | |
Elliott Hughes | b9cf9cb | 2010-02-26 14:46:53 -0800 | [diff] [blame] | 24 | # dalvik/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 Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 39 | |
Elliott Hughes | b9cf9cb | 2010-02-26 14:46:53 -0800 | [diff] [blame] | 40 | define all-main-java-files-under |
| 41 | $(foreach dir,$(1),$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(dir)/src/main/java -name "*.java" 2> /dev/null))) |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 42 | endef |
| 43 | |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 44 | define all-test-java-files-under |
Elliott Hughes | b9cf9cb | 2010-02-26 14:46:53 -0800 | [diff] [blame] | 45 | $(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(1)/src/test/java -name "*.java" 2> /dev/null)) |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 46 | endef |
| 47 | |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 48 | define all-core-resource-dirs |
Elliott Hughes | 3e951a5 | 2010-02-22 15:01:55 -0800 | [diff] [blame] | 49 | $(shell cd $(LOCAL_PATH) && ls -d */src/$(1)/{java,resources} 2> /dev/null) |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 50 | endef |
| 51 | |
Elliott Hughes | 3e951a5 | 2010-02-22 15:01:55 -0800 | [diff] [blame] | 52 | # The Java files and their associated resources. |
Elliott Hughes | b9cf9cb | 2010-02-26 14:46:53 -0800 | [diff] [blame] | 53 | core_src_files := $(call all-main-java-files-under,annotation archive auth awt-kernel concurrent crypto dalvik dom icu json junit logging luni luni-kernel math nio nio_char openssl prefs regex security security-kernel sql suncompat support text x-net xml) |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 54 | core_resource_dirs := $(call all-core-resource-dirs,main) |
Elliott Hughes | 3e951a5 | 2010-02-22 15:01:55 -0800 | [diff] [blame] | 55 | test_resource_dirs := $(call all-core-resource-dirs,test) |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 56 | |
| 57 | |
| 58 | # |
| 59 | # Build for the target (device). |
| 60 | # |
| 61 | |
| 62 | # Definitions to make the core library. |
| 63 | |
| 64 | include $(CLEAR_VARS) |
| 65 | |
| 66 | LOCAL_SRC_FILES := $(core_src_files) |
| 67 | LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) |
| 68 | |
| 69 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 70 | LOCAL_DX_FLAGS := --core-library |
| 71 | |
| 72 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 73 | LOCAL_NO_EMMA_COMPILE := true |
| 74 | |
| 75 | LOCAL_MODULE := core |
| 76 | |
| 77 | include $(BUILD_JAVA_LIBRARY) |
| 78 | |
| 79 | core-intermediates := ${intermediates} |
| 80 | |
| 81 | |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 82 | |
Elliott Hughes | b9cf9cb | 2010-02-26 14:46:53 -0800 | [diff] [blame] | 83 | # Definitions to make the sqlite JDBC driver. |
| 84 | |
| 85 | include $(CLEAR_VARS) |
| 86 | LOCAL_SRC_FILES := $(call all-main-java-files-under,sqlite-jdbc) |
| 87 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 88 | LOCAL_JAVA_LIBRARIES := core |
| 89 | LOCAL_MODULE := sqlite-jdbc |
| 90 | include $(BUILD_JAVA_LIBRARY) |
| 91 | |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 92 | |
| 93 | # Definitions to make the core-tests libraries. |
| 94 | # |
| 95 | # We make a library per module, because otherwise the .jar files get too |
| 96 | # large, to the point that dx(1) can't cope (and the build is |
| 97 | # ridiculously slow). |
| 98 | # |
| 99 | # TODO: DalvikRunner will make this nonsense obsolete. |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 100 | |
| 101 | include $(CLEAR_VARS) |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 102 | LOCAL_SRC_FILES := $(call all-test-java-files-under,annotation) |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 103 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 104 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 105 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 106 | LOCAL_DX_FLAGS := --core-library |
| 107 | LOCAL_MODULE_TAGS := tests |
| 108 | LOCAL_MODULE := core-tests-annotation |
| 109 | include $(BUILD_JAVA_LIBRARY) |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 110 | |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 111 | include $(CLEAR_VARS) |
| 112 | LOCAL_SRC_FILES := $(call all-test-java-files-under,archive) |
| 113 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 114 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 115 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 116 | LOCAL_DX_FLAGS := --core-library |
| 117 | LOCAL_MODULE_TAGS := tests |
| 118 | LOCAL_MODULE := core-tests-archive |
| 119 | include $(BUILD_JAVA_LIBRARY) |
| 120 | |
| 121 | include $(CLEAR_VARS) |
| 122 | LOCAL_SRC_FILES := $(call all-test-java-files-under,concurrent) |
| 123 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 124 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 125 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 126 | LOCAL_DX_FLAGS := --core-library |
| 127 | LOCAL_MODULE_TAGS := tests |
| 128 | LOCAL_MODULE := core-tests-concurrent |
| 129 | include $(BUILD_JAVA_LIBRARY) |
| 130 | |
| 131 | include $(CLEAR_VARS) |
| 132 | LOCAL_SRC_FILES := $(call all-test-java-files-under,crypto) |
| 133 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 134 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 135 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 136 | LOCAL_DX_FLAGS := --core-library |
| 137 | LOCAL_MODULE_TAGS := tests |
| 138 | LOCAL_MODULE := core-tests-crypto |
| 139 | include $(BUILD_JAVA_LIBRARY) |
| 140 | |
| 141 | include $(CLEAR_VARS) |
| 142 | LOCAL_SRC_FILES := $(call all-test-java-files-under,dom) |
| 143 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 144 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 145 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 146 | LOCAL_DX_FLAGS := --core-library |
| 147 | LOCAL_MODULE_TAGS := tests |
| 148 | LOCAL_MODULE := core-tests-dom |
| 149 | include $(BUILD_JAVA_LIBRARY) |
| 150 | |
| 151 | include $(CLEAR_VARS) |
| 152 | LOCAL_SRC_FILES := $(call all-test-java-files-under,icu) |
| 153 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 154 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 155 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 156 | LOCAL_DX_FLAGS := --core-library |
| 157 | LOCAL_MODULE_TAGS := tests |
| 158 | LOCAL_MODULE := core-tests-icu |
| 159 | include $(BUILD_JAVA_LIBRARY) |
| 160 | |
| 161 | include $(CLEAR_VARS) |
Elliott Hughes | bf1ecf2 | 2010-02-22 12:45:26 -0800 | [diff] [blame] | 162 | LOCAL_SRC_FILES := $(call all-test-java-files-under,json) |
| 163 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 164 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 165 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
| 166 | LOCAL_DX_FLAGS := --core-library |
| 167 | LOCAL_MODULE_TAGS := tests |
| 168 | LOCAL_MODULE := core-tests-json |
| 169 | include $(BUILD_JAVA_LIBRARY) |
| 170 | |
| 171 | include $(CLEAR_VARS) |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 172 | LOCAL_SRC_FILES := $(call all-test-java-files-under,logging) |
| 173 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 174 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 175 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 176 | LOCAL_DX_FLAGS := --core-library |
| 177 | LOCAL_MODULE_TAGS := tests |
| 178 | LOCAL_MODULE := core-tests-logging |
| 179 | include $(BUILD_JAVA_LIBRARY) |
| 180 | |
| 181 | include $(CLEAR_VARS) |
| 182 | LOCAL_SRC_FILES := $(call all-test-java-files-under,luni-kernel) |
| 183 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 184 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 185 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 186 | LOCAL_DX_FLAGS := --core-library |
| 187 | LOCAL_MODULE_TAGS := tests |
| 188 | LOCAL_MODULE := core-tests-luni-kernel |
| 189 | include $(BUILD_JAVA_LIBRARY) |
| 190 | |
| 191 | include $(CLEAR_VARS) |
| 192 | LOCAL_SRC_FILES := $(call all-test-java-files-under,luni) |
| 193 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 194 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 195 | # This module contains the top-level "tests.AllTests" that ties everything |
| 196 | # together, so it has compile-time dependencies on all the other test |
| 197 | # libraries. |
| 198 | # TODO: we should have a bogus module that just contains tests.AllTests for speed. |
Elliott Hughes | bf1ecf2 | 2010-02-22 12:45:26 -0800 | [diff] [blame] | 199 | LOCAL_JAVA_LIBRARIES := \ |
| 200 | core \ |
| 201 | core-tests-support \ |
| 202 | core-tests-annotation \ |
| 203 | core-tests-archive \ |
| 204 | core-tests-concurrent \ |
| 205 | core-tests-crypto \ |
| 206 | core-tests-dom \ |
| 207 | core-tests-icu \ |
| 208 | core-tests-json \ |
| 209 | core-tests-logging \ |
| 210 | core-tests-luni-kernel \ |
| 211 | core-tests-math \ |
| 212 | core-tests-nio \ |
| 213 | core-tests-nio_char \ |
| 214 | core-tests-prefs \ |
| 215 | core-tests-regex \ |
| 216 | core-tests-security \ |
| 217 | core-tests-sql \ |
| 218 | core-tests-suncompat \ |
| 219 | core-tests-text \ |
| 220 | core-tests-x-net \ |
| 221 | core-tests-xml |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 222 | LOCAL_DX_FLAGS := --core-library |
| 223 | LOCAL_MODULE_TAGS := tests |
| 224 | LOCAL_MODULE := core-tests-luni |
| 225 | include $(BUILD_JAVA_LIBRARY) |
| 226 | |
| 227 | include $(CLEAR_VARS) |
| 228 | LOCAL_SRC_FILES := $(call all-test-java-files-under,math) |
| 229 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 230 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 231 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 232 | LOCAL_DX_FLAGS := --core-library |
| 233 | LOCAL_MODULE_TAGS := tests |
| 234 | LOCAL_MODULE := core-tests-math |
| 235 | include $(BUILD_JAVA_LIBRARY) |
| 236 | |
| 237 | include $(CLEAR_VARS) |
| 238 | LOCAL_SRC_FILES := $(call all-test-java-files-under,nio) |
| 239 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 240 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 241 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 242 | LOCAL_DX_FLAGS := --core-library |
| 243 | LOCAL_MODULE_TAGS := tests |
| 244 | LOCAL_MODULE := core-tests-nio |
| 245 | include $(BUILD_JAVA_LIBRARY) |
| 246 | |
| 247 | include $(CLEAR_VARS) |
| 248 | LOCAL_SRC_FILES := $(call all-test-java-files-under,nio_char) |
| 249 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 250 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 251 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 252 | LOCAL_DX_FLAGS := --core-library |
| 253 | LOCAL_MODULE_TAGS := tests |
| 254 | LOCAL_MODULE := core-tests-nio_char |
| 255 | include $(BUILD_JAVA_LIBRARY) |
| 256 | |
| 257 | include $(CLEAR_VARS) |
| 258 | LOCAL_SRC_FILES := $(call all-test-java-files-under,prefs) |
| 259 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 260 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 261 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 262 | LOCAL_DX_FLAGS := --core-library |
| 263 | LOCAL_MODULE_TAGS := tests |
| 264 | LOCAL_MODULE := core-tests-prefs |
| 265 | include $(BUILD_JAVA_LIBRARY) |
| 266 | |
| 267 | include $(CLEAR_VARS) |
| 268 | LOCAL_SRC_FILES := $(call all-test-java-files-under,regex) |
| 269 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 270 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 271 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 272 | LOCAL_DX_FLAGS := --core-library |
| 273 | LOCAL_MODULE_TAGS := tests |
| 274 | LOCAL_MODULE := core-tests-regex |
| 275 | include $(BUILD_JAVA_LIBRARY) |
| 276 | |
| 277 | include $(CLEAR_VARS) |
| 278 | LOCAL_SRC_FILES := $(call all-test-java-files-under,security) |
| 279 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 280 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 281 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 282 | LOCAL_DX_FLAGS := --core-library |
| 283 | LOCAL_MODULE_TAGS := tests |
| 284 | LOCAL_MODULE := core-tests-security |
| 285 | include $(BUILD_JAVA_LIBRARY) |
| 286 | |
| 287 | include $(CLEAR_VARS) |
| 288 | LOCAL_SRC_FILES := $(call all-test-java-files-under,sql) |
| 289 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 290 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | b9cf9cb | 2010-02-26 14:46:53 -0800 | [diff] [blame] | 291 | LOCAL_JAVA_LIBRARIES := core core-tests-support sqlite-jdbc |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 292 | LOCAL_DX_FLAGS := --core-library |
| 293 | LOCAL_MODULE_TAGS := tests |
| 294 | LOCAL_MODULE := core-tests-sql |
| 295 | include $(BUILD_JAVA_LIBRARY) |
| 296 | |
| 297 | include $(CLEAR_VARS) |
| 298 | LOCAL_SRC_FILES := $(call all-test-java-files-under,suncompat) |
| 299 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 300 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 301 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 302 | LOCAL_DX_FLAGS := --core-library |
| 303 | LOCAL_MODULE_TAGS := tests |
| 304 | LOCAL_MODULE := core-tests-suncompat |
| 305 | include $(BUILD_JAVA_LIBRARY) |
| 306 | |
| 307 | include $(CLEAR_VARS) |
| 308 | LOCAL_SRC_FILES := $(call all-test-java-files-under,support) |
| 309 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 310 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | 67cc34b | 2010-02-19 22:14:19 -0800 | [diff] [blame] | 311 | LOCAL_JAVA_LIBRARIES := core |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 312 | LOCAL_DX_FLAGS := --core-library |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 313 | LOCAL_MODULE_TAGS := tests |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 314 | LOCAL_MODULE := core-tests-support |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 315 | include $(BUILD_JAVA_LIBRARY) |
| 316 | |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 317 | include $(CLEAR_VARS) |
| 318 | LOCAL_SRC_FILES := $(call all-test-java-files-under,text) |
| 319 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 320 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 321 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 322 | LOCAL_DX_FLAGS := --core-library |
| 323 | LOCAL_MODULE_TAGS := tests |
| 324 | LOCAL_MODULE := core-tests-text |
| 325 | include $(BUILD_JAVA_LIBRARY) |
| 326 | |
| 327 | include $(CLEAR_VARS) |
| 328 | LOCAL_SRC_FILES := $(call all-test-java-files-under,x-net) |
| 329 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 330 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 331 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 332 | LOCAL_DX_FLAGS := --core-library |
| 333 | LOCAL_MODULE_TAGS := tests |
| 334 | LOCAL_MODULE := core-tests-x-net |
| 335 | include $(BUILD_JAVA_LIBRARY) |
| 336 | |
| 337 | include $(CLEAR_VARS) |
| 338 | LOCAL_SRC_FILES := $(call all-test-java-files-under,xml) |
| 339 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 340 | LOCAL_NO_STANDARD_LIBRARIES := true |
Elliott Hughes | e2a6f77 | 2010-02-22 12:09:51 -0800 | [diff] [blame] | 341 | LOCAL_JAVA_LIBRARIES := core core-tests-support |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 342 | LOCAL_DX_FLAGS := --core-library |
| 343 | LOCAL_MODULE_TAGS := tests |
| 344 | LOCAL_MODULE := core-tests-xml |
| 345 | include $(BUILD_JAVA_LIBRARY) |
| 346 | |
| 347 | |
Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 348 | |
| 349 | |
| 350 | # This one's tricky. One of our tests needs to have a |
| 351 | # resource with a "#" in its name, but Perforce doesn't |
| 352 | # allow us to submit such a file. So we create it here |
| 353 | # on-the-fly. |
| 354 | TMP_RESOURCE_DIR := $(OUT_DIR)/tmp/ |
| 355 | TMP_RESOURCE_FILE := org/apache/harmony/luni/tests/java/lang/test\#.properties |
| 356 | |
| 357 | $(TMP_RESOURCE_DIR)$(TMP_RESOURCE_FILE): |
| 358 | @mkdir -p $(dir $@) |
| 359 | @echo "Hello, world!" > $@ |
| 360 | |
| 361 | $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_EXTRA_JAR_ARGS := $(extra_jar_args) -C $(TMP_RESOURCE_DIR) $(TMP_RESOURCE_FILE) |
| 362 | $(LOCAL_INTERMEDIATE_TARGETS): $(TMP_RESOURCE_DIR)$(TMP_RESOURCE_FILE) |
| 363 | |
| 364 | # Definitions for building a version of the core-tests.jar |
| 365 | # that is suitable for execution on the RI. This JAR would |
| 366 | # be better located in $HOST_OUT_JAVA_LIBRARIES, but it is |
| 367 | # not possible to refer to that from a shell script (the |
| 368 | # variable is not exported from envsetup.sh). There is also |
| 369 | # some trickery involved: we need to include some classes |
| 370 | # that reside in core.jar, but since we cannot incldue the |
| 371 | # whole core.jar in the RI classpath, we copy those classses |
| 372 | # over to our new file. |
| 373 | HOST_CORE_JAR := $(HOST_COMMON_OUT_ROOT)/core-tests.jar |
| 374 | |
| 375 | $(HOST_CORE_JAR): PRIVATE_LOCAL_BUILT_MODULE := $(LOCAL_BUILT_MODULE) |
| 376 | $(HOST_CORE_JAR): PRIVATE_CORE_INTERMEDIATES := $(core-intermediates) |
| 377 | $(HOST_CORE_JAR): $(LOCAL_BUILT_MODULE) |
| 378 | @rm -rf $(dir $<)/hostctsclasses |
| 379 | $(call unzip-jar-files,$(dir $<)classes.jar,$(dir $<)hostctsclasses) |
| 380 | @unzip -qx -o $(PRIVATE_CORE_INTERMEDIATES)/classes.jar dalvik/annotation/* -d $(dir $<)hostctsclasses |
| 381 | @cp $< $@ |
| 382 | @jar uf $@ -C $(dir $<)hostctsclasses . |
| 383 | |
| 384 | $(LOCAL_INSTALLED_MODULE): $(HOST_CORE_JAR) |
| 385 | |
| 386 | $(LOCAL_INSTALLED_MODULE): run-core-tests |
| 387 | |
| 388 | # Definitions to copy the core-tests runner script. |
| 389 | |
| 390 | include $(CLEAR_VARS) |
| 391 | LOCAL_SRC_FILES := run-core-tests |
| 392 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 393 | LOCAL_MODULE_TAGS := tests |
| 394 | LOCAL_MODULE := run-core-tests |
| 395 | include $(BUILD_PREBUILT) |
| 396 | |
| 397 | include $(CLEAR_VARS) |
| 398 | LOCAL_SRC_FILES := run-core-tests-on-ri |
| 399 | LOCAL_IS_HOST_MODULE := true |
| 400 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 401 | LOCAL_MODULE_TAGS := tests |
| 402 | LOCAL_MODULE := run-core-tests-on-ri |
| 403 | include $(BUILD_PREBUILT) |
| 404 | |
| 405 | |
| 406 | # |
| 407 | # Build for the host. |
| 408 | # |
| 409 | |
| 410 | ifeq ($(WITH_HOST_DALVIK),true) |
| 411 | |
| 412 | # Definitions to make the core library. |
| 413 | |
| 414 | include $(CLEAR_VARS) |
| 415 | |
| 416 | LOCAL_SRC_FILES := $(core_src_files) |
| 417 | LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) |
| 418 | |
| 419 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 420 | LOCAL_DX_FLAGS := --core-library |
| 421 | |
| 422 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 423 | LOCAL_NO_EMMA_COMPILE := true |
| 424 | |
| 425 | LOCAL_MODULE := core |
| 426 | |
| 427 | include $(BUILD_HOST_JAVA_LIBRARY) |
| 428 | |
Elliott Hughes | 7ee3a06 | 2010-02-18 17:20:15 -0800 | [diff] [blame] | 429 | endif |