Android.mk revision 8badf4d23f7b3a0d1884934fa92955bc69638d76
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_NO_STANDARD_LIBRARIES := true 60LOCAL_JAVA_LIBRARIES := core-hostdex 61LOCAL_JAVACFLAGS := $(local_javac_flags) 62LOCAL_MODULE_TAGS := optional 63LOCAL_MODULE := core-junit-hostdex 64LOCAL_BUILD_HOST_DEX := true 65include $(BUILD_HOST_JAVA_LIBRARY) 66endif 67 68#------------------------------------------------------- 69# build a junit-runner jar for the host JVM 70# (like the junit classes in the frameworks/base android.test.runner.jar) 71 72include $(CLEAR_VARS) 73LOCAL_SRC_FILES := $(junit-runner-files) 74LOCAL_MODULE := junit-runner 75LOCAL_MODULE_TAGS := optional 76include $(BUILD_STATIC_JAVA_LIBRARY) 77 78#------------------------------------------------------- 79# build a junit-runner for the host dalvikvm 80# (like the junit classes in the frameworks/base android.test.runner.jar) 81 82ifeq ($(WITH_HOST_DALVIK),true) 83include $(CLEAR_VARS) 84LOCAL_SRC_FILES := $(junit-runner-files) 85LOCAL_MODULE := junit-runner-hostdex 86LOCAL_MODULE_TAGS := optional 87LOCAL_BUILD_HOST_DEX := true 88LOCAL_JAVA_LIBRARIES := core-junit-hostdex 89include $(BUILD_HOST_JAVA_LIBRARY) 90endif 91 92#------------------------------------------------------- 93# build a junit4-target jar representing the 94# classes in external/junit that are not in the core public API 4 95# Note: 'core' here means excluding the classes that are contained 96# in the optional library android.test.runner. Developers who 97# build against this jar shouldn't have to also include android.test.runner 98 99include $(CLEAR_VARS) 100 101LOCAL_SRC_FILES := $(call all-java-files-under, src/org) 102LOCAL_SRC_FILES += $(call all-java-files-under, src/junit/extensions) 103LOCAL_SRC_FILES += $(call all-java-files-under, src/junit/runner) 104LOCAL_SRC_FILES += $(call all-java-files-under, src/junit/textui) 105LOCAL_SRC_FILES += \ 106 src/junit/framework/ComparisonCompactor.java \ 107 src/junit/framework/JUnit4TestAdapterCache.java \ 108 src/junit/framework/JUnit4TestAdapter.java \ 109 src/junit/framework/JUnit4TestCaseFacade.java 110 111LOCAL_MODULE := junit4-target 112LOCAL_MODULE_TAGS := optional 113LOCAL_SDK_VERSION := 4 114LOCAL_STATIC_JAVA_LIBRARIES := hamcrest 115include $(BUILD_STATIC_JAVA_LIBRARY) 116 117