Android.mk revision 7706e9d67d5ff8e0b143234ebb6e71b2c8ffae5f
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
4924c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# ----------------------------------
5024c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# build a core-junit-hostdex jar that contains exactly the same classes
5124c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# as core-junit.
5224c41072583e508dd0cd190785dabd07580e58a3Brett Chabot
538badf4d23f7b3a0d1884934fa92955bc69638d76Elliott Hughesifeq ($(WITH_HOST_DALVIK),true)
5424c41072583e508dd0cd190785dabd07580e58a3Brett Chabotinclude $(CLEAR_VARS)
5524c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# TODO: remove extensions once apache-harmony/luni/ is no longer dependent
5624c41072583e508dd0cd190785dabd07580e58a3Brett Chabot# on it
5724c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions)
5824c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_SRC_FILES += $(core-junit-files)
5924c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_JAVACFLAGS := $(local_javac_flags)
6024c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_MODULE_TAGS := optional
6124c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_MODULE := core-junit-hostdex
6224c41072583e508dd0cd190785dabd07580e58a3Brett ChabotLOCAL_BUILD_HOST_DEX := true
6324c41072583e508dd0cd190785dabd07580e58a3Brett Chabotinclude $(BUILD_HOST_JAVA_LIBRARY)
647f17dff221008bad170ad266bca05db65a3888b9Ying Wangendif
657f17dff221008bad170ad266bca05db65a3888b9Ying Wang
66131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot#-------------------------------------------------------
67c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# build a junit-runner jar for the host JVM
68c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# (like the junit classes in the frameworks/base android.test.runner.jar)
6941b2b155ae49e696f71c65b8b30345663860127bBrett Chabot
7041b2b155ae49e696f71c65b8b30345663860127bBrett Chabotinclude $(CLEAR_VARS)
7141b2b155ae49e696f71c65b8b30345663860127bBrett ChabotLOCAL_SRC_FILES := $(junit-runner-files)
7241b2b155ae49e696f71c65b8b30345663860127bBrett ChabotLOCAL_MODULE := junit-runner
7341b2b155ae49e696f71c65b8b30345663860127bBrett ChabotLOCAL_MODULE_TAGS := optional
7441b2b155ae49e696f71c65b8b30345663860127bBrett Chabotinclude $(BUILD_STATIC_JAVA_LIBRARY)
7541b2b155ae49e696f71c65b8b30345663860127bBrett Chabot
7641b2b155ae49e696f71c65b8b30345663860127bBrett Chabot#-------------------------------------------------------
77c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# build a junit-runner for the host dalvikvm
78c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes# (like the junit classes in the frameworks/base android.test.runner.jar)
79c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes
808badf4d23f7b3a0d1884934fa92955bc69638d76Elliott Hughesifeq ($(WITH_HOST_DALVIK),true)
81c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughesinclude $(CLEAR_VARS)
82c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_SRC_FILES := $(junit-runner-files)
83c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_MODULE := junit-runner-hostdex
84c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_MODULE_TAGS := optional
85c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_BUILD_HOST_DEX := true
86c241b3c9de1586523893e0c43a41f66ae2204a11Elliott HughesLOCAL_JAVA_LIBRARIES := core-junit-hostdex
87c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughesinclude $(BUILD_HOST_JAVA_LIBRARY)
888badf4d23f7b3a0d1884934fa92955bc69638d76Elliott Hughesendif
89c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes
90c241b3c9de1586523893e0c43a41f66ae2204a11Elliott Hughes#-------------------------------------------------------
91131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# build a junit4-target jar representing the
92131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# classes in external/junit that are not in the core public API 4
93131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# Note: 'core' here means excluding the classes that are contained
94131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# in the optional library android.test.runner. Developers who
95131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot# build against this jar shouldn't have to also include android.test.runner
96131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot
97131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabotinclude $(CLEAR_VARS)
98131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot
997706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_SRC_FILES := $(junit4-target-src)
100131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot
101131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_MODULE := junit4-target
102131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_MODULE_TAGS := optional
103131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_SDK_VERSION := 4
104131ae36bedb326432f4b830c12abfb1274cc391bBrett ChabotLOCAL_STATIC_JAVA_LIBRARIES := hamcrest
105131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabotinclude $(BUILD_STATIC_JAVA_LIBRARY)
106131ae36bedb326432f4b830c12abfb1274cc391bBrett Chabot
1077706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabot#-------------------------------------------------------
1087706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabot# Same as above, but does not statically link in dependencies
1097706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabot
1107706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabotinclude $(CLEAR_VARS)
1117706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabot
1127706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_SRC_FILES := $(junit4-target-src)
1137706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabot
1147706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_MODULE := junit4-target-nodeps
1157706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_MODULE_TAGS := optional
1167706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_SDK_VERSION := 4
1177706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett ChabotLOCAL_JAVA_LIBRARIES := hamcrest
1187706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabotinclude $(BUILD_STATIC_JAVA_LIBRARY)
1197706e9d67d5ff8e0b143234ebb6e71b2c8ffae5fBrett Chabot
120