1*d57664e9SAndroid Build Coastguard Workerpackage { 2*d57664e9SAndroid Build Coastguard Worker // See: http://go/android-license-faq 3*d57664e9SAndroid Build Coastguard Worker // A large-scale-change added 'default_applicable_licenses' to import 4*d57664e9SAndroid Build Coastguard Worker // all of the 'license_kinds' from "frameworks_base_license" 5*d57664e9SAndroid Build Coastguard Worker // to get the below license kinds: 6*d57664e9SAndroid Build Coastguard Worker // SPDX-license-identifier-Apache-2.0 7*d57664e9SAndroid Build Coastguard Worker default_applicable_licenses: ["frameworks_base_license"], 8*d57664e9SAndroid Build Coastguard Worker default_team: "trendy_team_system_performance", 9*d57664e9SAndroid Build Coastguard Worker} 10*d57664e9SAndroid Build Coastguard Worker 11*d57664e9SAndroid Build Coastguard Workerjava_library_host { 12*d57664e9SAndroid Build Coastguard Worker name: "systemfeatures-gen-lib", 13*d57664e9SAndroid Build Coastguard Worker srcs: [ 14*d57664e9SAndroid Build Coastguard Worker "src/**/*.java", 15*d57664e9SAndroid Build Coastguard Worker "src/**/*.kt", 16*d57664e9SAndroid Build Coastguard Worker ":framework-metalava-annotations", 17*d57664e9SAndroid Build Coastguard Worker ], 18*d57664e9SAndroid Build Coastguard Worker static_libs: [ 19*d57664e9SAndroid Build Coastguard Worker "guava", 20*d57664e9SAndroid Build Coastguard Worker "javapoet", 21*d57664e9SAndroid Build Coastguard Worker ], 22*d57664e9SAndroid Build Coastguard Worker} 23*d57664e9SAndroid Build Coastguard Worker 24*d57664e9SAndroid Build Coastguard Workerjava_binary_host { 25*d57664e9SAndroid Build Coastguard Worker name: "systemfeatures-gen-tool", 26*d57664e9SAndroid Build Coastguard Worker main_class: "com.android.systemfeatures.SystemFeaturesGenerator", 27*d57664e9SAndroid Build Coastguard Worker static_libs: ["systemfeatures-gen-lib"], 28*d57664e9SAndroid Build Coastguard Worker} 29*d57664e9SAndroid Build Coastguard Worker 30*d57664e9SAndroid Build Coastguard Workerjava_plugin { 31*d57664e9SAndroid Build Coastguard Worker name: "systemfeatures-metadata-processor", 32*d57664e9SAndroid Build Coastguard Worker processor_class: "com.android.systemfeatures.SystemFeaturesMetadataProcessor", 33*d57664e9SAndroid Build Coastguard Worker static_libs: ["systemfeatures-gen-lib"], 34*d57664e9SAndroid Build Coastguard Worker} 35*d57664e9SAndroid Build Coastguard Worker 36*d57664e9SAndroid Build Coastguard Workergenrule { 37*d57664e9SAndroid Build Coastguard Worker name: "systemfeatures-gen-tests-srcs", 38*d57664e9SAndroid Build Coastguard Worker cmd: "$(location systemfeatures-gen-tool) com.android.systemfeatures.RwNoFeatures --readonly=false > $(location RwNoFeatures.java) && " + 39*d57664e9SAndroid Build Coastguard Worker "$(location systemfeatures-gen-tool) com.android.systemfeatures.RoNoFeatures --readonly=true --feature-apis=WATCH > $(location RoNoFeatures.java) && " + 40*d57664e9SAndroid Build Coastguard Worker "$(location systemfeatures-gen-tool) com.android.systemfeatures.RwFeatures --readonly=false --feature=WATCH:1 --feature=WIFI:0 --feature=VULKAN:UNAVAILABLE --feature=AUTO: > $(location RwFeatures.java) && " + 41*d57664e9SAndroid Build Coastguard Worker "$(location systemfeatures-gen-tool) com.android.systemfeatures.RoFeatures --readonly=true --feature=WATCH:1 --feature=WIFI:0 --feature=VULKAN:UNAVAILABLE --feature=AUTO: --feature-apis=WATCH,PC > $(location RoFeatures.java)", 42*d57664e9SAndroid Build Coastguard Worker out: [ 43*d57664e9SAndroid Build Coastguard Worker "RwNoFeatures.java", 44*d57664e9SAndroid Build Coastguard Worker "RoNoFeatures.java", 45*d57664e9SAndroid Build Coastguard Worker "RwFeatures.java", 46*d57664e9SAndroid Build Coastguard Worker "RoFeatures.java", 47*d57664e9SAndroid Build Coastguard Worker ], 48*d57664e9SAndroid Build Coastguard Worker tools: ["systemfeatures-gen-tool"], 49*d57664e9SAndroid Build Coastguard Worker} 50*d57664e9SAndroid Build Coastguard Worker 51*d57664e9SAndroid Build Coastguard Worker// Functional runtime behavior testing. 52*d57664e9SAndroid Build Coastguard Workerjava_test_host { 53*d57664e9SAndroid Build Coastguard Worker name: "systemfeatures-gen-tests", 54*d57664e9SAndroid Build Coastguard Worker test_suites: ["general-tests"], 55*d57664e9SAndroid Build Coastguard Worker srcs: [ 56*d57664e9SAndroid Build Coastguard Worker "tests/src/**/*.java", 57*d57664e9SAndroid Build Coastguard Worker ":systemfeatures-gen-tests-srcs", 58*d57664e9SAndroid Build Coastguard Worker ], 59*d57664e9SAndroid Build Coastguard Worker test_options: { 60*d57664e9SAndroid Build Coastguard Worker unit_test: true, 61*d57664e9SAndroid Build Coastguard Worker }, 62*d57664e9SAndroid Build Coastguard Worker static_libs: [ 63*d57664e9SAndroid Build Coastguard Worker "aconfig-annotations-lib", 64*d57664e9SAndroid Build Coastguard Worker "framework-annotations-lib", 65*d57664e9SAndroid Build Coastguard Worker "junit", 66*d57664e9SAndroid Build Coastguard Worker "objenesis", 67*d57664e9SAndroid Build Coastguard Worker "mockito", 68*d57664e9SAndroid Build Coastguard Worker "systemfeatures-gen-lib", 69*d57664e9SAndroid Build Coastguard Worker "truth", 70*d57664e9SAndroid Build Coastguard Worker ], 71*d57664e9SAndroid Build Coastguard Worker plugins: ["systemfeatures-metadata-processor"], 72*d57664e9SAndroid Build Coastguard Worker} 73*d57664e9SAndroid Build Coastguard Worker 74*d57664e9SAndroid Build Coastguard Worker// Rename the goldens as they may be copied into the source tree, and we don't 75*d57664e9SAndroid Build Coastguard Worker// need or want the usual `.java` linting (e.g., copyright checks). 76*d57664e9SAndroid Build Coastguard Workergenrule { 77*d57664e9SAndroid Build Coastguard Worker name: "systemfeatures-gen-tests-golden-srcs", 78*d57664e9SAndroid Build Coastguard Worker cmd: "for f in $(in); do cp $$f $(genDir)/tests/gen/$$(basename $$f).gen; done", 79*d57664e9SAndroid Build Coastguard Worker srcs: [":systemfeatures-gen-tests-srcs"], 80*d57664e9SAndroid Build Coastguard Worker out: [ 81*d57664e9SAndroid Build Coastguard Worker "tests/gen/RwNoFeatures.java.gen", 82*d57664e9SAndroid Build Coastguard Worker "tests/gen/RoNoFeatures.java.gen", 83*d57664e9SAndroid Build Coastguard Worker "tests/gen/RwFeatures.java.gen", 84*d57664e9SAndroid Build Coastguard Worker "tests/gen/RoFeatures.java.gen", 85*d57664e9SAndroid Build Coastguard Worker ], 86*d57664e9SAndroid Build Coastguard Worker} 87*d57664e9SAndroid Build Coastguard Worker 88*d57664e9SAndroid Build Coastguard Worker// Golden output testing. Golden sources can be updated via: 89*d57664e9SAndroid Build Coastguard Worker// $ANDROID_BUILD_TOP/frameworks/base/tools/systemfeatures/tests/golden_test.sh --update 90*d57664e9SAndroid Build Coastguard Workersh_test_host { 91*d57664e9SAndroid Build Coastguard Worker name: "systemfeatures-gen-golden-tests", 92*d57664e9SAndroid Build Coastguard Worker src: "tests/golden_test.sh", 93*d57664e9SAndroid Build Coastguard Worker filename: "systemfeatures-gen-golden-tests.sh", 94*d57664e9SAndroid Build Coastguard Worker test_config: "tests/systemfeatures-gen-golden-tests.xml", 95*d57664e9SAndroid Build Coastguard Worker data: [ 96*d57664e9SAndroid Build Coastguard Worker "tests/golden/**/*.java*", 97*d57664e9SAndroid Build Coastguard Worker ":systemfeatures-gen-tests-golden-srcs", 98*d57664e9SAndroid Build Coastguard Worker ], 99*d57664e9SAndroid Build Coastguard Worker test_options: { 100*d57664e9SAndroid Build Coastguard Worker unit_test: true, 101*d57664e9SAndroid Build Coastguard Worker }, 102*d57664e9SAndroid Build Coastguard Worker} 103