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