blob: d9fc4e2aeb24f0115fd24489ea4a25158835ff55 [file] [log] [blame]
Andreas Gamped6c02c82018-05-14 10:52:06 -07001// Copyright 2018 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
15// Set of error prone rules to ensure code quality
16// PackageLocation check requires the androidCompatible=false otherwise it does not do anything.
17java_defaults {
18 name: "tradefed_errorprone_defaults",
19 errorprone: {
20 javacflags: [
21 "-XDandroidCompatible=false",
22 "-Xep:ArrayToString:ERROR",
23 "-Xep:BoxedPrimitiveConstructor:ERROR",
24 "-Xep:ConstantField:ERROR",
25 "-Xep:DeadException:ERROR",
26 "-Xep:EqualsIncompatibleType:ERROR",
Julien Despreze2fb5aa2019-03-26 10:49:01 -070027 "-Xep:ExtendingJUnitAssert:ERROR",
Andreas Gamped6c02c82018-05-14 10:52:06 -070028 "-Xep:FormatString:ERROR",
29 "-Xep:GetClassOnClass:ERROR",
30 "-Xep:IdentityBinaryExpression:ERROR",
31 "-Xep:JUnit3TestNotRun:ERROR",
32 "-Xep:JUnit4ClassUsedInJUnit3:ERROR",
33 "-Xep:JUnitAmbiguousTestClass:ERROR",
34 "-Xep:MissingFail:ERROR",
35 "-Xep:MissingOverride:ERROR",
Julien Despreze2fb5aa2019-03-26 10:49:01 -070036 "-Xep:ModifiedButNotUsed:ERROR",
Andreas Gamped6c02c82018-05-14 10:52:06 -070037 "-Xep:MustBeClosedChecker:ERROR",
38 "-Xep:Overrides:ERROR",
39 "-Xep:PackageLocation:ERROR",
Julien Despreze2fb5aa2019-03-26 10:49:01 -070040 "-Xep:ParameterName:ERROR",
Andreas Gamped6c02c82018-05-14 10:52:06 -070041 "-Xep:ReferenceEquality:ERROR",
42 "-Xep:RemoveUnusedImports:ERROR",
43 "-Xep:ReturnValueIgnored:ERROR",
44 "-Xep:SelfEquals:ERROR",
45 "-Xep:SizeGreaterThanOrEqualsZero:ERROR",
46 "-Xep:TryFailThrowable:ERROR",
47 ],
48 },
49}
50
51java_defaults {
52 name: "tradefed_defaults",
53 defaults: [ "tradefed_errorprone_defaults" ],
54 javacflags: [
55 "-g",
56 "-Xlint",
57 ],
58}
59
Nan Zhangd4bde952018-07-18 16:58:43 -070060java_library_host {
61 name: "tradefed-protos",
62 srcs: ["proto/**/*.proto"],
63 libs: [
64 "libprotobuf-java-full",
65 ],
66 proto: {
67 include_dirs: ["external/protobuf/src"],
68 type: "full",
69 },
70 static_libs: [
71 "platformprotos",
Julien Desprezf7f52e82019-05-24 13:33:10 -070072 "asuite_proto_java",
Nan Zhangd4bde952018-07-18 16:58:43 -070073 ],
74}
75
76java_library_host {
Julien Desprez813ef6f2019-05-29 13:03:22 -070077 name: "tradefed-common-util",
78 defaults: ["tradefed_defaults"],
79 srcs: [
80 "common_util/**/*.java",
81 ],
82 openjdk9: {
83 javacflags: [
84 "--add-modules=java.xml.bind",
85 ],
86 },
87 static_libs: [
88 "commons-compress-prebuilt",
89 ],
90 libs: [
91 "ddmlib-prebuilt",
92 "guava",
93 "tradefed-protos",
94 "devtools-annotations-prebuilt",
95 ],
96}
97
98java_library_host {
Nan Zhangd4bde952018-07-18 16:58:43 -070099 name: "tradefed",
100 defaults: ["tradefed_defaults"],
101 srcs: [
102 "src/**/*.java",
Julien Desprez9597b092019-06-11 00:15:48 +0000103 "clearcut_client/**/*.java",
Nan Zhangd4bde952018-07-18 16:58:43 -0700104 ],
105 java_resource_dirs: [
106 "res",
107 ],
108 openjdk9: {
109 javacflags: [
Nan Zhangbc2ca022018-07-23 17:46:34 -0700110 "--add-modules=java.xml.bind",
Nan Zhangd4bde952018-07-18 16:58:43 -0700111 ],
112 },
113 static_libs: [
Julien Desprez813ef6f2019-05-29 13:03:22 -0700114 "tradefed-common-util",
Julien Desprez9597b092019-06-11 00:15:48 +0000115 "protobuf-java-util-prebuilt-jar",
Daniel Peykove3047892018-11-01 13:08:35 -0700116 "aoa-helper",
Julien Desprez251ec572018-11-01 11:15:48 -0700117 "error_prone_annotations-2.0.18",
118 "google-api-java-client-min-repackaged",
Julien Desprez512e39d2018-11-09 11:02:21 -0800119 "google-api-services-compute",
Xing Dai83562b72019-01-02 12:13:10 -0800120 "google-api-services-storage",
Julien Desprez251ec572018-11-01 11:15:48 -0700121 "gson-prebuilt-jar",
122 "guice",
Oliver Nguyend15cc752018-11-02 15:44:45 -0700123 "jacoco-cli",
Julien Desprez251ec572018-11-01 11:15:48 -0700124 "jline-1.0",
Nan Zhangd4bde952018-07-18 16:58:43 -0700125 "junit",
126 "junit-params",
127 "kxml2-2.3.0",
Nan Zhangd4bde952018-07-18 16:58:43 -0700128 "libprotobuf-java-full",
Nan Zhangd4bde952018-07-18 16:58:43 -0700129 "longevity-host-lib",
gopinath515dd2e2018-10-25 15:47:37 -0700130 "perfetto_config-full",
Nan Zhangd4bde952018-07-18 16:58:43 -0700131 "platform-test-annotations",
Michael Rosenfeldb2440c32018-12-17 12:17:59 -0800132 "test-composers",
Julien Desprez251ec572018-11-01 11:15:48 -0700133 "tf-remote-client",
134 "tradefed-protos",
Nan Zhangd4bde952018-07-18 16:58:43 -0700135 ],
136 libs: [
137 "loganalysis",
Nan Zhangd4bde952018-07-18 16:58:43 -0700138 ],
139 manifest: "MANIFEST.mf",
140}
141
Tor Norbyee7484822018-12-26 15:03:01 -0800142// Turn off various doclava warnings when generating
143// the docs. These are the same warnings that are
144// turned off in frameworks/base, plus error 101
145// which is necessary here because tradefed is
146// referencing bootclasspath classes that are not
147// feed to metalava when generating the stubs.
148tradefed_docs_only_args = " -hide 101 -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 "
149
Nan Zhang8e4593b2018-09-18 21:07:24 -0700150droidstubs_host {
151 name: "tradefed-doc-stubs",
Nan Zhangd4bde952018-07-18 16:58:43 -0700152 srcs: [
153 "src/**/*.java",
154 ],
155 libs: [
156 "loganalysis",
157 "tradefed",
Nan Zhangd4bde952018-07-18 16:58:43 -0700158 ],
Tor Norbyee7484822018-12-26 15:03:01 -0800159 args: tradefed_docs_only_args + "--package",
Nan Zhang8e4593b2018-09-18 21:07:24 -0700160 create_doc_stubs: true,
161}
162
163droiddoc_host {
164 name: "tradefed-docs",
165 srcs: [
166 ":tradefed-doc-stubs",
167 ],
Tor Norbyee7484822018-12-26 15:03:01 -0800168 libs: [
169 "loganalysis",
170 "tradefed",
Tor Norbyee7484822018-12-26 15:03:01 -0800171 ],
Nan Zhangd4bde952018-07-18 16:58:43 -0700172 custom_template: "droiddoc-templates-sdk",
173 hdf: [
174 "sac true",
175 "devices true",
176 "android.whichdoc online",
177 "css.path /reference/assets/css/doclava-devsite.css",
178 "book.root toc",
179 "book.path /_book.yaml",
180 ],
Tor Norbyee7484822018-12-26 15:03:01 -0800181 args: tradefed_docs_only_args +
182 "-yaml _book.yaml " +
Nan Zhangd4bde952018-07-18 16:58:43 -0700183 "-apidocsdir reference/tradefed/ " +
184 "-werror " +
185 "-package " +
186 "-devsite ",
187 create_stubs: false,
188}