Android.mk revision 94a1844242a3725d9314f2e2dbcdf0ab58b0f1c1
15ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# Copyright (C) 2015 The Android Open Source Project
25ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills#
35ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# Licensed under the Apache License, Version 2.0 (the "License");
45ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# you may not use this file except in compliance with the License.
55ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# You may obtain a copy of the License at
65ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills#
75ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills#      http://www.apache.org/licenses/LICENSE-2.0
85ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills#
95ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# Unless required by applicable law or agreed to in writing, software
105ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# distributed under the License is distributed on an "AS IS" BASIS,
115ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
125ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# See the License for the specific language governing permissions and
135ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills# limitations under the License.
145ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills
155ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell WillsLOCAL_PATH:= $(call my-dir)
16956f54b391677d78379729dd14518edddf3c7660Etan Cohen
17956f54b391677d78379729dd14518edddf3c7660Etan Cohen# Make mock HAL library
18956f54b391677d78379729dd14518edddf3c7660Etan Cohen# ============================================================
19956f54b391677d78379729dd14518edddf3c7660Etan Cohen
20956f54b391677d78379729dd14518edddf3c7660Etan Coheninclude $(CLEAR_VARS)
21956f54b391677d78379729dd14518edddf3c7660Etan Cohen
22956f54b391677d78379729dd14518edddf3c7660Etan CohenLOCAL_REQUIRED_MODULES :=
23956f54b391677d78379729dd14518edddf3c7660Etan Cohen
24208f92c4d8457374ff507996d58ffa5586d1ecd5Mitchell WillsLOCAL_CFLAGS += -Wall -Werror -Wextra -Wno-unused-parameter -Wno-unused-function \
25208f92c4d8457374ff507996d58ffa5586d1ecd5Mitchell Wills                -Wunused-variable -Winit-self -Wwrite-strings -Wshadow
26956f54b391677d78379729dd14518edddf3c7660Etan Cohen
27956f54b391677d78379729dd14518edddf3c7660Etan CohenLOCAL_C_INCLUDES += \
28956f54b391677d78379729dd14518edddf3c7660Etan Cohen	$(JNI_H_INCLUDE) \
29956f54b391677d78379729dd14518edddf3c7660Etan Cohen	$(LOCAL_PATH)/../../service/jni \
30956f54b391677d78379729dd14518edddf3c7660Etan Cohen	$(call include-path-for, libhardware)/hardware \
31956f54b391677d78379729dd14518edddf3c7660Etan Cohen	$(call include-path-for, libhardware_legacy)/hardware_legacy \
32956f54b391677d78379729dd14518edddf3c7660Etan Cohen	packages/apps/Test/connectivity/sl4n/rapidjson/include \
33956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libcore/include
34956f54b391677d78379729dd14518edddf3c7660Etan Cohen
35956f54b391677d78379729dd14518edddf3c7660Etan CohenLOCAL_SRC_FILES := \
36956f54b391677d78379729dd14518edddf3c7660Etan Cohen	jni/wifi_hal_mock.cpp
37956f54b391677d78379729dd14518edddf3c7660Etan Cohen
3847c56b1fd56d1a264143c5311ab874af97053091Etan Cohenifeq ($(BOARD_HAS_NAN), true)
39956f54b391677d78379729dd14518edddf3c7660Etan CohenLOCAL_SRC_FILES += \
40956f54b391677d78379729dd14518edddf3c7660Etan Cohen	jni/wifi_nan_hal_mock.cpp
41956f54b391677d78379729dd14518edddf3c7660Etan Cohenendif
42956f54b391677d78379729dd14518edddf3c7660Etan Cohen
43956f54b391677d78379729dd14518edddf3c7660Etan CohenLOCAL_MODULE := libwifi-hal-mock
44956f54b391677d78379729dd14518edddf3c7660Etan Cohen
45956f54b391677d78379729dd14518edddf3c7660Etan CohenLOCAL_STATIC_LIBRARIES += libwifi-hal
46956f54b391677d78379729dd14518edddf3c7660Etan CohenLOCAL_SHARED_LIBRARIES += \
47956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libnativehelper \
48956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libcutils \
49956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libutils \
50956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libhardware \
51956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libnl \
52956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libdl \
5394a1844242a3725d9314f2e2dbcdf0ab58b0f1c1Christopher Wiley	libwifi-service \
5494a1844242a3725d9314f2e2dbcdf0ab58b0f1c1Christopher Wiley	libwifi-system
55956f54b391677d78379729dd14518edddf3c7660Etan Cohen
56956f54b391677d78379729dd14518edddf3c7660Etan Coheninclude $(BUILD_SHARED_LIBRARY)
57956f54b391677d78379729dd14518edddf3c7660Etan Cohen
58956f54b391677d78379729dd14518edddf3c7660Etan Cohen# Make test APK
59956f54b391677d78379729dd14518edddf3c7660Etan Cohen# ============================================================
605ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Willsinclude $(CLEAR_VARS)
615ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills
625ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell WillsLOCAL_MODULE_TAGS := tests
635ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills
64c64c0e28b2162b13ca4ac7f9e30767c6d8d3b7eeYing WangLOCAL_SRC_FILES := $(call all-subdir-java-files)
655ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills
6647c56b1fd56d1a264143c5311ab874af97053091Etan Cohenifneq ($(BOARD_HAS_NAN), true)
67956f54b391677d78379729dd14518edddf3c7660Etan CohenLOCAL_SRC_FILES := $(filter-out $(call all-java-files-under, \
68956f54b391677d78379729dd14518edddf3c7660Etan Cohen          src/com/android/server/wifi/nan),$(LOCAL_SRC_FILES))
69956f54b391677d78379729dd14518edddf3c7660Etan Cohenendif
70956f54b391677d78379729dd14518edddf3c7660Etan Cohen
71a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Provide jack a list of classes to exclude form code coverage
72a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# This list is generated from the java source files in this module
73a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# The list is a comma separated list of class names with * matching zero or more characters.
74a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Example:
75a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills#   Input files: src/com/android/server/wifi/Test.java src/com/android/server/wifi/AnotherTest.java
76a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills#   Generated exclude list: com.android.server.wifi.Test*,com.android.server.wifi.AnotherTest*
77a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills
78a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Filter all src files to just java files
79a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willslocal_java_files := $(filter %.java,$(LOCAL_SRC_FILES))
80a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Transform java file names into full class names.
81a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# This only works if the class name matches the file name and the directory structure
82a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# matches the package.
83a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willslocal_classes := $(subst /,.,$(patsubst src/%.java,%,$(local_java_files)))
84a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Utility variables to allow replacing a space with a comma
85a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willscomma:= ,
86a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willsempty:=
87a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willsspace:= $(empty) $(empty)
88a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Convert class name list to jacoco exclude list
89a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# This appends a * to all classes and replace the space separators with commas.
90a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# These patterns will match all classes in this module and their inner classes.
91a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willsjacoco_exclude := $(subst $(space),$(comma),$(patsubst %,%*,$(local_classes)))
92a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills
93a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willsjacoco_include := com.android.server.wifi.*,android.net.wifi.*
94a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills
9505fca10c16c990e610c627f11dabb7552075ba05Sebastien HertzLOCAL_JACK_COVERAGE_INCLUDE_FILTER := $(jacoco_include)
9605fca10c16c990e610c627f11dabb7552075ba05Sebastien HertzLOCAL_JACK_COVERAGE_EXCLUDE_FILTER := $(jacoco_exclude)
97a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills
982977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills# wifi-service and services must be included here so that the latest changes
992977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills# will be used when tests. Otherwise the tests would run against the installed
1002977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills# system.
1012977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills# TODO figure out if this is the correct thing to do, this seems to not be right
1022977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills# since neither is declared a static java library.
1035ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell WillsLOCAL_STATIC_JAVA_LIBRARIES := \
1045ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills	android-support-test \
1052977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills	mockito-target \
106f4267b6840dbc7f430638c35c5448187b6e83846Christopher Wiley	frameworks-base-testutils \
1072977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills	services \
1085ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills	wifi-service \
1095ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills
1102977ce6833c307ce5a597c56060567da4707f8bbMitchell WillsLOCAL_JAVA_LIBRARIES := \
1112977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills	android.test.runner \
1125ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills	wifi-service \
1132977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills	services \
1145ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills
1152977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills# These must be explicitly included because they are not normally accessible
1162977ce6833c307ce5a597c56060567da4707f8bbMitchell Wills# from apps.
1170d83625c25353c92c123f552939eea4b33074b60Mitchell WillsLOCAL_JNI_SHARED_LIBRARIES := \
1180d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libwifi-service \
119d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libEGL \
120d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libGLESv2 \
121d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libaudioutils \
122d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libbacktrace \
1230d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libbase \
124d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libbinder \
125d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libc++ \
126d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libcamera_client \
127d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libcamera_metadata \
1280d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libcutils \
129d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libexpat \
130d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libgui \
131d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libhardware \
132d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libicui18n \
133d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libicuuc \
134d39cacb7a5ae9150b3a68b097614c5be697e5751Mitchell Wills	liblzma \
135d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libmedia \
136d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libnativehelper \
137d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libnbaio \
138d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libnetutils \
139d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libnl \
140d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libpowermanager \
141d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libsonivox \
142d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libspeexresampler \
143d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libstagefright_foundation \
144d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libstdc++ \
145d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libsync \
14694a1844242a3725d9314f2e2dbcdf0ab58b0f1c1Christopher Wiley	libwifi-system \
147d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libui \
148d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libunwind \
149d7412cc82f2ff785cff263ce977350de0de20a5aMitchell Wills	libutils \
1500d83625c25353c92c123f552939eea4b33074b60Mitchell Wills
15180a936cbedcec10cf81d3ae6d457fb6812a7e9eaMitchell Willsifdef WPA_SUPPLICANT_VERSION
1522977ce6833c307ce5a597c56060567da4707f8bbMitchell WillsLOCAL_JNI_SHARED_LIBRARIES += libwpa_client
15380a936cbedcec10cf81d3ae6d457fb6812a7e9eaMitchell Willsendif
15480a936cbedcec10cf81d3ae6d457fb6812a7e9eaMitchell Wills
1555ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell WillsLOCAL_PACKAGE_NAME := FrameworksWifiTests
15664052d48e8fb56e03732ce73c7adaf1fe085bad0Etan CohenLOCAL_JNI_SHARED_LIBRARIES += libwifi-hal-mock
1575ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills
1585ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Willsinclude $(BUILD_PACKAGE)
159