Android.mk revision c241b3c9de1586523893e0c43a41f66ae2204a11
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
2258a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabotinclude $(CLEAR_VARS)
2358a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot
2458a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett ChabotLOCAL_SRC_FILES := $(call all-java-files-under, src)
2558a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabot
2624c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# note: ideally this should be junit-host, but leave as is for now to avoid
2724c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# changing all its dependencies
2858a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett ChabotLOCAL_MODULE := junit
29b3823db9f1192d8c81345740b3e65bd6738ba55bBrett ChabotLOCAL_MODULE_TAGS := optional
30b3823db9f1192d8c81345740b3e65bd6738ba55bBrett ChabotLOCAL_STATIC_JAVA_LIBRARIES := hamcrest-host
3158a8b0aba2dec5695628a2bf25a3fae42c2c3533Brett Chabotinclude $(BUILD_HOST_JAVA_LIBRARY)
3224c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
3324c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# ----------------------------------
3424c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# build a core-junit target jar that is built into Android system image
3524c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
3624c41072583e508dd0cd190785dabd07580e58a3Brett Chabotinclude $(CLEAR_VARS)
3724c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
3824c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# TODO: remove extensions once core-tests is no longer dependent on it
3924c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions)
4024c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_SRC_FILES += $(core-junit-files)
4124c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
4224c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_NO_STANDARD_LIBRARIES := true
4324c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_JAVA_LIBRARIES := core
4424c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_JAVACFLAGS := $(local_javac_flags)
4524c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_MODULE_TAGS := optional
4624c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_MODULE := core-junit
4724c41072583e508dd0cd190785dabd07580e58a3Brett Chabotinclude $(BUILD_JAVA_LIBRARY)
4824c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
497f17dff221008bad170ad266bca05db65a3888b9Ying Wangifeq ($(WITH_HOST_DALVIK),true)
5024c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# ----------------------------------
5124c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# build a core-junit-hostdex jar that contains exactly the same classes
5224c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# as core-junit.
5324c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
5424c41072583e508dd0cd190785dabd07580e58a3Brett Chabotinclude $(CLEAR_VARS)
5524c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
5624c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# TODO: remove extensions once apache-harmony/luni/ is no longer dependent
5724c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# on it
5824c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions)
5924c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_SRC_FILES += $(core-junit-files)
6024c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_NO_STANDARD_LIBRARIES := true
6124c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_JAVA_LIBRARIES := core-hostdex
6224c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_JAVACFLAGS := $(local_javac_flags)
6324c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_MODULE_TAGS := optional
6424c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_MODULE := core-junit-hostdex
6524c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_BUILD_HOST_DEX := true
6624c41072583e508dd0cd190785dabd07580e58a3Brett Chabotinclude $(BUILD_HOST_JAVA_LIBRARY)
6724c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
687f17dff221008bad170ad266bca05db65a3888b9Ying Wangendif
697f17dff221008bad170ad266bca05db65a3888b9Ying Wang
70131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot#-------------------------------------------------------
71c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# build a junit-runner jar for the host JVM
72c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# (like the junit classes in the frameworks/base android.test.runner.jar)
7341b2b155ae49e696f71c65b8b30345663860127bBrett Chabot
7441b2b155ae49e696f71c65b8b30345663860127bBrett Chabotinclude $(CLEAR_VARS)
7541b2b155ae49e696f71c65b8b30345663860127bBrett ChabotLOCAL_SRC_FILES := $(junit-runner-files)
7641b2b155ae49e696f71c65b8b30345663860127bBrett ChabotLOCAL_MODULE := junit-runner
7741b2b155ae49e696f71c65b8b30345663860127bBrett ChabotLOCAL_MODULE_TAGS := optional
7841b2b155ae49e696f71c65b8b30345663860127bBrett Chabotinclude $(BUILD_STATIC_JAVA_LIBRARY)
7941b2b155ae49e696f71c65b8b30345663860127bBrett Chabot
8041b2b155ae49e696f71c65b8b30345663860127bBrett Chabot#-------------------------------------------------------
81c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# build a junit-runner for the host dalvikvm
82c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# (like the junit classes in the frameworks/base android.test.runner.jar)
83c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes
84c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughesinclude $(CLEAR_VARS)
85c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_SRC_FILES := $(junit-runner-files)
86c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_MODULE := junit-runner-hostdex
87c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_MODULE_TAGS := optional
88c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_BUILD_HOST_DEX := true
89c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_JAVA_LIBRARIES := core-junit-hostdex
90c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughesinclude $(BUILD_HOST_JAVA_LIBRARY)
91c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes
92c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes#-------------------------------------------------------
93131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# build a junit4-target jar representing the
94131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# classes in external/junit that are not in the core public API 4
95131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# Note: 'core' here means excluding the classes that are contained
96131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# in the optional library android.test.runner. Developers who
97131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# build against this jar shouldn't have to also include android.test.runner
98131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot
99131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabotinclude $(CLEAR_VARS)
100131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot
101131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_SRC_FILES := $(call all-java-files-under, src/org)
102131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_SRC_FILES += $(call all-java-files-under, src/junit/extensions)
103131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_SRC_FILES += $(call all-java-files-under, src/junit/runner)
104131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_SRC_FILES += $(call all-java-files-under, src/junit/textui)
105131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_SRC_FILES += \
106131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot	src/junit/framework/ComparisonCompactor.java \
107131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot	src/junit/framework/JUnit4TestAdapterCache.java \
108131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot	src/junit/framework/JUnit4TestAdapter.java \
109131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot	src/junit/framework/JUnit4TestCaseFacade.java
110131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot
111131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_MODULE := junit4-target
112131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_MODULE_TAGS := optional
113131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_SDK_VERSION := 4
114131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_STATIC_JAVA_LIBRARIES := hamcrest
115131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabotinclude $(BUILD_STATIC_JAVA_LIBRARY)
116131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot
117