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