1// Copyright (C) 2022 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19java_library_host {
20    name: "sts-host-util",
21    java_resources: [":sts_host_util_java_resources"],
22    defaults: ["cts_error_prone_rules"],
23
24    srcs: [
25        "src/**/*.java",
26    ],
27    static_libs: [
28        "auto_value_annotations",
29        "caliper-prebuilts",
30        "sts-common-util-lib",
31        "sts-libtombstone_proto-java",
32        "truth",
33        "xz-java",
34    ],
35    plugins: ["auto_value_plugin"],
36    libs: [
37        "compatibility-host-util",
38        "compatibility-tradefed",
39        "guava",
40        "tradefed",
41    ],
42}
43
44// Workaround: java_resource_dirs ignores *.java files
45filegroup {
46    name: "sts_host_util_java_resources",
47    path: "res/",
48    srcs: ["res/**/*.java"],
49}
50
51java_library_host {
52    name: "sts-libtombstone_proto-java",
53    visibility: [
54        "//platform_testing/libraries/sts-common-util/host-side",
55    ],
56    srcs: [
57        ":libtombstone_proto-src",
58    ],
59    proto: {
60        type: "lite",
61    },
62    static_libs: [
63        "libprotobuf-java-lite",
64    ],
65}
66
67// Turn off various doclava warnings when generating
68// the docs. These are the same warnings that are
69// turned off in tools/tradefed/core
70tradefed_docs_only_args = " -hide 101 -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 "
71
72droiddoc_host {
73    name: "sts-docs",
74    srcs: [
75        "src/**/*.java",
76    ],
77    libs: [
78        "auto_value_annotations",
79        "sts-common-util-lib",
80        "sts-libtombstone_proto-java",
81        "truth",
82        "xz-java",
83        "compatibility-host-util",
84        "compatibility-tradefed",
85        "guava",
86        "tradefed",
87    ],
88    custom_template: "droiddoc-templates-sdk",
89    // These settings are for integrating the javadoc with Devsite. See go/generate-tradefed-docs
90    hdf: [
91        "sac true",
92        "devices true",
93        "android.whichdoc online",
94        "css.path /reference/assets/css/doclava-devsite.css",
95        "book.root toc",
96        "book.path /_book.yaml",
97    ],
98    args: tradefed_docs_only_args +
99          "-yaml _toc.yaml " +
100          "-apidocsdir reference/sts/ " +
101          "-werror " +
102          "-package " +
103          "-devsite ",
104}
105
106cc_defaults {
107    name: "sts_defaults",
108    compile_multilib: "both",
109    multilib: {
110        lib32: {
111            suffix: "_sts32",
112        },
113        lib64: {
114            suffix: "_sts64",
115        },
116        // build/soong/common/arch.go default returns nil; no default possible
117    },
118    arch: {
119        arm: {
120            instruction_set: "arm",
121        },
122    },
123    auto_gen_config: false,
124    test_suites: [
125        "sts",
126    ],
127    cflags: [
128        "-Wall",
129        "-Werror",
130    ],
131}
132