blob: aca25eb8f603e6f0ba14953ebf3d73dca3569aa8 [file] [log] [blame]
Jared Duke230d6502024-07-31 21:35:24 +00001package {
2 // See: http://go/android-license-faq
3 // A large-scale-change added 'default_applicable_licenses' to import
4 // all of the 'license_kinds' from "frameworks_base_license"
5 // to get the below license kinds:
6 // SPDX-license-identifier-Apache-2.0
7 default_applicable_licenses: ["frameworks_base_license"],
8}
9
10java_library_host {
11 name: "systemfeatures-gen-lib",
12 srcs: [
13 "src/**/*.java",
14 "src/**/*.kt",
15 ],
16 static_libs: [
17 "guava",
18 "javapoet",
19 ],
20}
21
22java_binary_host {
23 name: "systemfeatures-gen-tool",
24 main_class: "com.android.systemfeatures.SystemFeaturesGenerator",
25 static_libs: ["systemfeatures-gen-lib"],
26}
27
28// TODO(b/203143243): Add golden diff test for generated sources.
29// Functional runtime behavior is covered in systemfeatures-gen-tests.
30genrule {
31 name: "systemfeatures-gen-tests-srcs",
32 cmd: "$(location systemfeatures-gen-tool) com.android.systemfeatures.RwNoFeatures --readonly=false > $(location RwNoFeatures.java) && " +
Jared Duke97ffe122024-08-19 23:30:28 +000033 "$(location systemfeatures-gen-tool) com.android.systemfeatures.RoNoFeatures --readonly=true --feature-apis=WATCH > $(location RoNoFeatures.java) && " +
Jared Duke230d6502024-07-31 21:35:24 +000034 "$(location systemfeatures-gen-tool) com.android.systemfeatures.RwFeatures --readonly=false --feature=WATCH:1 --feature=WIFI:0 --feature=VULKAN:-1 --feature=AUTO: > $(location RwFeatures.java) && " +
Jared Duke97ffe122024-08-19 23:30:28 +000035 "$(location systemfeatures-gen-tool) com.android.systemfeatures.RoFeatures --readonly=true --feature=WATCH:1 --feature=WIFI:0 --feature=VULKAN:-1 --feature=AUTO: --feature-apis=WATCH,PC > $(location RoFeatures.java)",
Jared Duke230d6502024-07-31 21:35:24 +000036 out: [
37 "RwNoFeatures.java",
38 "RoNoFeatures.java",
39 "RwFeatures.java",
40 "RoFeatures.java",
41 ],
42 tools: ["systemfeatures-gen-tool"],
43}
44
45java_test_host {
46 name: "systemfeatures-gen-tests",
47 test_suites: ["general-tests"],
48 srcs: [
49 "tests/**/*.java",
50 ":systemfeatures-gen-tests-srcs",
51 ],
52 test_options: {
53 unit_test: true,
54 },
55 static_libs: [
56 "aconfig-annotations-lib",
57 "framework-annotations-lib",
58 "junit",
59 "objenesis",
60 "mockito",
61 "truth",
62 ],
63}