Android.mk revision c2140d6b308fb9b0bf3126d3bceb4ef4fdd63373
1# Copyright (C) 2009 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 17LOCAL_PATH := $(call my-dir) 18 19# include definition of core-junit-files 20include $(LOCAL_PATH)/Common.mk 21 22include $(CLEAR_VARS) 23 24LOCAL_SRC_FILES := $(call all-java-files-under, src) 25 26# note: ideally this should be junit-host, but leave as is for now to avoid 27# changing all its dependencies 28LOCAL_MODULE := junit 29LOCAL_MODULE_TAGS := optional 30LOCAL_STATIC_JAVA_LIBRARIES := hamcrest-host 31include $(BUILD_HOST_JAVA_LIBRARY) 32 33# ---------------------------------- 34# build a core-junit target jar that is built into Android system image 35 36include $(CLEAR_VARS) 37 38# TODO: remove extensions once core-tests is no longer dependent on it 39LOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions) 40LOCAL_SRC_FILES += $(core-junit-files) 41 42LOCAL_NO_STANDARD_LIBRARIES := true 43LOCAL_JAVA_LIBRARIES := core 44LOCAL_JAVACFLAGS := $(local_javac_flags) 45LOCAL_MODULE_TAGS := optional 46LOCAL_MODULE := core-junit 47include $(BUILD_JAVA_LIBRARY) 48 49# ---------------------------------- 50# build a core-junit-hostdex jar that contains exactly the same classes 51# as core-junit. 52 53ifeq ($(WITH_HOST_DALVIK),true) 54include $(CLEAR_VARS) 55# TODO: remove extensions once apache-harmony/luni/ is no longer dependent 56# on it 57LOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions) 58LOCAL_SRC_FILES += $(core-junit-files) 59LOCAL_JAVACFLAGS := $(local_javac_flags) 60LOCAL_MODULE_TAGS := optional 61LOCAL_MODULE := core-junit-hostdex 62include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) 63endif 64 65#------------------------------------------------------- 66# build a junit-runner jar for the host JVM 67# (like the junit classes in the frameworks/base android.test.runner.jar) 68 69include $(CLEAR_VARS) 70LOCAL_SRC_FILES := $(junit-runner-files) 71LOCAL_MODULE := junit-runner 72LOCAL_MODULE_TAGS := optional 73include $(BUILD_STATIC_JAVA_LIBRARY) 74 75#------------------------------------------------------- 76# build a junit-runner for the host dalvikvm 77# (like the junit classes in the frameworks/base android.test.runner.jar) 78 79ifeq ($(WITH_HOST_DALVIK),true) 80include $(CLEAR_VARS) 81LOCAL_SRC_FILES := $(junit-runner-files) 82LOCAL_MODULE := junit-runner-hostdex 83LOCAL_MODULE_TAGS := optional 84LOCAL_JAVA_LIBRARIES := core-junit-hostdex 85include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) 86endif 87 88#------------------------------------------------------- 89# build a junit4-target jar representing the 90# classes in external/junit that are not in the core public API 4 91# Note: 'core' here means excluding the classes that are contained 92# in the optional library android.test.runner. Developers who 93# build against this jar shouldn't have to also include android.test.runner 94 95include $(CLEAR_VARS) 96 97LOCAL_SRC_FILES := $(junit4-target-src) 98 99LOCAL_MODULE := junit4-target 100LOCAL_MODULE_TAGS := optional 101LOCAL_SDK_VERSION := 4 102LOCAL_STATIC_JAVA_LIBRARIES := hamcrest 103include $(BUILD_STATIC_JAVA_LIBRARY) 104 105#------------------------------------------------------- 106# Same as above, but does not statically link in dependencies 107 108include $(CLEAR_VARS) 109 110LOCAL_SRC_FILES := $(junit4-target-src) 111 112LOCAL_MODULE := junit4-target-nodeps 113LOCAL_MODULE_TAGS := optional 114LOCAL_SDK_VERSION := 4 115LOCAL_JAVA_LIBRARIES := hamcrest 116include $(BUILD_STATIC_JAVA_LIBRARY) 117 118