158a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# Copyright (C) 2009 The Android Open Source Project 258a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# 358a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# Licensed under the Apache License, Version 2.0 (the "License"); 458a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# you may not use this file except in compliance with the License. 558a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# You may obtain a copy of the License at 658a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# 758a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# http://www.apache.org/licenses/LICENSE-2.0 858a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# 958a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# Unless required by applicable law or agreed to in writing, software 1058a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# distributed under the License is distributed on an "AS IS" BASIS, 1158a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1258a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# See the License for the specific language governing permissions and 1358a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# limitations under the License. 1458a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# 1558a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# 1658a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot 1758a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett ChabotLOCAL_PATH := $(call my-dir) 1824c41072583e508dd0cd190785dabd07580e58a3Brett Chabot 1924c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# include definition of core-junit-files 2024c41072583e508dd0cd190785dabd07580e58a3Brett Chabotinclude $(LOCAL_PATH)/Common.mk 2124c41072583e508dd0cd190785dabd07580e58a3Brett Chabot 2224c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# note: ideally this should be junit-host, but leave as is for now to avoid 2324c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# changing all its dependencies 24629d1ed25951956101c4614335d054a3df9b8828Elliott Hughesinclude $(CLEAR_VARS) 25629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_SRC_FILES := $(call all-java-files-under, src) 2658a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett ChabotLOCAL_MODULE := junit 27b3823db9f1192d8c81345740b3e65bd6738ba55bBrett ChabotLOCAL_MODULE_TAGS := optional 28b3823db9f1192d8c81345740b3e65bd6738ba55bBrett ChabotLOCAL_STATIC_JAVA_LIBRARIES := hamcrest-host 29629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk 3058a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabotinclude $(BUILD_HOST_JAVA_LIBRARY) 3124c41072583e508dd0cd190785dabd07580e58a3Brett Chabot 3224c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# ---------------------------------- 33629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes# build a junit-targetdex jar 3424c41072583e508dd0cd190785dabd07580e58a3Brett Chabot 3524c41072583e508dd0cd190785dabd07580e58a3Brett Chabotinclude $(CLEAR_VARS) 36629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions) 37629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_SRC_FILES += $(core-junit-files) 38629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_SRC_FILES += $(junit-runner-files) 39629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_MODULE := junit-targetdex # TODO: lose the suffix here and rename "junit" to "junit-hostdex" 40f410e840531c92fd0e205cbdff6c4daa0eec901dBrian CarlstromLOCAL_NO_STANDARD_LIBRARIES := true 41f410e840531c92fd0e205cbdff6c4daa0eec901dBrian CarlstromLOCAL_JAVA_LIBRARIES := core-libart 42629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_MODULE_TAGS := tests 43629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/junit 44629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk 45629d1ed25951956101c4614335d054a3df9b8828Elliott Hughesinclude $(BUILD_JAVA_LIBRARY) 4624c41072583e508dd0cd190785dabd07580e58a3Brett Chabot 47629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes# ---------------------------------- 48629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes# build a junit-hostdex jar 49629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes 50b9ba574505d3ae4540f43d6100356c738bd9eef0Narayan Kamathifeq ($(HOST_OS),linux) 51629d1ed25951956101c4614335d054a3df9b8828Elliott Hughesinclude $(CLEAR_VARS) 5224c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions) 5324c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_SRC_FILES += $(core-junit-files) 54629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_SRC_FILES += $(junit-runner-files) 55629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_MODULE := junit-hostdex 56629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk 57629d1ed25951956101c4614335d054a3df9b8828Elliott Hughesinclude $(BUILD_HOST_DALVIK_JAVA_LIBRARY) 58b9ba574505d3ae4540f43d6100356c738bd9eef0Narayan Kamathendif # HOST_OS == linux 59629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes 60629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes# ---------------------------------- 61629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes# build a core-junit target jar that is built into Android system image 6224c41072583e508dd0cd190785dabd07580e58a3Brett Chabot 63629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes# TODO: remove extensions once core-tests is no longer dependent on it 64629d1ed25951956101c4614335d054a3df9b8828Elliott Hughesinclude $(CLEAR_VARS) 65629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions) 66629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_SRC_FILES += $(core-junit-files) 6724c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_NO_STANDARD_LIBRARIES := true 68f410e840531c92fd0e205cbdff6c4daa0eec901dBrian CarlstromLOCAL_JAVA_LIBRARIES := core-libart 6924c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_MODULE_TAGS := optional 7024c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_MODULE := core-junit 71629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk 7224c41072583e508dd0cd190785dabd07580e58a3Brett Chabotinclude $(BUILD_JAVA_LIBRARY) 7324c41072583e508dd0cd190785dabd07580e58a3Brett Chabot 7424c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# ---------------------------------- 7524c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# build a core-junit-hostdex jar that contains exactly the same classes 7624c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# as core-junit. 7724c41072583e508dd0cd190785dabd07580e58a3Brett Chabot 78b9ba574505d3ae4540f43d6100356c738bd9eef0Narayan Kamathifeq ($(HOST_OS),linux) 7924c41072583e508dd0cd190785dabd07580e58a3Brett Chabotinclude $(CLEAR_VARS) 8024c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# TODO: remove extensions once apache-harmony/luni/ is no longer dependent 8124c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# on it 8224c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions) 8324c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_SRC_FILES += $(core-junit-files) 8424c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_MODULE_TAGS := optional 8524c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_MODULE := core-junit-hostdex 86629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk 87c2140d6b308fb9b0bf3126d3bceb4ef4fdd63373Narayan Kamathinclude $(BUILD_HOST_DALVIK_JAVA_LIBRARY) 88b9ba574505d3ae4540f43d6100356c738bd9eef0Narayan Kamathendif # HOST_OS == linux 897f17dff221008bad170ad266bca05db65a3888b9Ying Wang 90131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot#------------------------------------------------------- 91c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# build a junit-runner jar for the host JVM 92c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# (like the junit classes in the frameworks/base android.test.runner.jar) 9341b2b155ae49e696f71c65b8b30345663860127bBrett Chabot 9441b2b155ae49e696f71c65b8b30345663860127bBrett Chabotinclude $(CLEAR_VARS) 9541b2b155ae49e696f71c65b8b30345663860127bBrett ChabotLOCAL_SRC_FILES := $(junit-runner-files) 9641b2b155ae49e696f71c65b8b30345663860127bBrett ChabotLOCAL_MODULE := junit-runner 97f410e840531c92fd0e205cbdff6c4daa0eec901dBrian CarlstromLOCAL_NO_STANDARD_LIBRARIES := true 98f410e840531c92fd0e205cbdff6c4daa0eec901dBrian CarlstromLOCAL_JAVA_LIBRARIES := core-libart core-junit 9941b2b155ae49e696f71c65b8b30345663860127bBrett ChabotLOCAL_MODULE_TAGS := optional 100629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk 10141b2b155ae49e696f71c65b8b30345663860127bBrett Chabotinclude $(BUILD_STATIC_JAVA_LIBRARY) 10241b2b155ae49e696f71c65b8b30345663860127bBrett Chabot 10341b2b155ae49e696f71c65b8b30345663860127bBrett Chabot#------------------------------------------------------- 104c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# build a junit-runner for the host dalvikvm 105c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# (like the junit classes in the frameworks/base android.test.runner.jar) 106c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes 107c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughesinclude $(CLEAR_VARS) 108c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_SRC_FILES := $(junit-runner-files) 109c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_MODULE := junit-runner-hostdex 110c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_MODULE_TAGS := optional 111f410e840531c92fd0e205cbdff6c4daa0eec901dBrian CarlstromLOCAL_NO_STANDARD_LIBRARIES := true 112f410e840531c92fd0e205cbdff6c4daa0eec901dBrian CarlstromLOCAL_JAVA_LIBRARIES := core-libart-hostdex core-junit-hostdex 113629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk 114c2140d6b308fb9b0bf3126d3bceb4ef4fdd63373Narayan Kamathinclude $(BUILD_HOST_DALVIK_JAVA_LIBRARY) 115c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes 116c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes#------------------------------------------------------- 117131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# build a junit4-target jar representing the 118131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# classes in external/junit that are not in the core public API 4 119131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# Note: 'core' here means excluding the classes that are contained 120131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# in the optional library android.test.runner. Developers who 121131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# build against this jar shouldn't have to also include android.test.runner 122131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot 123131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabotinclude $(CLEAR_VARS) 1247706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_SRC_FILES := $(junit4-target-src) 125131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_MODULE := junit4-target 126131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_MODULE_TAGS := optional 127131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_SDK_VERSION := 4 128131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_STATIC_JAVA_LIBRARIES := hamcrest 129629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk 130131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabotinclude $(BUILD_STATIC_JAVA_LIBRARY) 131131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot 1327706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabot#------------------------------------------------------- 1337706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabot# Same as above, but does not statically link in dependencies 1347706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabot 1357706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabotinclude $(CLEAR_VARS) 1367706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_SRC_FILES := $(junit4-target-src) 1377706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_MODULE := junit4-target-nodeps 1387706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_MODULE_TAGS := optional 1397706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_SDK_VERSION := 4 1407706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_JAVA_LIBRARIES := hamcrest 141629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk 1427706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabotinclude $(BUILD_STATIC_JAVA_LIBRARY) 143