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