Android.mk revision 47c56b1fd56d1a264143c5311ab874af97053091
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
24e1facbb854714ec30a92dffc7534acb59442ce3bMitchell WillsLOCAL_CFLAGS += -Wno-unused-parameter -Wall -Werror
25956f54b391677d78379729dd14518edddf3c7660Etan Cohen
26956f54b391677d78379729dd14518edddf3c7660Etan CohenLOCAL_C_INCLUDES += \
27956f54b391677d78379729dd14518edddf3c7660Etan Cohen	$(JNI_H_INCLUDE) \
28956f54b391677d78379729dd14518edddf3c7660Etan Cohen	$(LOCAL_PATH)/../../service/jni \
29956f54b391677d78379729dd14518edddf3c7660Etan Cohen	$(call include-path-for, libhardware)/hardware \
30956f54b391677d78379729dd14518edddf3c7660Etan Cohen	$(call include-path-for, libhardware_legacy)/hardware_legacy \
31956f54b391677d78379729dd14518edddf3c7660Etan Cohen	packages/apps/Test/connectivity/sl4n/rapidjson/include \
32956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libcore/include
33956f54b391677d78379729dd14518edddf3c7660Etan Cohen
34956f54b391677d78379729dd14518edddf3c7660Etan CohenLOCAL_SRC_FILES := \
35956f54b391677d78379729dd14518edddf3c7660Etan Cohen	jni/wifi_hal_mock.cpp
36956f54b391677d78379729dd14518edddf3c7660Etan Cohen
3747c56b1fd56d1a264143c5311ab874af97053091Etan Cohenifeq ($(BOARD_HAS_NAN), true)
38956f54b391677d78379729dd14518edddf3c7660Etan CohenLOCAL_SRC_FILES += \
39956f54b391677d78379729dd14518edddf3c7660Etan Cohen	jni/wifi_nan_hal_mock.cpp
40956f54b391677d78379729dd14518edddf3c7660Etan Cohenendif
41956f54b391677d78379729dd14518edddf3c7660Etan Cohen
42956f54b391677d78379729dd14518edddf3c7660Etan CohenLOCAL_MODULE := libwifi-hal-mock
43956f54b391677d78379729dd14518edddf3c7660Etan Cohen
44956f54b391677d78379729dd14518edddf3c7660Etan CohenLOCAL_STATIC_LIBRARIES += libwifi-hal
45956f54b391677d78379729dd14518edddf3c7660Etan CohenLOCAL_SHARED_LIBRARIES += \
46956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libnativehelper \
47956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libcutils \
48956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libutils \
49956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libhardware \
50956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libhardware_legacy \
51956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libnl \
52956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libdl \
53956f54b391677d78379729dd14518edddf3c7660Etan Cohen	libwifi-service
54956f54b391677d78379729dd14518edddf3c7660Etan Cohen
55956f54b391677d78379729dd14518edddf3c7660Etan Coheninclude $(BUILD_SHARED_LIBRARY)
56956f54b391677d78379729dd14518edddf3c7660Etan Cohen
57956f54b391677d78379729dd14518edddf3c7660Etan Cohen# Make test APK
58956f54b391677d78379729dd14518edddf3c7660Etan Cohen# ============================================================
595ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Willsinclude $(CLEAR_VARS)
605ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills
615ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell WillsLOCAL_MODULE_TAGS := tests
625ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills
63eee1d479d8d402a2e78e2f143e957030cfc77749Vinit DeshpandeRESOURCE_FILES := $(call all-named-files-under, R.java, $(intermediates.COMMON))
64eee1d479d8d402a2e78e2f143e957030cfc77749Vinit Deshpande
65eee1d479d8d402a2e78e2f143e957030cfc77749Vinit DeshpandeLOCAL_SRC_FILES := $(call all-subdir-java-files) \
66eee1d479d8d402a2e78e2f143e957030cfc77749Vinit Deshpande	$RESOURCE_FILES
675ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills
6847c56b1fd56d1a264143c5311ab874af97053091Etan Cohenifneq ($(BOARD_HAS_NAN), true)
69956f54b391677d78379729dd14518edddf3c7660Etan CohenLOCAL_SRC_FILES := $(filter-out $(call all-java-files-under, \
70956f54b391677d78379729dd14518edddf3c7660Etan Cohen          src/com/android/server/wifi/nan),$(LOCAL_SRC_FILES))
71956f54b391677d78379729dd14518edddf3c7660Etan Cohenendif
72956f54b391677d78379729dd14518edddf3c7660Etan Cohen
73a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Provide jack a list of classes to exclude form code coverage
74a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# This list is generated from the java source files in this module
75a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# The list is a comma separated list of class names with * matching zero or more characters.
76a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Example:
77a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills#   Input files: src/com/android/server/wifi/Test.java src/com/android/server/wifi/AnotherTest.java
78a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills#   Generated exclude list: com.android.server.wifi.Test*,com.android.server.wifi.AnotherTest*
79a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills
80a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Filter all src files to just java files
81a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willslocal_java_files := $(filter %.java,$(LOCAL_SRC_FILES))
82a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Transform java file names into full class names.
83a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# This only works if the class name matches the file name and the directory structure
84a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# matches the package.
85a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willslocal_classes := $(subst /,.,$(patsubst src/%.java,%,$(local_java_files)))
86a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Utility variables to allow replacing a space with a comma
87a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willscomma:= ,
88a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willsempty:=
89a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willsspace:= $(empty) $(empty)
90a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# Convert class name list to jacoco exclude list
91a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# This appends a * to all classes and replace the space separators with commas.
92a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills# These patterns will match all classes in this module and their inner classes.
93a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willsjacoco_exclude := $(subst $(space),$(comma),$(patsubst %,%*,$(local_classes)))
94a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills
95a54db13528fa8b586d58b42aff46df40466ea950Mitchell Willsjacoco_include := com.android.server.wifi.*,android.net.wifi.*
96a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills
97a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills
98a54db13528fa8b586d58b42aff46df40466ea950Mitchell WillsLOCAL_JACK_FLAGS := \
99a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills	-D jack.coverage.jacoco.include=$(jacoco_include) \
100a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills	-D jack.coverage.jacoco.exclude=$(jacoco_exclude)
101a54db13528fa8b586d58b42aff46df40466ea950Mitchell Wills
1025ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell WillsLOCAL_STATIC_JAVA_LIBRARIES := \
1035ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills	mockito-target \
1045ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills	android-support-test \
1055ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills	wifi-service \
1065ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills	services
1075ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills
1085ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell WillsLOCAL_JAVA_LIBRARIES := android.test.runner \
1095ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills	mockito-target \
1105ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills	android-support-test \
1115ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills	wifi-service \
1125ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills	services
1135ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills
1140d83625c25353c92c123f552939eea4b33074b60Mitchell WillsLOCAL_JNI_SHARED_LIBRARIES := \
1150d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libwifi-service \
1160d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libc++ \
1170d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libLLVM \
1180d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libutils \
1190d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libunwind \
1200d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libhardware_legacy \
1210d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libbase \
1220d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libhardware \
1230d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libnl \
1240d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libcutils \
1250d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libnetutils \
1260d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libbacktrace \
1270d83625c25353c92c123f552939eea4b33074b60Mitchell Wills	libnativehelper \
128d39cacb7a5ae9150b3a68b097614c5be697e5751Mitchell Wills	liblzma \
1290d83625c25353c92c123f552939eea4b33074b60Mitchell Wills
13080a936cbedcec10cf81d3ae6d457fb6812a7e9eaMitchell Willsifdef WPA_SUPPLICANT_VERSION
13180a936cbedcec10cf81d3ae6d457fb6812a7e9eaMitchell WillsLOCAL_JNI_SHARED_LIBRARIES := $(LOCAL_JNI_SHARED_LIBRARIES) \
13280a936cbedcec10cf81d3ae6d457fb6812a7e9eaMitchell Wills	libwpa_client
13380a936cbedcec10cf81d3ae6d457fb6812a7e9eaMitchell Willsendif
13480a936cbedcec10cf81d3ae6d457fb6812a7e9eaMitchell Wills
1355ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell WillsLOCAL_PACKAGE_NAME := FrameworksWifiTests
13664052d48e8fb56e03732ce73c7adaf1fe085bad0Etan CohenLOCAL_JNI_SHARED_LIBRARIES += libwifi-hal-mock
1375ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Wills
1385ba6152092301bbdea7e2838727b63dc40dd8c4aMitchell Willsinclude $(BUILD_PACKAGE)
139