blob: b04f6299f61af1160de27c80a9cf40c799772b7d [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
Julien Despreze96a2922019-07-12 17:21:16 -070076// Main Target to build tradefed jar
Colin Crossa48b5672019-10-21 18:31:07 +000077java_library_host {
Nan Zhangd4bde952018-07-18 16:58:43 -070078 name: "tradefed",
79 defaults: ["tradefed_defaults"],
Julien Despreze96a2922019-07-12 17:21:16 -070080 java_resource_dirs: [
81 "res",
82 ],
83 static_libs: [
Julien Desprez8f41e992019-07-15 11:43:55 -070084 "tradefed-lib-core",
Julien Despreze96a2922019-07-12 17:21:16 -070085 "tradefed-test-framework",
86 ],
87 manifest: "MANIFEST.mf",
88}
89
90java_library_host {
Julien Desprez8f41e992019-07-15 11:43:55 -070091 name: "tradefed-lib-core",
Julien Despreze96a2922019-07-12 17:21:16 -070092 defaults: ["tradefed_defaults"],
Nan Zhangd4bde952018-07-18 16:58:43 -070093 srcs: [
94 "src/**/*.java",
Julien Desprez11b062a2019-06-17 13:25:01 -070095 "global_configuration/**/*.java",
Nan Zhangd4bde952018-07-18 16:58:43 -070096 ],
Nan Zhangd4bde952018-07-18 16:58:43 -070097 static_libs: [
Julien Desprez813ef6f2019-05-29 13:03:22 -070098 "tradefed-common-util",
Julien Desprez59583c32019-06-10 18:51:55 -070099 "tradefed-clearcut-client",
Julien Desprez0b6e7722019-06-17 14:55:17 -0700100 "tradefed-result-interfaces",
101 "tradefed-device-build-interfaces",
Julien Despreze96a2922019-07-12 17:21:16 -0700102 "tradefed-invocation-interfaces",
Julien Desprez9597b092019-06-11 00:15:48 +0000103 "protobuf-java-util-prebuilt-jar",
Daniel Peykove3047892018-11-01 13:08:35 -0700104 "aoa-helper",
Julien Desprez251ec572018-11-01 11:15:48 -0700105 "error_prone_annotations-2.0.18",
106 "google-api-java-client-min-repackaged",
Julien Desprez512e39d2018-11-09 11:02:21 -0800107 "google-api-services-compute",
Xing Dai83562b72019-01-02 12:13:10 -0800108 "google-api-services-storage",
Julien Desprez251ec572018-11-01 11:15:48 -0700109 "gson-prebuilt-jar",
110 "guice",
Oliver Nguyend15cc752018-11-02 15:44:45 -0700111 "jacoco-cli",
Julien Desprez251ec572018-11-01 11:15:48 -0700112 "jline-1.0",
Nan Zhangd4bde952018-07-18 16:58:43 -0700113 "junit",
114 "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",
Nan Zhangd4bde952018-07-18 16:58:43 -0700120 ],
121 libs: [
122 "loganalysis",
Nan Zhangd4bde952018-07-18 16:58:43 -0700123 ],
Nan Zhangd4bde952018-07-18 16:58:43 -0700124}
125
Tor Norbyee7484822018-12-26 15:03:01 -0800126// Turn off various doclava warnings when generating
127// the docs. These are the same warnings that are
128// turned off in frameworks/base, plus error 101
129// which is necessary here because tradefed is
130// referencing bootclasspath classes that are not
131// feed to metalava when generating the stubs.
132tradefed_docs_only_args = " -hide 101 -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 "
133
Nan Zhang8e4593b2018-09-18 21:07:24 -0700134droidstubs_host {
135 name: "tradefed-doc-stubs",
Nan Zhangd4bde952018-07-18 16:58:43 -0700136 srcs: [
137 "src/**/*.java",
138 ],
139 libs: [
140 "loganalysis",
141 "tradefed",
Nan Zhangd4bde952018-07-18 16:58:43 -0700142 ],
Tor Norbyee7484822018-12-26 15:03:01 -0800143 args: tradefed_docs_only_args + "--package",
Nan Zhang8e4593b2018-09-18 21:07:24 -0700144 create_doc_stubs: true,
145}
146
147droiddoc_host {
148 name: "tradefed-docs",
149 srcs: [
150 ":tradefed-doc-stubs",
151 ],
Tor Norbyee7484822018-12-26 15:03:01 -0800152 libs: [
153 "loganalysis",
154 "tradefed",
Tor Norbyee7484822018-12-26 15:03:01 -0800155 ],
Nan Zhangd4bde952018-07-18 16:58:43 -0700156 custom_template: "droiddoc-templates-sdk",
157 hdf: [
158 "sac true",
159 "devices true",
160 "android.whichdoc online",
161 "css.path /reference/assets/css/doclava-devsite.css",
162 "book.root toc",
163 "book.path /_book.yaml",
164 ],
Tor Norbyee7484822018-12-26 15:03:01 -0800165 args: tradefed_docs_only_args +
166 "-yaml _book.yaml " +
Nan Zhangd4bde952018-07-18 16:58:43 -0700167 "-apidocsdir reference/tradefed/ " +
168 "-werror " +
169 "-package " +
170 "-devsite ",
171 create_stubs: false,
172}
Colin Cross47d81f42019-10-18 15:45:27 -0700173
174sh_binary_host {
175 name: "tradefed.sh",
176 src: "tradefed.sh",
177}
178
179sh_binary_host {
180 name: "tradefed_win",
181 src: "tradefed_win.bat",
182}
183
184sh_binary_host {
yangbill634c38d2019-10-28 12:06:32 +0800185 name: "script_help.sh",
Colin Cross47d81f42019-10-18 15:45:27 -0700186 src: "script_help.sh",
187}
188
189sh_binary_host {
yangbill634c38d2019-10-28 12:06:32 +0800190 name: "run_tf_cmd.sh",
Colin Cross47d81f42019-10-18 15:45:27 -0700191 src: "run_tf_cmd.sh",
192}
193
194sh_binary_host {
yangbill634c38d2019-10-28 12:06:32 +0800195 name: "atest_tradefed.sh",
Colin Cross47d81f42019-10-18 15:45:27 -0700196 src: "atest_tradefed.sh",
197}