Android.mk revision f410e840531c92fd0e205cbdff6c4daa0eec901d
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_NO_STANDARD_LIBRARIES := true
41LOCAL_JAVA_LIBRARIES := core-libart
42LOCAL_MODULE_TAGS := tests
43LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/junit
44LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
45include $(BUILD_JAVA_LIBRARY)
46
47# ----------------------------------
48# build a junit-hostdex jar
49
50include $(CLEAR_VARS)
51LOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions)
52LOCAL_SRC_FILES += $(core-junit-files)
53LOCAL_SRC_FILES += $(junit-runner-files)
54LOCAL_MODULE := junit-hostdex
55LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
56include $(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
62include $(CLEAR_VARS)
63LOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions)
64LOCAL_SRC_FILES += $(core-junit-files)
65LOCAL_NO_STANDARD_LIBRARIES := true
66LOCAL_JAVA_LIBRARIES := core-libart
67LOCAL_JAVACFLAGS := $(local_javac_flags)
68LOCAL_MODULE_TAGS := optional
69LOCAL_MODULE := core-junit
70LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
71include $(BUILD_JAVA_LIBRARY)
72
73# ----------------------------------
74# build a core-junit-hostdex jar that contains exactly the same classes
75# as core-junit.
76
77include $(CLEAR_VARS)
78# TODO: remove extensions once apache-harmony/luni/ is no longer dependent
79# on it
80LOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions)
81LOCAL_SRC_FILES += $(core-junit-files)
82LOCAL_JAVACFLAGS := $(local_javac_flags)
83LOCAL_MODULE_TAGS := optional
84LOCAL_MODULE := core-junit-hostdex
85LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
86include $(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
92include $(CLEAR_VARS)
93LOCAL_SRC_FILES := $(junit-runner-files)
94LOCAL_MODULE := junit-runner
95LOCAL_NO_STANDARD_LIBRARIES := true
96LOCAL_JAVA_LIBRARIES := core-libart core-junit
97LOCAL_MODULE_TAGS := optional
98LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
99include $(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
105include $(CLEAR_VARS)
106LOCAL_SRC_FILES := $(junit-runner-files)
107LOCAL_MODULE := junit-runner-hostdex
108LOCAL_MODULE_TAGS := optional
109LOCAL_NO_STANDARD_LIBRARIES := true
110LOCAL_JAVA_LIBRARIES := core-libart-hostdex core-junit-hostdex
111LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
112include $(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
121include $(CLEAR_VARS)
122LOCAL_SRC_FILES := $(junit4-target-src)
123LOCAL_MODULE := junit4-target
124LOCAL_MODULE_TAGS := optional
125LOCAL_SDK_VERSION := 4
126LOCAL_STATIC_JAVA_LIBRARIES := hamcrest
127LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
128include $(BUILD_STATIC_JAVA_LIBRARY)
129
130#-------------------------------------------------------
131# Same as above, but does not statically link in dependencies
132
133include $(CLEAR_VARS)
134LOCAL_SRC_FILES := $(junit4-target-src)
135LOCAL_MODULE := junit4-target-nodeps
136LOCAL_MODULE_TAGS := optional
137LOCAL_SDK_VERSION := 4
138LOCAL_JAVA_LIBRARIES := hamcrest
139LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
140include $(BUILD_STATIC_JAVA_LIBRARY)
141