Android.mk revision 41b2b155ae49e696f71c65b8b30345663860127b
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
49ifeq ($(WITH_HOST_DALVIK),true)
50# ----------------------------------
51# build a core-junit-hostdex jar that contains exactly the same classes
52# as core-junit.
53
54include $(CLEAR_VARS)
55
56# TODO: remove extensions once apache-harmony/luni/ is no longer dependent
57# on it
58LOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions)
59LOCAL_SRC_FILES += $(core-junit-files)
60LOCAL_NO_STANDARD_LIBRARIES := true
61LOCAL_JAVA_LIBRARIES := core-hostdex
62LOCAL_JAVACFLAGS := $(local_javac_flags)
63LOCAL_MODULE_TAGS := optional
64LOCAL_MODULE := core-junit-hostdex
65LOCAL_BUILD_HOST_DEX := true
66include $(BUILD_HOST_JAVA_LIBRARY)
67
68endif
69
70#-------------------------------------------------------
71# build a junit-runner jar representing the
72# junit classes in the frameworks/base android.test.runner.jar
73
74include $(CLEAR_VARS)
75
76LOCAL_SRC_FILES := $(junit-runner-files)
77LOCAL_MODULE := junit-runner
78LOCAL_MODULE_TAGS := optional
79include $(BUILD_STATIC_JAVA_LIBRARY)
80
81#-------------------------------------------------------
82# build a junit4-target jar representing the
83# classes in external/junit that are not in the core public API 4
84# Note: 'core' here means excluding the classes that are contained
85# in the optional library android.test.runner. Developers who
86# build against this jar shouldn't have to also include android.test.runner
87
88include $(CLEAR_VARS)
89
90LOCAL_SRC_FILES := $(call all-java-files-under, src/org)
91LOCAL_SRC_FILES += $(call all-java-files-under, src/junit/extensions)
92LOCAL_SRC_FILES += $(call all-java-files-under, src/junit/runner)
93LOCAL_SRC_FILES += $(call all-java-files-under, src/junit/textui)
94LOCAL_SRC_FILES += \
95	src/junit/framework/ComparisonCompactor.java \
96	src/junit/framework/JUnit4TestAdapterCache.java \
97	src/junit/framework/JUnit4TestAdapter.java \
98	src/junit/framework/JUnit4TestCaseFacade.java
99
100LOCAL_MODULE := junit4-target
101LOCAL_MODULE_TAGS := optional
102LOCAL_SDK_VERSION := 4
103LOCAL_STATIC_JAVA_LIBRARIES := hamcrest
104include $(BUILD_STATIC_JAVA_LIBRARY)
105
106