| package { |
| default_applicable_licenses: ["Android-Apache-2.0"], |
| } |
| |
| java_library_static { |
| name: "TestApp_JavaProtos", |
| host_supported: true, |
| proto: { |
| type: "lite", |
| }, |
| srcs: ["src/library/main/proto/testapp_protos.proto"] |
| } |
| |
| android_library { |
| name: "TestApp_TestApps", |
| sdk_version: "test_current", |
| srcs: [ |
| "src/testapps/main/java/**/*.java" |
| ], |
| static_libs: [ |
| "EventLib", |
| "TestApp_Annotations", |
| "ConnectedAppsSDK", |
| "ConnectedAppsSDK_Annotations", |
| "androidx.annotation_annotation", |
| "RemoteFrameworkClasses" |
| ], |
| manifest: "src/testapps/main/AndroidManifest.xml", |
| min_sdk_version: "28", |
| plugins: ["ConnectedAppsSDK_Processor", "TestApp_Processor"], |
| } |
| |
| android_library { |
| name: "TestApp", |
| sdk_version: "test_current", |
| srcs: [ |
| "src/library/main/java/**/*.java" |
| ], |
| static_libs: [ |
| "Nene", |
| "EventLib", |
| "Queryable", |
| "TestApp_Annotations", |
| "ConnectedAppsSDK", |
| "ConnectedAppsSDK_Annotations", |
| "androidx.annotation_annotation", |
| "TestApp_TestApps", |
| "TestApp_JavaProtos" |
| ], |
| manifest: "src/library/main/AndroidManifest.xml", |
| min_sdk_version: "28", |
| resource_zips: [":TestApp_Apps"], |
| plugins: ["ConnectedAppsSDK_Processor", "TestApp_Processor"], |
| } |
| |
| android_test { |
| name: "TestAppTest", |
| srcs: [ |
| "src/test/java/**/*.java" |
| ], |
| test_suites: [ |
| "general-tests", |
| ], |
| static_libs: [ |
| "Nene", |
| "TestApp", |
| "TestApp_TestApps", |
| "Harrier", |
| "EventLib", |
| "androidx.test.ext.junit", |
| "truth-prebuilt", |
| "testng" // for assertThrows |
| ], |
| manifest: "src/test/AndroidManifest.xml", |
| min_sdk_version: "28" |
| } |
| |
| python_binary_host { |
| name: "index_testapps", |
| version: { |
| py2: { |
| enabled: false, |
| embedded_launcher: false, |
| }, |
| py3: { |
| enabled: true, |
| embedded_launcher: true, |
| }, |
| }, |
| main: "tools/index/index_testapps.py", |
| srcs: [ |
| "tools/index/index_testapps.py", |
| "src/library/main/proto/testapp_protos.proto" |
| ], |
| proto: { |
| canonical_path_from_root: false, |
| } |
| } |
| |
| java_genrule { |
| name: "TestApp_Apps", |
| srcs: [":EmptyTestApp", ":EmptyTestApp2", ":DeviceAdminTestApp", ":LockTaskApp", ":DelegateTestApp", ":RemoteDPCTestApp", ":SmsApp", ":AccountManagementApp"], |
| out: ["TestApp_Apps.res.zip"], |
| tools: ["soong_zip", "index_testapps", "aapt2"], |
| cmd: "mkdir -p $(genDir)/res/raw" |
| + " && cp $(location :EmptyTestApp) $(genDir)/res/raw" |
| + " && cp $(location :EmptyTestApp2) $(genDir)/res/raw" |
| + " && cp $(location :DeviceAdminTestApp) $(genDir)/res/raw" |
| + " && cp $(location :LockTaskApp) $(genDir)/res/raw" |
| + " && cp $(location :DelegateTestApp) $(genDir)/res/raw" |
| + " && cp $(location :RemoteDPCTestApp) $(genDir)/res/raw" |
| + " && cp $(location :SmsApp) $(genDir)/res/raw" |
| + " && cp $(location :AccountManagementApp) $(genDir)/res/raw" |
| + " && $(location index_testapps) --directory $(genDir)/res/raw --aapt2 $(location aapt2)" |
| + " && $(location soong_zip) -o $(out) -C $(genDir)/res -D $(genDir)/res/raw" |
| } |
| |
| android_test_helper_app { |
| name: "EmptyTestApp", |
| static_libs: [ |
| "TestApp_TestApps" |
| ], |
| manifest: "manifests/EmptyTestAppManifest.xml", |
| min_sdk_version: "28" |
| } |
| |
| android_test_helper_app { |
| name: "EmptyTestApp2", |
| static_libs: [ |
| "TestApp_TestApps" |
| ], |
| manifest: "manifests/EmptyTestApp2Manifest.xml", |
| min_sdk_version: "28" |
| } |
| |
| android_test_helper_app { |
| name: "DeviceAdminTestApp", |
| static_libs: [ |
| "TestApp_TestApps", |
| "DeviceAdminApp" |
| ], |
| manifest: "manifests/DeviceAdminManifest.xml", |
| min_sdk_version: "28" |
| } |
| |
| android_test_helper_app { |
| name: "LockTaskApp", |
| static_libs: [ |
| "TestApp_TestApps" |
| ], |
| manifest: "manifests/LockTaskAppManifest.xml", |
| min_sdk_version: "28" |
| } |
| |
| android_test_helper_app { |
| name: "DelegateTestApp", |
| static_libs: [ |
| "TestApp_TestApps" |
| ], |
| manifest: "manifests/DelegateManifest.xml", |
| min_sdk_version: "28" |
| } |
| |
| android_test_helper_app { |
| name: "RemoteDPCTestApp", |
| static_libs: [ |
| "TestApp_TestApps", |
| "DeviceAdminApp" |
| ], |
| manifest: "manifests/RemoteDPCManifest.xml", |
| min_sdk_version: "28" |
| } |
| |
| android_test_helper_app { |
| name: "SmsApp", |
| static_libs: [ |
| "TestApp_TestApps" |
| ], |
| manifest: "manifests/SmsAppManifest.xml", |
| min_sdk_version: "28" |
| } |
| |
| android_test_helper_app { |
| name: "AccountManagementApp", |
| static_libs: [ |
| "TestApp_TestApps" |
| ], |
| resource_dirs: ["src/testapps/main/res/accountmanagement"], |
| manifest: "manifests/AccountManagementManifest.xml", |
| min_sdk_version: "28" |
| } |
| |
| java_library { |
| name: "TestApp_Annotations", |
| srcs: [ |
| "src/processor/main/java/com/android/bedstead/testapp/processor/annotations/*.java" |
| ], |
| host_supported: true |
| } |
| |
| java_plugin { |
| name: "TestApp_Processor", |
| processor_class: "com.android.bedstead.testapp.processor.Processor", |
| static_libs: [ |
| "javapoet", |
| "auto_service_annotations", |
| "TestApp_Annotations", |
| "ConnectedAppsSDK_Annotations" |
| ], |
| srcs: [ |
| "src/processor/main/java/com/android/bedstead/testapp/processor/Processor.java" |
| ], |
| plugins: ["auto_service_plugin"], |
| generates_api: true, |
| } |