| Alan Stokes | 761d618 | 2017-12-19 11:48:19 +0000 | [diff] [blame] | 1 | # | 
|  | 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 |  | 
|  | 17 | LOCAL_PATH:= $(call my-dir) | 
|  | 18 |  | 
|  | 19 | # Build a tiny library that the test app can dynamically load | 
|  | 20 |  | 
|  | 21 | include $(CLEAR_VARS) | 
|  | 22 |  | 
|  | 23 | LOCAL_MODULE_TAGS := tests | 
| Alan Stokes | 8d3b7a4 | 2019-02-19 17:14:42 +0000 | [diff] [blame] | 24 | LOCAL_MODULE := DynamicCodeLoggerTestLibrary | 
| Alan Stokes | 761d618 | 2017-12-19 11:48:19 +0000 | [diff] [blame] | 25 | LOCAL_SRC_FILES := $(call all-java-files-under, src/com/android/dcl) | 
|  | 26 |  | 
|  | 27 | include $(BUILD_JAVA_LIBRARY) | 
|  | 28 |  | 
| Alan Stokes | 8d3b7a4 | 2019-02-19 17:14:42 +0000 | [diff] [blame] | 29 | dynamiccodeloggertest_jar := $(LOCAL_BUILT_MODULE) | 
| Alan Stokes | 761d618 | 2017-12-19 11:48:19 +0000 | [diff] [blame] | 30 |  | 
|  | 31 |  | 
| Alan Stokes | e9d3314 | 2018-12-19 09:31:21 +0000 | [diff] [blame] | 32 | # Also build a native library that the test app can dynamically load | 
|  | 33 |  | 
|  | 34 | include $(CLEAR_VARS) | 
|  | 35 |  | 
|  | 36 | LOCAL_MODULE_TAGS := tests | 
| Alan Stokes | 8d3b7a4 | 2019-02-19 17:14:42 +0000 | [diff] [blame] | 37 | LOCAL_MODULE := DynamicCodeLoggerNativeTestLibrary | 
| Alan Stokes | e9d3314 | 2018-12-19 09:31:21 +0000 | [diff] [blame] | 38 | LOCAL_SRC_FILES := src/cpp/com_android_dcl_Jni.cpp | 
| Orion Hodson | 3eba1ab | 2020-07-02 13:50:33 +0100 | [diff] [blame] | 39 | LOCAL_HEADER_LIBRARIES := jni_headers | 
| Alan Stokes | e9d3314 | 2018-12-19 09:31:21 +0000 | [diff] [blame] | 40 | LOCAL_SDK_VERSION := 28 | 
|  | 41 | LOCAL_NDK_STL_VARIANT := c++_static | 
|  | 42 |  | 
|  | 43 | include $(BUILD_SHARED_LIBRARY) | 
|  | 44 |  | 
| Alan Stokes | e9d3314 | 2018-12-19 09:31:21 +0000 | [diff] [blame] | 45 | # And a standalone native executable that we can exec. | 
|  | 46 |  | 
|  | 47 | include $(CLEAR_VARS) | 
|  | 48 |  | 
|  | 49 | LOCAL_MODULE_TAGS := tests | 
| Alan Stokes | 8d3b7a4 | 2019-02-19 17:14:42 +0000 | [diff] [blame] | 50 | LOCAL_MODULE := DynamicCodeLoggerNativeExecutable | 
| Alan Stokes | e9d3314 | 2018-12-19 09:31:21 +0000 | [diff] [blame] | 51 | LOCAL_SRC_FILES := src/cpp/test_executable.cpp | 
|  | 52 |  | 
|  | 53 | include $(BUILD_EXECUTABLE) | 
|  | 54 |  | 
| Alan Stokes | 8d3b7a4 | 2019-02-19 17:14:42 +0000 | [diff] [blame] | 55 | dynamiccodeloggertest_executable := $(LOCAL_BUILT_MODULE) | 
| Alan Stokes | e9d3314 | 2018-12-19 09:31:21 +0000 | [diff] [blame] | 56 |  | 
| Alan Stokes | 761d618 | 2017-12-19 11:48:19 +0000 | [diff] [blame] | 57 | # Build the test app itself | 
|  | 58 |  | 
|  | 59 | include $(CLEAR_VARS) | 
|  | 60 |  | 
|  | 61 | LOCAL_MODULE_TAGS := tests | 
| Alan Stokes | 8d3b7a4 | 2019-02-19 17:14:42 +0000 | [diff] [blame] | 62 | LOCAL_PACKAGE_NAME := DynamicCodeLoggerIntegrationTests | 
| Anton Hansson | ab6ec61 | 2018-02-23 12:57:51 +0000 | [diff] [blame] | 63 | LOCAL_SDK_VERSION := current | 
| Alan Stokes | 761d618 | 2017-12-19 11:48:19 +0000 | [diff] [blame] | 64 | LOCAL_COMPATIBILITY_SUITE := device-tests | 
| Alan Stokes | e9d3314 | 2018-12-19 09:31:21 +0000 | [diff] [blame] | 65 | LOCAL_CERTIFICATE := shared | 
| Alan Stokes | 761d618 | 2017-12-19 11:48:19 +0000 | [diff] [blame] | 66 | LOCAL_SRC_FILES := $(call all-java-files-under, src/com/android/server/pm) | 
|  | 67 |  | 
|  | 68 | LOCAL_STATIC_JAVA_LIBRARIES := \ | 
| Brett Chabot | 502ec7a | 2019-03-01 14:43:20 -0800 | [diff] [blame] | 69 | androidx.test.rules \ | 
| Alan Stokes | 761d618 | 2017-12-19 11:48:19 +0000 | [diff] [blame] | 70 | truth-prebuilt \ | 
|  | 71 |  | 
| Alan Stokes | a303953 | 2019-01-25 14:07:23 +0000 | [diff] [blame] | 72 | # Include both versions of the .so if we have 2 arch | 
|  | 73 | LOCAL_MULTILIB := both | 
|  | 74 | LOCAL_JNI_SHARED_LIBRARIES := \ | 
| Alan Stokes | 8d3b7a4 | 2019-02-19 17:14:42 +0000 | [diff] [blame] | 75 | DynamicCodeLoggerNativeTestLibrary \ | 
| Alan Stokes | a303953 | 2019-01-25 14:07:23 +0000 | [diff] [blame] | 76 |  | 
| Alan Stokes | 8d3b7a4 | 2019-02-19 17:14:42 +0000 | [diff] [blame] | 77 | # This gets us the javalib.jar built by DynamicCodeLoggerTestLibrary above as well as the various | 
| Alan Stokes | e9d3314 | 2018-12-19 09:31:21 +0000 | [diff] [blame] | 78 | # native binaries. | 
|  | 79 | LOCAL_JAVA_RESOURCE_FILES := \ | 
| Alan Stokes | 8d3b7a4 | 2019-02-19 17:14:42 +0000 | [diff] [blame] | 80 | $(dynamiccodeloggertest_jar) \ | 
|  | 81 | $(dynamiccodeloggertest_executable) \ | 
| Alan Stokes | 761d618 | 2017-12-19 11:48:19 +0000 | [diff] [blame] | 82 |  | 
|  | 83 | include $(BUILD_PACKAGE) |