| Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 1 | # Copyright (C) 2007 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | # |
| 16 | # Definitions for building the Java library and associated tests. |
| 17 | # |
| 18 | |
| 19 | # |
| 20 | # Common definitions for host and target. |
| 21 | # |
| 22 | |
| Jesse Wilson | d5d3526 | 2010-05-12 23:56:14 -0700 | [diff] [blame^] | 23 | # libcore is divided into modules. |
| 24 | # |
| 25 | # The structure of each module is: |
| 26 | # |
| 27 | # src/ |
| 28 | # main/ # To be shipped on every device. |
| 29 | # java/ # Java source for library code. |
| 30 | # native/ # C++ source for library code. |
| 31 | # resources/ # Support files. |
| 32 | # test/ # Built only on demand, for testing. |
| 33 | # java/ # Java source for tests. |
| 34 | # native/ # C++ source for tests (rare). |
| 35 | # resources/ # Support files. |
| 36 | # |
| 37 | # All subdirectories are optional (hence the "2> /dev/null"s below). |
| Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 38 | |
| Jesse Wilson | 32cfe95 | 2010-05-04 16:36:03 -0700 | [diff] [blame] | 39 | define all-main-java-files-under |
| 40 | $(foreach dir,$(1),$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(dir)/src/main/java -name "*.java" 2> /dev/null))) |
| 41 | endef |
| 42 | |
| 43 | define all-test-java-files-under |
| 44 | $(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(1)/src/test/java -name "*.java" 2> /dev/null)) |
| Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 45 | endef |
| 46 | |
| Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 47 | define all-core-resource-dirs |
| 48 | $(shell cd $(LOCAL_PATH) && ls -d */src/$(1)/{java,resources} 2> /dev/null) |
| 49 | endef |
| 50 | |
| Jesse Wilson | d5d3526 | 2010-05-12 23:56:14 -0700 | [diff] [blame^] | 51 | # The Java files and their associated resources. |
| Jesse Wilson | 32cfe95 | 2010-05-04 16:36:03 -0700 | [diff] [blame] | 52 | core_src_files := $(call all-main-java-files-under,annotation archive auth awt-kernel concurrent crypto dalvik dom icu json 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] | 53 | core_resource_dirs := $(call all-core-resource-dirs,main) |
| Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 54 | test_resource_dirs := $(call all-core-resource-dirs,test) |
| 55 | |
| 56 | |
| 57 | # |
| 58 | # Build for the target (device). |
| 59 | # |
| 60 | |
| 61 | # Definitions to make the core library. |
| 62 | |
| 63 | include $(CLEAR_VARS) |
| 64 | |
| 65 | LOCAL_SRC_FILES := $(core_src_files) |
| 66 | LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) |
| 67 | |
| Guang Zhu | 709c24d | 2010-03-10 15:51:58 -0800 | [diff] [blame] | 68 | ifeq ($(EMMA_INSTRUMENT),true) |
| 69 | LOCAL_SRC_FILES += $(call all-java-files-under, ../../external/emma/core ../../external/emma/pregenerated) |
| 70 | LOCAL_JAVA_RESOURCE_DIRS += ../../external/emma/core/res ../../external/emma/pregenerated/res |
| 71 | endif |
| 72 | |
| Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 73 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 74 | LOCAL_DX_FLAGS := --core-library |
| 75 | |
| 76 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 77 | LOCAL_NO_EMMA_COMPILE := true |
| 78 | |
| 79 | LOCAL_MODULE := core |
| 80 | |
| 81 | include $(BUILD_JAVA_LIBRARY) |
| 82 | |
| 83 | core-intermediates := ${intermediates} |
| 84 | |
| 85 | |
| Jesse Wilson | 32cfe95 | 2010-05-04 16:36:03 -0700 | [diff] [blame] | 86 | # Make core-junit |
| 87 | include $(CLEAR_VARS) |
| 88 | LOCAL_SRC_FILES := $(call all-main-java-files-under,junit) |
| 89 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 90 | LOCAL_JAVA_LIBRARIES := core |
| 91 | LOCAL_MODULE := core-junit |
| 92 | include $(BUILD_JAVA_LIBRARY) |
| 93 | |
| 94 | |
| Jesse Wilson | d5d3526 | 2010-05-12 23:56:14 -0700 | [diff] [blame^] | 95 | # Definitions to make the core-tests libraries. |
| 96 | # |
| 97 | # We make a library per module, because otherwise the .jar files get too |
| 98 | # large, to the point that dx(1) can't cope (and the build is |
| 99 | # ridiculously slow). |
| 100 | # |
| 101 | # TODO: DalvikRunner will make this nonsense obsolete. |
| Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 102 | |
| 103 | include $(CLEAR_VARS) |
| Jesse Wilson | d5d3526 | 2010-05-12 23:56:14 -0700 | [diff] [blame^] | 104 | LOCAL_SRC_FILES := $(call all-test-java-files-under,annotation) |
| Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 105 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| Jesse Wilson | d5d3526 | 2010-05-12 23:56:14 -0700 | [diff] [blame^] | 106 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 107 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 108 | LOCAL_DX_FLAGS := --core-library |
| 109 | LOCAL_MODULE_TAGS := tests |
| 110 | LOCAL_MODULE := core-tests-annotation |
| 111 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 112 | LOCAL_NO_EMMA_COMPILE := true |
| 113 | include $(BUILD_JAVA_LIBRARY) |
| Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 114 | |
| Jesse Wilson | d5d3526 | 2010-05-12 23:56:14 -0700 | [diff] [blame^] | 115 | include $(CLEAR_VARS) |
| 116 | LOCAL_SRC_FILES := $(call all-test-java-files-under,archive) |
| 117 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 118 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 119 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 120 | LOCAL_DX_FLAGS := --core-library |
| 121 | LOCAL_MODULE_TAGS := tests |
| 122 | LOCAL_MODULE := core-tests-archive |
| 123 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 124 | LOCAL_NO_EMMA_COMPILE := true |
| 125 | include $(BUILD_JAVA_LIBRARY) |
| 126 | |
| 127 | include $(CLEAR_VARS) |
| 128 | LOCAL_SRC_FILES := $(call all-test-java-files-under,concurrent) |
| 129 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 130 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 131 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 132 | LOCAL_DX_FLAGS := --core-library |
| 133 | LOCAL_MODULE_TAGS := tests |
| 134 | LOCAL_MODULE := core-tests-concurrent |
| 135 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 136 | LOCAL_NO_EMMA_COMPILE := true |
| 137 | include $(BUILD_JAVA_LIBRARY) |
| 138 | |
| 139 | include $(CLEAR_VARS) |
| 140 | LOCAL_SRC_FILES := $(call all-test-java-files-under,crypto) |
| 141 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 142 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 143 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 144 | LOCAL_DX_FLAGS := --core-library |
| 145 | LOCAL_MODULE_TAGS := tests |
| 146 | LOCAL_MODULE := core-tests-crypto |
| 147 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 148 | LOCAL_NO_EMMA_COMPILE := true |
| 149 | include $(BUILD_JAVA_LIBRARY) |
| 150 | |
| 151 | include $(CLEAR_VARS) |
| 152 | LOCAL_SRC_FILES := $(call all-test-java-files-under,dom) |
| 153 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 154 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 155 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 156 | LOCAL_DX_FLAGS := --core-library |
| 157 | LOCAL_MODULE_TAGS := tests |
| 158 | LOCAL_MODULE := core-tests-dom |
| 159 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 160 | LOCAL_NO_EMMA_COMPILE := true |
| 161 | include $(BUILD_JAVA_LIBRARY) |
| 162 | |
| 163 | include $(CLEAR_VARS) |
| 164 | LOCAL_SRC_FILES := $(call all-test-java-files-under,icu) |
| 165 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 166 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 167 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 168 | LOCAL_DX_FLAGS := --core-library |
| 169 | LOCAL_MODULE_TAGS := tests |
| 170 | LOCAL_MODULE := core-tests-icu |
| 171 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 172 | LOCAL_NO_EMMA_COMPILE := true |
| 173 | include $(BUILD_JAVA_LIBRARY) |
| 174 | |
| 175 | include $(CLEAR_VARS) |
| 176 | LOCAL_SRC_FILES := $(call all-test-java-files-under,json) |
| 177 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 178 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 179 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 180 | LOCAL_DX_FLAGS := --core-library |
| 181 | LOCAL_MODULE_TAGS := tests |
| 182 | LOCAL_MODULE := core-tests-json |
| 183 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 184 | LOCAL_NO_EMMA_COMPILE := true |
| 185 | include $(BUILD_JAVA_LIBRARY) |
| 186 | |
| 187 | include $(CLEAR_VARS) |
| 188 | LOCAL_SRC_FILES := $(call all-test-java-files-under,logging) |
| 189 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 190 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 191 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 192 | LOCAL_DX_FLAGS := --core-library |
| 193 | LOCAL_MODULE_TAGS := tests |
| 194 | LOCAL_MODULE := core-tests-logging |
| 195 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 196 | LOCAL_NO_EMMA_COMPILE := true |
| 197 | include $(BUILD_JAVA_LIBRARY) |
| 198 | |
| 199 | include $(CLEAR_VARS) |
| 200 | LOCAL_SRC_FILES := $(call all-test-java-files-under,luni) |
| 201 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 202 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 203 | # This module contains the top-level "tests.AllTests" that ties everything |
| 204 | # together, so it has compile-time dependencies on all the other test |
| 205 | # libraries. |
| 206 | # TODO: we should have a bogus module that just contains tests.AllTests for speed. |
| 207 | LOCAL_JAVA_LIBRARIES := \ |
| 208 | core \ |
| 209 | core-junit \ |
| 210 | core-tests-annotation \ |
| 211 | core-tests-archive \ |
| 212 | core-tests-concurrent \ |
| 213 | core-tests-crypto \ |
| 214 | core-tests-dom \ |
| 215 | core-tests-icu \ |
| 216 | core-tests-json \ |
| 217 | core-tests-logging \ |
| 218 | core-tests-luni-kernel \ |
| 219 | core-tests-math \ |
| 220 | core-tests-nio \ |
| 221 | core-tests-nio_char \ |
| 222 | core-tests-prefs \ |
| 223 | core-tests-regex \ |
| 224 | core-tests-security \ |
| 225 | core-tests-sql \ |
| 226 | core-tests-suncompat \ |
| 227 | core-tests-support \ |
| 228 | core-tests-text \ |
| 229 | core-tests-x-net \ |
| 230 | core-tests-xml |
| 231 | LOCAL_DX_FLAGS := --core-library |
| 232 | LOCAL_MODULE_TAGS := tests |
| 233 | LOCAL_MODULE := core-tests-luni |
| 234 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 235 | LOCAL_NO_EMMA_COMPILE := true |
| 236 | include $(BUILD_JAVA_LIBRARY) |
| 237 | |
| 238 | include $(CLEAR_VARS) |
| 239 | LOCAL_SRC_FILES := $(call all-test-java-files-under,luni-kernel) |
| 240 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 241 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 242 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 243 | LOCAL_DX_FLAGS := --core-library |
| 244 | LOCAL_MODULE_TAGS := tests |
| 245 | LOCAL_MODULE := core-tests-luni-kernel |
| 246 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 247 | LOCAL_NO_EMMA_COMPILE := true |
| 248 | include $(BUILD_JAVA_LIBRARY) |
| 249 | |
| 250 | include $(CLEAR_VARS) |
| 251 | LOCAL_SRC_FILES := $(call all-test-java-files-under,math) |
| 252 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 253 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 254 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 255 | LOCAL_DX_FLAGS := --core-library |
| 256 | LOCAL_MODULE_TAGS := tests |
| 257 | LOCAL_MODULE := core-tests-math |
| 258 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 259 | LOCAL_NO_EMMA_COMPILE := true |
| 260 | include $(BUILD_JAVA_LIBRARY) |
| 261 | |
| 262 | include $(CLEAR_VARS) |
| 263 | LOCAL_SRC_FILES := $(call all-test-java-files-under,nio) |
| 264 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 265 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 266 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 267 | LOCAL_DX_FLAGS := --core-library |
| 268 | LOCAL_MODULE_TAGS := tests |
| 269 | LOCAL_MODULE := core-tests-nio |
| 270 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 271 | LOCAL_NO_EMMA_COMPILE := true |
| 272 | include $(BUILD_JAVA_LIBRARY) |
| 273 | |
| 274 | include $(CLEAR_VARS) |
| 275 | LOCAL_SRC_FILES := $(call all-test-java-files-under,nio_char) |
| 276 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 277 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 278 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 279 | LOCAL_DX_FLAGS := --core-library |
| 280 | LOCAL_MODULE_TAGS := tests |
| 281 | LOCAL_MODULE := core-tests-nio_char |
| 282 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 283 | LOCAL_NO_EMMA_COMPILE := true |
| 284 | include $(BUILD_JAVA_LIBRARY) |
| 285 | |
| 286 | include $(CLEAR_VARS) |
| 287 | LOCAL_SRC_FILES := $(call all-test-java-files-under,prefs) |
| 288 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 289 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 290 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 291 | LOCAL_DX_FLAGS := --core-library |
| 292 | LOCAL_MODULE_TAGS := tests |
| 293 | LOCAL_MODULE := core-tests-prefs |
| 294 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 295 | LOCAL_NO_EMMA_COMPILE := true |
| 296 | include $(BUILD_JAVA_LIBRARY) |
| 297 | |
| 298 | include $(CLEAR_VARS) |
| 299 | LOCAL_SRC_FILES := $(call all-test-java-files-under,regex) |
| 300 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 301 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 302 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 303 | LOCAL_DX_FLAGS := --core-library |
| 304 | LOCAL_MODULE_TAGS := tests |
| 305 | LOCAL_MODULE := core-tests-regex |
| 306 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 307 | LOCAL_NO_EMMA_COMPILE := true |
| 308 | include $(BUILD_JAVA_LIBRARY) |
| 309 | |
| 310 | include $(CLEAR_VARS) |
| 311 | LOCAL_SRC_FILES := $(call all-test-java-files-under,security) |
| 312 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 313 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 314 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 315 | LOCAL_DX_FLAGS := --core-library |
| 316 | LOCAL_MODULE_TAGS := tests |
| 317 | LOCAL_MODULE := core-tests-security |
| 318 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 319 | LOCAL_NO_EMMA_COMPILE := true |
| 320 | include $(BUILD_JAVA_LIBRARY) |
| 321 | |
| 322 | include $(CLEAR_VARS) |
| 323 | LOCAL_SRC_FILES := $(call all-test-java-files-under,sql) |
| 324 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 325 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 326 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 327 | LOCAL_DX_FLAGS := --core-library |
| 328 | LOCAL_MODULE_TAGS := tests |
| 329 | LOCAL_MODULE := core-tests-sql |
| 330 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 331 | LOCAL_NO_EMMA_COMPILE := true |
| 332 | include $(BUILD_JAVA_LIBRARY) |
| 333 | |
| 334 | include $(CLEAR_VARS) |
| 335 | LOCAL_SRC_FILES := $(call all-test-java-files-under,suncompat) |
| 336 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 337 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 338 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 339 | LOCAL_DX_FLAGS := --core-library |
| 340 | LOCAL_MODULE_TAGS := tests |
| 341 | LOCAL_MODULE := core-tests-suncompat |
| 342 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 343 | LOCAL_NO_EMMA_COMPILE := true |
| 344 | include $(BUILD_JAVA_LIBRARY) |
| 345 | |
| 346 | include $(CLEAR_VARS) |
| 347 | LOCAL_SRC_FILES := $(call all-test-java-files-under,support) $(call all-test-java-files-under,junit) |
| 348 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 349 | LOCAL_NO_STANDARD_LIBRARIES := true |
| Jesse Wilson | 32cfe95 | 2010-05-04 16:36:03 -0700 | [diff] [blame] | 350 | LOCAL_JAVA_LIBRARIES := core core-junit |
| Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 351 | LOCAL_DX_FLAGS := --core-library |
| Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 352 | LOCAL_MODULE_TAGS := tests |
| Jesse Wilson | d5d3526 | 2010-05-12 23:56:14 -0700 | [diff] [blame^] | 353 | LOCAL_MODULE := core-tests-support |
| Guang Zhu | f69aac3 | 2010-04-28 11:33:48 -0700 | [diff] [blame] | 354 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 355 | LOCAL_NO_EMMA_COMPILE := true |
| Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 356 | include $(BUILD_JAVA_LIBRARY) |
| 357 | |
| Jesse Wilson | d5d3526 | 2010-05-12 23:56:14 -0700 | [diff] [blame^] | 358 | include $(CLEAR_VARS) |
| 359 | LOCAL_SRC_FILES := $(call all-test-java-files-under,text) |
| 360 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 361 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 362 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 363 | LOCAL_DX_FLAGS := --core-library |
| 364 | LOCAL_MODULE_TAGS := tests |
| 365 | LOCAL_MODULE := core-tests-text |
| 366 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 367 | LOCAL_NO_EMMA_COMPILE := true |
| 368 | include $(BUILD_JAVA_LIBRARY) |
| Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 369 | |
| Jesse Wilson | d5d3526 | 2010-05-12 23:56:14 -0700 | [diff] [blame^] | 370 | include $(CLEAR_VARS) |
| 371 | LOCAL_SRC_FILES := $(call all-test-java-files-under,x-net) |
| 372 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 373 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 374 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-support |
| 375 | LOCAL_DX_FLAGS := --core-library |
| 376 | LOCAL_MODULE_TAGS := tests |
| 377 | LOCAL_MODULE := core-tests-x-net |
| 378 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 379 | LOCAL_NO_EMMA_COMPILE := true |
| 380 | include $(BUILD_JAVA_LIBRARY) |
| 381 | |
| 382 | include $(CLEAR_VARS) |
| 383 | LOCAL_SRC_FILES := $(call all-test-java-files-under,xml) |
| 384 | LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) |
| 385 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 386 | LOCAL_JAVA_LIBRARIES := core core-junit core-tests-dom core-tests-support |
| 387 | LOCAL_DX_FLAGS := --core-library |
| 388 | LOCAL_MODULE_TAGS := tests |
| 389 | LOCAL_MODULE := core-tests-xml |
| 390 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 391 | LOCAL_NO_EMMA_COMPILE := true |
| 392 | include $(BUILD_JAVA_LIBRARY) |
| Dan Bornstein | 6ac43c2 | 2009-10-24 15:33:49 -0700 | [diff] [blame] | 393 | |
| 394 | # This one's tricky. One of our tests needs to have a |
| 395 | # resource with a "#" in its name, but Perforce doesn't |
| 396 | # allow us to submit such a file. So we create it here |
| 397 | # on-the-fly. |
| 398 | TMP_RESOURCE_DIR := $(OUT_DIR)/tmp/ |
| 399 | TMP_RESOURCE_FILE := org/apache/harmony/luni/tests/java/lang/test\#.properties |
| 400 | |
| 401 | $(TMP_RESOURCE_DIR)$(TMP_RESOURCE_FILE): |
| 402 | @mkdir -p $(dir $@) |
| 403 | @echo "Hello, world!" > $@ |
| 404 | |
| 405 | $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_EXTRA_JAR_ARGS := $(extra_jar_args) -C $(TMP_RESOURCE_DIR) $(TMP_RESOURCE_FILE) |
| 406 | $(LOCAL_INTERMEDIATE_TARGETS): $(TMP_RESOURCE_DIR)$(TMP_RESOURCE_FILE) |
| 407 | |
| 408 | # Definitions for building a version of the core-tests.jar |
| 409 | # that is suitable for execution on the RI. This JAR would |
| 410 | # be better located in $HOST_OUT_JAVA_LIBRARIES, but it is |
| 411 | # not possible to refer to that from a shell script (the |
| 412 | # variable is not exported from envsetup.sh). There is also |
| 413 | # some trickery involved: we need to include some classes |
| 414 | # that reside in core.jar, but since we cannot incldue the |
| 415 | # whole core.jar in the RI classpath, we copy those classses |
| 416 | # over to our new file. |
| 417 | HOST_CORE_JAR := $(HOST_COMMON_OUT_ROOT)/core-tests.jar |
| 418 | |
| 419 | $(HOST_CORE_JAR): PRIVATE_LOCAL_BUILT_MODULE := $(LOCAL_BUILT_MODULE) |
| 420 | $(HOST_CORE_JAR): PRIVATE_CORE_INTERMEDIATES := $(core-intermediates) |
| 421 | $(HOST_CORE_JAR): $(LOCAL_BUILT_MODULE) |
| 422 | @rm -rf $(dir $<)/hostctsclasses |
| 423 | $(call unzip-jar-files,$(dir $<)classes.jar,$(dir $<)hostctsclasses) |
| 424 | @unzip -qx -o $(PRIVATE_CORE_INTERMEDIATES)/classes.jar dalvik/annotation/* -d $(dir $<)hostctsclasses |
| 425 | @cp $< $@ |
| 426 | @jar uf $@ -C $(dir $<)hostctsclasses . |
| 427 | |
| 428 | $(LOCAL_INSTALLED_MODULE): $(HOST_CORE_JAR) |
| 429 | |
| 430 | $(LOCAL_INSTALLED_MODULE): run-core-tests |
| 431 | |
| 432 | # Definitions to copy the core-tests runner script. |
| 433 | |
| 434 | include $(CLEAR_VARS) |
| 435 | LOCAL_SRC_FILES := run-core-tests |
| 436 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 437 | LOCAL_MODULE_TAGS := tests |
| 438 | LOCAL_MODULE := run-core-tests |
| 439 | include $(BUILD_PREBUILT) |
| 440 | |
| 441 | include $(CLEAR_VARS) |
| 442 | LOCAL_SRC_FILES := run-core-tests-on-ri |
| 443 | LOCAL_IS_HOST_MODULE := true |
| 444 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 445 | LOCAL_MODULE_TAGS := tests |
| 446 | LOCAL_MODULE := run-core-tests-on-ri |
| 447 | include $(BUILD_PREBUILT) |
| 448 | |
| 449 | |
| 450 | # |
| 451 | # Build for the host. |
| 452 | # |
| 453 | |
| 454 | ifeq ($(WITH_HOST_DALVIK),true) |
| 455 | |
| 456 | # Definitions to make the core library. |
| 457 | |
| 458 | include $(CLEAR_VARS) |
| 459 | |
| 460 | LOCAL_SRC_FILES := $(core_src_files) |
| 461 | LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) |
| 462 | |
| 463 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 464 | LOCAL_DX_FLAGS := --core-library |
| 465 | |
| 466 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 467 | LOCAL_NO_EMMA_COMPILE := true |
| 468 | |
| 469 | LOCAL_MODULE := core |
| 470 | |
| 471 | include $(BUILD_HOST_JAVA_LIBRARY) |
| 472 | |
| Elliott Hughes | 67cc34b | 2010-02-19 22:14:19 -0800 | [diff] [blame] | 473 | endif |