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