blob: 3351524d7d80784c030e618a9261dd44118261bf [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",
27 "-Xep:FormatString:ERROR",
28 "-Xep:GetClassOnClass:ERROR",
29 "-Xep:IdentityBinaryExpression:ERROR",
30 "-Xep:JUnit3TestNotRun:ERROR",
31 "-Xep:JUnit4ClassUsedInJUnit3:ERROR",
32 "-Xep:JUnitAmbiguousTestClass:ERROR",
33 "-Xep:MissingFail:ERROR",
34 "-Xep:MissingOverride:ERROR",
35 "-Xep:MustBeClosedChecker:ERROR",
36 "-Xep:Overrides:ERROR",
37 "-Xep:PackageLocation:ERROR",
38 "-Xep:ReferenceEquality:ERROR",
39 "-Xep:RemoveUnusedImports:ERROR",
40 "-Xep:ReturnValueIgnored:ERROR",
41 "-Xep:SelfEquals:ERROR",
42 "-Xep:SizeGreaterThanOrEqualsZero:ERROR",
43 "-Xep:TryFailThrowable:ERROR",
44 ],
45 },
46}
47
48java_defaults {
49 name: "tradefed_defaults",
50 defaults: [ "tradefed_errorprone_defaults" ],
51 javacflags: [
52 "-g",
53 "-Xlint",
54 ],
55}
56
Nan Zhangd4bde952018-07-18 16:58:43 -070057java_library_host {
58 name: "tradefed-protos",
59 srcs: ["proto/**/*.proto"],
60 libs: [
61 "libprotobuf-java-full",
62 ],
63 proto: {
64 include_dirs: ["external/protobuf/src"],
65 type: "full",
66 },
67 static_libs: [
68 "platformprotos",
69 ],
70}
71
72java_library_host {
73 name: "tradefed",
74 defaults: ["tradefed_defaults"],
75 srcs: [
76 "src/**/*.java",
77 ],
78 java_resource_dirs: [
79 "res",
80 ],
81 openjdk9: {
82 javacflags: [
Nan Zhangbc2ca022018-07-23 17:46:34 -070083 "--add-modules=java.xml.bind",
Nan Zhangd4bde952018-07-18 16:58:43 -070084 ],
85 },
86 static_libs: [
Daniel Peykove3047892018-11-01 13:08:35 -070087 "aoa-helper",
Julien Desprez251ec572018-11-01 11:15:48 -070088 "commons-compress-prebuilt",
89 "error_prone_annotations-2.0.18",
90 "google-api-java-client-min-repackaged",
Julien Desprez512e39d2018-11-09 11:02:21 -080091 "google-api-services-compute",
Julien Desprez251ec572018-11-01 11:15:48 -070092 "gson-prebuilt-jar",
93 "guice",
94 "jline-1.0",
Nan Zhangd4bde952018-07-18 16:58:43 -070095 "junit",
96 "junit-params",
97 "kxml2-2.3.0",
Nan Zhangd4bde952018-07-18 16:58:43 -070098 "libprotobuf-java-full",
Nan Zhangd4bde952018-07-18 16:58:43 -070099 "longevity-host-lib",
gopinath515dd2e2018-10-25 15:47:37 -0700100 "perfetto_config-full",
Nan Zhangd4bde952018-07-18 16:58:43 -0700101 "platform-test-annotations",
Julien Desprez251ec572018-11-01 11:15:48 -0700102 "tf-remote-client",
Julien Desprez97ee9992018-11-01 16:17:36 -0700103 "tradefed-grpc-lib-1.0.1",
Julien Desprez251ec572018-11-01 11:15:48 -0700104 "tradefed-protos",
Nan Zhangd4bde952018-07-18 16:58:43 -0700105 ],
106 libs: [
107 "loganalysis",
108 "tools-common-prebuilt",
109 ],
110 manifest: "MANIFEST.mf",
111}
112
Julien Desprez97ee9992018-11-01 16:17:36 -0700113// Use 1.0.1 version of GRPC to be compatible of current guava version
114java_library_host {
115 name: "tradefed-grpc-lib-1.0.1",
116 srcs: [
117 "proto-gen/**/*.java",
118 ],
119 libs: [
120 "tradefed-protos",
121 "guava",
122 ],
Tobias Thierer12dca902018-11-05 15:21:12 +0000123 openjdk9: {
124 javacflags: [
125 "--add-modules=java.xml.ws.annotation",
Tobias Thierer7bcb2802018-11-07 19:33:25 +0000126 ],
Tobias Thierer12dca902018-11-05 15:21:12 +0000127 },
Julien Desprez97ee9992018-11-01 16:17:36 -0700128 static_libs: [
129 "grpc-java-context-1.0.1",
130 "grpc-java-core-1.0.1",
131 "grpc-java-netty-1.0.1",
132 "grpc-java-protobuf-1.0.1",
133 "grpc-java-protobuf-lite-1.0.1",
134 "grpc-java-stub-1.0.1",
135 "netty-buffer-java-4.1.3.Final",
136 "netty-codec-java-4.1.3.Final",
137 "netty-codec-http2-java-4.1.3.Final",
138 "netty-common-java-4.1.3.Final",
139 "netty-handler-java-4.1.3.Final",
140 "netty-resolver-java-4.1.3.Final",
141 "netty-transport-java-4.1.3.Final",
142 ]
143}
144
Nan Zhang8e4593b2018-09-18 21:07:24 -0700145droidstubs_host {
146 name: "tradefed-doc-stubs",
Nan Zhangd4bde952018-07-18 16:58:43 -0700147 srcs: [
148 "src/**/*.java",
149 ],
150 libs: [
151 "loganalysis",
152 "tradefed",
153 "tools-common-prebuilt",
154 ],
Nan Zhang8e4593b2018-09-18 21:07:24 -0700155 args: "--package",
156 create_doc_stubs: true,
157}
158
159droiddoc_host {
160 name: "tradefed-docs",
161 srcs: [
162 ":tradefed-doc-stubs",
163 ],
Nan Zhangd4bde952018-07-18 16:58:43 -0700164 custom_template: "droiddoc-templates-sdk",
165 hdf: [
166 "sac true",
167 "devices true",
168 "android.whichdoc online",
169 "css.path /reference/assets/css/doclava-devsite.css",
170 "book.root toc",
171 "book.path /_book.yaml",
172 ],
173 args: "-yaml _book.yaml " +
174 "-apidocsdir reference/tradefed/ " +
175 "-werror " +
176 "-package " +
177 "-devsite ",
178 create_stubs: false,
179}