blob: bfb5b076237a7dfd99855697a40679fc8bb58b0d [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
Bob Badour8a6a2bc2021-02-12 17:07:05 -080025LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
26LOCAL_LICENSE_CONDITIONS := notice
27LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../NOTICE
Alan Stokes761d6182017-12-19 11:48:19 +000028LOCAL_SRC_FILES := $(call all-java-files-under, src/com/android/dcl)
29
30include $(BUILD_JAVA_LIBRARY)
31
Alan Stokes8d3b7a42019-02-19 17:14:42 +000032dynamiccodeloggertest_jar := $(LOCAL_BUILT_MODULE)
Alan Stokes761d6182017-12-19 11:48:19 +000033
34
Alan Stokese9d33142018-12-19 09:31:21 +000035# Also build a native library that the test app can dynamically load
36
37include $(CLEAR_VARS)
38
39LOCAL_MODULE_TAGS := tests
Alan Stokes8d3b7a42019-02-19 17:14:42 +000040LOCAL_MODULE := DynamicCodeLoggerNativeTestLibrary
Bob Badour8a6a2bc2021-02-12 17:07:05 -080041LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
42LOCAL_LICENSE_CONDITIONS := notice
43LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../NOTICE
Alan Stokese9d33142018-12-19 09:31:21 +000044LOCAL_SRC_FILES := src/cpp/com_android_dcl_Jni.cpp
Orion Hodson3eba1ab2020-07-02 13:50:33 +010045LOCAL_HEADER_LIBRARIES := jni_headers
Alan Stokese9d33142018-12-19 09:31:21 +000046LOCAL_SDK_VERSION := 28
47LOCAL_NDK_STL_VARIANT := c++_static
48
49include $(BUILD_SHARED_LIBRARY)
50
Alan Stokese9d33142018-12-19 09:31:21 +000051# And a standalone native executable that we can exec.
52
53include $(CLEAR_VARS)
54
55LOCAL_MODULE_TAGS := tests
Alan Stokes8d3b7a42019-02-19 17:14:42 +000056LOCAL_MODULE := DynamicCodeLoggerNativeExecutable
Bob Badour8a6a2bc2021-02-12 17:07:05 -080057LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
58LOCAL_LICENSE_CONDITIONS := notice
59LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../NOTICE
Alan Stokese9d33142018-12-19 09:31:21 +000060LOCAL_SRC_FILES := src/cpp/test_executable.cpp
61
62include $(BUILD_EXECUTABLE)
63
Alan Stokes8d3b7a42019-02-19 17:14:42 +000064dynamiccodeloggertest_executable := $(LOCAL_BUILT_MODULE)
Alan Stokese9d33142018-12-19 09:31:21 +000065
Alan Stokes761d6182017-12-19 11:48:19 +000066# Build the test app itself
67
68include $(CLEAR_VARS)
69
70LOCAL_MODULE_TAGS := tests
Alan Stokes8d3b7a42019-02-19 17:14:42 +000071LOCAL_PACKAGE_NAME := DynamicCodeLoggerIntegrationTests
Anton Hanssonab6ec612018-02-23 12:57:51 +000072LOCAL_SDK_VERSION := current
Alan Stokes761d6182017-12-19 11:48:19 +000073LOCAL_COMPATIBILITY_SUITE := device-tests
Alan Stokese9d33142018-12-19 09:31:21 +000074LOCAL_CERTIFICATE := shared
Alan Stokes761d6182017-12-19 11:48:19 +000075LOCAL_SRC_FILES := $(call all-java-files-under, src/com/android/server/pm)
76
77LOCAL_STATIC_JAVA_LIBRARIES := \
Brett Chabot502ec7a2019-03-01 14:43:20 -080078 androidx.test.rules \
Alan Stokes761d6182017-12-19 11:48:19 +000079 truth-prebuilt \
80
Alan Stokesa3039532019-01-25 14:07:23 +000081# Include both versions of the .so if we have 2 arch
82LOCAL_MULTILIB := both
83LOCAL_JNI_SHARED_LIBRARIES := \
Alan Stokes8d3b7a42019-02-19 17:14:42 +000084 DynamicCodeLoggerNativeTestLibrary \
Alan Stokesa3039532019-01-25 14:07:23 +000085
Alan Stokes8d3b7a42019-02-19 17:14:42 +000086# This gets us the javalib.jar built by DynamicCodeLoggerTestLibrary above as well as the various
Alan Stokese9d33142018-12-19 09:31:21 +000087# native binaries.
88LOCAL_JAVA_RESOURCE_FILES := \
Alan Stokes8d3b7a42019-02-19 17:14:42 +000089 $(dynamiccodeloggertest_jar) \
90 $(dynamiccodeloggertest_executable) \
Alan Stokes761d6182017-12-19 11:48:19 +000091
92include $(BUILD_PACKAGE)