blob: 62c1ba89653c262edd5a0e434a79e2d887ef0f40 [file] [log] [blame]
Alan Stokes761d6182017-12-19 11:48:19 +00001#
2# Copyright 2017 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17LOCAL_PATH:= $(call my-dir)
18
19# Build a tiny library that the test app can dynamically load
20
21include $(CLEAR_VARS)
22
23LOCAL_MODULE_TAGS := tests
Alan Stokes8d3b7a42019-02-19 17:14:42 +000024LOCAL_MODULE := DynamicCodeLoggerTestLibrary
Alan Stokes761d6182017-12-19 11:48:19 +000025LOCAL_SRC_FILES := $(call all-java-files-under, src/com/android/dcl)
26
27include $(BUILD_JAVA_LIBRARY)
28
Alan Stokes8d3b7a42019-02-19 17:14:42 +000029dynamiccodeloggertest_jar := $(LOCAL_BUILT_MODULE)
Alan Stokes761d6182017-12-19 11:48:19 +000030
31
Alan Stokese9d33142018-12-19 09:31:21 +000032# Also build a native library that the test app can dynamically load
33
34include $(CLEAR_VARS)
35
36LOCAL_MODULE_TAGS := tests
Alan Stokes8d3b7a42019-02-19 17:14:42 +000037LOCAL_MODULE := DynamicCodeLoggerNativeTestLibrary
Alan Stokese9d33142018-12-19 09:31:21 +000038LOCAL_SRC_FILES := src/cpp/com_android_dcl_Jni.cpp
39LOCAL_C_INCLUDES += \
40 $(JNI_H_INCLUDE)
41LOCAL_SDK_VERSION := 28
42LOCAL_NDK_STL_VARIANT := c++_static
43
44include $(BUILD_SHARED_LIBRARY)
45
Alan Stokese9d33142018-12-19 09:31:21 +000046# And a standalone native executable that we can exec.
47
48include $(CLEAR_VARS)
49
50LOCAL_MODULE_TAGS := tests
Alan Stokes8d3b7a42019-02-19 17:14:42 +000051LOCAL_MODULE := DynamicCodeLoggerNativeExecutable
Alan Stokese9d33142018-12-19 09:31:21 +000052LOCAL_SRC_FILES := src/cpp/test_executable.cpp
53
54include $(BUILD_EXECUTABLE)
55
Alan Stokes8d3b7a42019-02-19 17:14:42 +000056dynamiccodeloggertest_executable := $(LOCAL_BUILT_MODULE)
Alan Stokese9d33142018-12-19 09:31:21 +000057
Alan Stokes761d6182017-12-19 11:48:19 +000058# Build the test app itself
59
60include $(CLEAR_VARS)
61
62LOCAL_MODULE_TAGS := tests
Alan Stokes8d3b7a42019-02-19 17:14:42 +000063LOCAL_PACKAGE_NAME := DynamicCodeLoggerIntegrationTests
Anton Hanssonab6ec612018-02-23 12:57:51 +000064LOCAL_SDK_VERSION := current
Alan Stokes761d6182017-12-19 11:48:19 +000065LOCAL_COMPATIBILITY_SUITE := device-tests
Alan Stokese9d33142018-12-19 09:31:21 +000066LOCAL_CERTIFICATE := shared
Alan Stokes761d6182017-12-19 11:48:19 +000067LOCAL_SRC_FILES := $(call all-java-files-under, src/com/android/server/pm)
68
69LOCAL_STATIC_JAVA_LIBRARIES := \
Brett Chabot502ec7a2019-03-01 14:43:20 -080070 androidx.test.rules \
Alan Stokes761d6182017-12-19 11:48:19 +000071 truth-prebuilt \
72
Alan Stokesa3039532019-01-25 14:07:23 +000073# Include both versions of the .so if we have 2 arch
74LOCAL_MULTILIB := both
75LOCAL_JNI_SHARED_LIBRARIES := \
Alan Stokes8d3b7a42019-02-19 17:14:42 +000076 DynamicCodeLoggerNativeTestLibrary \
Alan Stokesa3039532019-01-25 14:07:23 +000077
Alan Stokes8d3b7a42019-02-19 17:14:42 +000078# This gets us the javalib.jar built by DynamicCodeLoggerTestLibrary above as well as the various
Alan Stokese9d33142018-12-19 09:31:21 +000079# native binaries.
80LOCAL_JAVA_RESOURCE_FILES := \
Alan Stokes8d3b7a42019-02-19 17:14:42 +000081 $(dynamiccodeloggertest_jar) \
82 $(dynamiccodeloggertest_executable) \
Alan Stokes761d6182017-12-19 11:48:19 +000083
84include $(BUILD_PACKAGE)