Android.mk revision 629d1ed25951956101c4614335d054a3df9b8828
158a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# Copyright (C) 2009 The Android Open Source Project
258a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot#
358a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# Licensed under the Apache License, Version 2.0 (the "License");
458a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# you may not use this file except in compliance with the License.
558a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# You may obtain a copy of the License at
658a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot#
758a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot#      http://www.apache.org/licenses/LICENSE-2.0
858a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot#
958a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# Unless required by applicable law or agreed to in writing, software
1058a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# distributed under the License is distributed on an "AS IS" BASIS,
1158a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1258a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# See the License for the specific language governing permissions and
1358a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot# limitations under the License.
1458a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot#
1558a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot#
1658a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot
1758a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett ChabotLOCAL_PATH := $(call my-dir)
1824c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
1924c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# include definition of core-junit-files
2024c41072583e508dd0cd190785dabd07580e58a3Brett Chabotinclude $(LOCAL_PATH)/Common.mk
2124c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
2224c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# note: ideally this should be junit-host, but leave as is for now to avoid
2324c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# changing all its dependencies
24629d1ed25951956101c4614335d054a3df9b8828Elliott Hughesinclude $(CLEAR_VARS)
25629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_SRC_FILES := $(call all-java-files-under, src)
2658a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett ChabotLOCAL_MODULE := junit
27b3823db9f1192d8c81345740b3e65bd6738ba55bBrett ChabotLOCAL_MODULE_TAGS := optional
28b3823db9f1192d8c81345740b3e65bd6738ba55bBrett ChabotLOCAL_STATIC_JAVA_LIBRARIES := hamcrest-host
29629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
3058a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabotinclude $(BUILD_HOST_JAVA_LIBRARY)
3124c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
3224c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# ----------------------------------
33629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes# build a junit-targetdex jar
3424c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
3524c41072583e508dd0cd190785dabd07580e58a3Brett Chabotinclude $(CLEAR_VARS)
36629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions)
37629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_SRC_FILES += $(core-junit-files)
38629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_SRC_FILES += $(junit-runner-files)
39629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_MODULE := junit-targetdex # TODO: lose the suffix here and rename "junit" to "junit-hostdex"
40629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_MODULE_TAGS := tests
41629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/junit
42629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
43629d1ed25951956101c4614335d054a3df9b8828Elliott Hughesinclude $(BUILD_JAVA_LIBRARY)
4424c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
45629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes# ----------------------------------
46629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes# build a junit-hostdex jar
47629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes
48629d1ed25951956101c4614335d054a3df9b8828Elliott Hughesinclude $(CLEAR_VARS)
4924c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions)
5024c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_SRC_FILES += $(core-junit-files)
51629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_SRC_FILES += $(junit-runner-files)
52629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_MODULE := junit-hostdex
53629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
54629d1ed25951956101c4614335d054a3df9b8828Elliott Hughesinclude $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
55629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes
56629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes# ----------------------------------
57629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes# build a core-junit target jar that is built into Android system image
5824c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
59629d1ed25951956101c4614335d054a3df9b8828Elliott Hughes# TODO: remove extensions once core-tests is no longer dependent on it
60629d1ed25951956101c4614335d054a3df9b8828Elliott Hughesinclude $(CLEAR_VARS)
61629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions)
62629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_SRC_FILES += $(core-junit-files)
6324c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_NO_STANDARD_LIBRARIES := true
6424c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_JAVA_LIBRARIES := core
6524c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_JAVACFLAGS := $(local_javac_flags)
6624c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_MODULE_TAGS := optional
6724c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_MODULE := core-junit
68629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
6924c41072583e508dd0cd190785dabd07580e58a3Brett Chabotinclude $(BUILD_JAVA_LIBRARY)
7024c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
7124c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# ----------------------------------
7224c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# build a core-junit-hostdex jar that contains exactly the same classes
7324c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# as core-junit.
7424c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
758badf4d23f7b3a0d1884934fa92955bc69638d76Elliott Hughesifeq ($(WITH_HOST_DALVIK),true)
7624c41072583e508dd0cd190785dabd07580e58a3Brett Chabotinclude $(CLEAR_VARS)
7724c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# TODO: remove extensions once apache-harmony/luni/ is no longer dependent
7824c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# on it
7924c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions)
8024c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_SRC_FILES += $(core-junit-files)
8124c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_JAVACFLAGS := $(local_javac_flags)
8224c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_MODULE_TAGS := optional
8324c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_MODULE := core-junit-hostdex
84629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
85c2140d6b308fb9b0bf3126d3bceb4ef4fdd63373Narayan Kamathinclude $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
867f17dff221008bad170ad266bca05db65a3888b9Ying Wangendif
877f17dff221008bad170ad266bca05db65a3888b9Ying Wang
88131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot#-------------------------------------------------------
89c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# build a junit-runner jar for the host JVM
90c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# (like the junit classes in the frameworks/base android.test.runner.jar)
9141b2b155ae49e696f71c65b8b30345663860127bBrett Chabot
9241b2b155ae49e696f71c65b8b30345663860127bBrett Chabotinclude $(CLEAR_VARS)
9341b2b155ae49e696f71c65b8b30345663860127bBrett ChabotLOCAL_SRC_FILES := $(junit-runner-files)
9441b2b155ae49e696f71c65b8b30345663860127bBrett ChabotLOCAL_MODULE := junit-runner
9541b2b155ae49e696f71c65b8b30345663860127bBrett ChabotLOCAL_MODULE_TAGS := optional
96629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
9741b2b155ae49e696f71c65b8b30345663860127bBrett Chabotinclude $(BUILD_STATIC_JAVA_LIBRARY)
9841b2b155ae49e696f71c65b8b30345663860127bBrett Chabot
9941b2b155ae49e696f71c65b8b30345663860127bBrett Chabot#-------------------------------------------------------
100c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# build a junit-runner for the host dalvikvm
101c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# (like the junit classes in the frameworks/base android.test.runner.jar)
102c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes
1038badf4d23f7b3a0d1884934fa92955bc69638d76Elliott Hughesifeq ($(WITH_HOST_DALVIK),true)
104c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughesinclude $(CLEAR_VARS)
105c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_SRC_FILES := $(junit-runner-files)
106c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_MODULE := junit-runner-hostdex
107c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_MODULE_TAGS := optional
108c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_JAVA_LIBRARIES := core-junit-hostdex
109629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
110c2140d6b308fb9b0bf3126d3bceb4ef4fdd63373Narayan Kamathinclude $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
1118badf4d23f7b3a0d1884934fa92955bc69638d76Elliott Hughesendif
112c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes
113c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes#-------------------------------------------------------
114131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# build a junit4-target jar representing the
115131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# classes in external/junit that are not in the core public API 4
116131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# Note: 'core' here means excluding the classes that are contained
117131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# in the optional library android.test.runner. Developers who
118131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# build against this jar shouldn't have to also include android.test.runner
119131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot
120131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabotinclude $(CLEAR_VARS)
1217706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_SRC_FILES := $(junit4-target-src)
122131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_MODULE := junit4-target
123131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_MODULE_TAGS := optional
124131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_SDK_VERSION := 4
125131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_STATIC_JAVA_LIBRARIES := hamcrest
126629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
127131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabotinclude $(BUILD_STATIC_JAVA_LIBRARY)
128131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot
1297706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabot#-------------------------------------------------------
1307706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabot# Same as above, but does not statically link in dependencies
1317706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabot
1327706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabotinclude $(CLEAR_VARS)
1337706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_SRC_FILES := $(junit4-target-src)
1347706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_MODULE := junit4-target-nodeps
1357706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_MODULE_TAGS := optional
1367706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_SDK_VERSION := 4
1377706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_JAVA_LIBRARIES := hamcrest
138629d1ed25951956101c4614335d054a3df9b8828Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
1397706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabotinclude $(BUILD_STATIC_JAVA_LIBRARY)
140