blob: f454883219983c0379d1fc85084536b61003a26e [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",
Julien Desprezf9e8c282019-12-03 15:56:59 -080032 "-Xep:JUnit4TestNotRun:ERROR",
Andreas Gamped6c02c82018-05-14 10:52:06 -070033 "-Xep:JUnit4ClassUsedInJUnit3:ERROR",
34 "-Xep:JUnitAmbiguousTestClass:ERROR",
35 "-Xep:MissingFail:ERROR",
36 "-Xep:MissingOverride:ERROR",
Julien Despreze2fb5aa2019-03-26 10:49:01 -070037 "-Xep:ModifiedButNotUsed:ERROR",
Andreas Gamped6c02c82018-05-14 10:52:06 -070038 "-Xep:MustBeClosedChecker:ERROR",
39 "-Xep:Overrides:ERROR",
40 "-Xep:PackageLocation:ERROR",
Julien Despreze2fb5aa2019-03-26 10:49:01 -070041 "-Xep:ParameterName:ERROR",
Andreas Gamped6c02c82018-05-14 10:52:06 -070042 "-Xep:ReferenceEquality:ERROR",
43 "-Xep:RemoveUnusedImports:ERROR",
44 "-Xep:ReturnValueIgnored:ERROR",
45 "-Xep:SelfEquals:ERROR",
46 "-Xep:SizeGreaterThanOrEqualsZero:ERROR",
47 "-Xep:TryFailThrowable:ERROR",
48 ],
49 },
50}
51
52java_defaults {
53 name: "tradefed_defaults",
54 defaults: [ "tradefed_errorprone_defaults" ],
55 javacflags: [
56 "-g",
57 "-Xlint",
58 ],
59}
60
Nan Zhangd4bde952018-07-18 16:58:43 -070061java_library_host {
62 name: "tradefed-protos",
63 srcs: ["proto/**/*.proto"],
64 libs: [
65 "libprotobuf-java-full",
66 ],
67 proto: {
68 include_dirs: ["external/protobuf/src"],
69 type: "full",
70 },
71 static_libs: [
72 "platformprotos",
Julien Desprezf7f52e82019-05-24 13:33:10 -070073 "asuite_proto_java",
Nan Zhangd4bde952018-07-18 16:58:43 -070074 ],
75}
76
Julien Despreze96a2922019-07-12 17:21:16 -070077// Main Target to build tradefed jar
Colin Crossa48b5672019-10-21 18:31:07 +000078java_library_host {
Nan Zhangd4bde952018-07-18 16:58:43 -070079 name: "tradefed",
80 defaults: ["tradefed_defaults"],
Julien Despreze96a2922019-07-12 17:21:16 -070081 java_resource_dirs: [
82 "res",
83 ],
84 static_libs: [
Julien Desprez8f41e992019-07-15 11:43:55 -070085 "tradefed-lib-core",
Julien Despreze96a2922019-07-12 17:21:16 -070086 "tradefed-test-framework",
87 ],
88 manifest: "MANIFEST.mf",
89}
90
91java_library_host {
Julien Desprez8f41e992019-07-15 11:43:55 -070092 name: "tradefed-lib-core",
Julien Despreze96a2922019-07-12 17:21:16 -070093 defaults: ["tradefed_defaults"],
Nan Zhangd4bde952018-07-18 16:58:43 -070094 srcs: [
95 "src/**/*.java",
Julien Desprez11b062a2019-06-17 13:25:01 -070096 "global_configuration/**/*.java",
Nan Zhangd4bde952018-07-18 16:58:43 -070097 ],
Nan Zhangd4bde952018-07-18 16:58:43 -070098 static_libs: [
Julien Desprez813ef6f2019-05-29 13:03:22 -070099 "tradefed-common-util",
Julien Desprez59583c32019-06-10 18:51:55 -0700100 "tradefed-clearcut-client",
Julien Desprez0b6e7722019-06-17 14:55:17 -0700101 "tradefed-result-interfaces",
102 "tradefed-device-build-interfaces",
Julien Despreze96a2922019-07-12 17:21:16 -0700103 "tradefed-invocation-interfaces",
Julien Desprez9597b092019-06-11 00:15:48 +0000104 "protobuf-java-util-prebuilt-jar",
Daniel Peykove3047892018-11-01 13:08:35 -0700105 "aoa-helper",
Julien Desprez251ec572018-11-01 11:15:48 -0700106 "error_prone_annotations-2.0.18",
107 "google-api-java-client-min-repackaged",
Julien Desprez512e39d2018-11-09 11:02:21 -0800108 "google-api-services-compute",
Xing Dai83562b72019-01-02 12:13:10 -0800109 "google-api-services-storage",
Julien Desprez251ec572018-11-01 11:15:48 -0700110 "gson-prebuilt-jar",
111 "guice",
Oliver Nguyend15cc752018-11-02 15:44:45 -0700112 "jacoco-cli",
Julien Desprez251ec572018-11-01 11:15:48 -0700113 "jline-1.0",
Nan Zhangd4bde952018-07-18 16:58:43 -0700114 "junit-params",
115 "kxml2-2.3.0",
Nan Zhangd4bde952018-07-18 16:58:43 -0700116 "libprotobuf-java-full",
Nan Zhangd4bde952018-07-18 16:58:43 -0700117 "platform-test-annotations",
Julien Desprez251ec572018-11-01 11:15:48 -0700118 "tf-remote-client",
119 "tradefed-protos",
Joseph Murphyb927bf62019-09-30 19:17:00 -0700120 "tradefed-isolation-protos",
121 "tradefed-lite",
Nan Zhangd4bde952018-07-18 16:58:43 -0700122 ],
123 libs: [
124 "loganalysis",
Nan Zhangd4bde952018-07-18 16:58:43 -0700125 ],
Nan Zhangd4bde952018-07-18 16:58:43 -0700126}
127
Tor Norbyee7484822018-12-26 15:03:01 -0800128// Turn off various doclava warnings when generating
129// the docs. These are the same warnings that are
130// turned off in frameworks/base, plus error 101
131// which is necessary here because tradefed is
132// referencing bootclasspath classes that are not
133// feed to metalava when generating the stubs.
134tradefed_docs_only_args = " -hide 101 -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 "
135
Nan Zhang8e4593b2018-09-18 21:07:24 -0700136droidstubs_host {
137 name: "tradefed-doc-stubs",
Nan Zhangd4bde952018-07-18 16:58:43 -0700138 srcs: [
139 "src/**/*.java",
140 ],
141 libs: [
142 "loganalysis",
143 "tradefed",
Nan Zhangd4bde952018-07-18 16:58:43 -0700144 ],
Tor Norbyee7484822018-12-26 15:03:01 -0800145 args: tradefed_docs_only_args + "--package",
Nan Zhang8e4593b2018-09-18 21:07:24 -0700146 create_doc_stubs: true,
147}
148
149droiddoc_host {
150 name: "tradefed-docs",
151 srcs: [
152 ":tradefed-doc-stubs",
153 ],
Tor Norbyee7484822018-12-26 15:03:01 -0800154 libs: [
155 "loganalysis",
156 "tradefed",
Tor Norbyee7484822018-12-26 15:03:01 -0800157 ],
Nan Zhangd4bde952018-07-18 16:58:43 -0700158 custom_template: "droiddoc-templates-sdk",
159 hdf: [
160 "sac true",
161 "devices true",
162 "android.whichdoc online",
163 "css.path /reference/assets/css/doclava-devsite.css",
164 "book.root toc",
165 "book.path /_book.yaml",
166 ],
Tor Norbyee7484822018-12-26 15:03:01 -0800167 args: tradefed_docs_only_args +
168 "-yaml _book.yaml " +
Nan Zhangd4bde952018-07-18 16:58:43 -0700169 "-apidocsdir reference/tradefed/ " +
170 "-werror " +
171 "-package " +
172 "-devsite ",
173 create_stubs: false,
174}
Colin Cross47d81f42019-10-18 15:45:27 -0700175
176sh_binary_host {
177 name: "tradefed.sh",
178 src: "tradefed.sh",
179}
180
181sh_binary_host {
182 name: "tradefed_win",
183 src: "tradefed_win.bat",
184}
185
186sh_binary_host {
yangbill634c38d2019-10-28 12:06:32 +0800187 name: "script_help.sh",
Colin Cross47d81f42019-10-18 15:45:27 -0700188 src: "script_help.sh",
189}
190
191sh_binary_host {
yangbill634c38d2019-10-28 12:06:32 +0800192 name: "run_tf_cmd.sh",
Colin Cross47d81f42019-10-18 15:45:27 -0700193 src: "run_tf_cmd.sh",
194}
195
196sh_binary_host {
yangbill634c38d2019-10-28 12:06:32 +0800197 name: "atest_tradefed.sh",
Colin Cross47d81f42019-10-18 15:45:27 -0700198 src: "atest_tradefed.sh",
199}