• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
62LOCAL_BUILD_HOST_DEX := true
63include $(BUILD_HOST_JAVA_LIBRARY)
64endif
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
70include $(CLEAR_VARS)
71LOCAL_SRC_FILES := $(junit-runner-files)
72LOCAL_MODULE := junit-runner
73LOCAL_MODULE_TAGS := optional
74include $(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
80ifeq ($(WITH_HOST_DALVIK),true)
81include $(CLEAR_VARS)
82LOCAL_SRC_FILES := $(junit-runner-files)
83LOCAL_MODULE := junit-runner-hostdex
84LOCAL_MODULE_TAGS := optional
85LOCAL_BUILD_HOST_DEX := true
86LOCAL_JAVA_LIBRARIES := core-junit-hostdex
87include $(BUILD_HOST_JAVA_LIBRARY)
88endif
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
97include $(CLEAR_VARS)
98
99LOCAL_SRC_FILES := $(call all-java-files-under, src/org)
100LOCAL_SRC_FILES += $(call all-java-files-under, src/junit/extensions)
101LOCAL_SRC_FILES += $(call all-java-files-under, src/junit/runner)
102LOCAL_SRC_FILES += $(call all-java-files-under, src/junit/textui)
103LOCAL_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
109LOCAL_MODULE := junit4-target
110LOCAL_MODULE_TAGS := optional
111LOCAL_SDK_VERSION := 4
112LOCAL_STATIC_JAVA_LIBRARIES := hamcrest
113include $(BUILD_STATIC_JAVA_LIBRARY)
114
115