blob: 5f6ca752c4c790e43d33917e6715cd619028fb7c [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: [
Julien Desprez251ec572018-11-01 11:15:48 -070087 "commons-compress-prebuilt",
88 "error_prone_annotations-2.0.18",
89 "google-api-java-client-min-repackaged",
90 "gson-prebuilt-jar",
91 "guice",
92 "jline-1.0",
Nan Zhangd4bde952018-07-18 16:58:43 -070093 "junit",
94 "junit-params",
95 "kxml2-2.3.0",
Nan Zhangd4bde952018-07-18 16:58:43 -070096 "libprotobuf-java-full",
Nan Zhangd4bde952018-07-18 16:58:43 -070097 "longevity-host-lib",
gopinath515dd2e2018-10-25 15:47:37 -070098 "perfetto_config-full",
Nan Zhangd4bde952018-07-18 16:58:43 -070099 "platform-test-annotations",
Julien Desprez251ec572018-11-01 11:15:48 -0700100 "tf-remote-client",
Julien Desprez97ee9992018-11-01 16:17:36 -0700101 "tradefed-grpc-lib-1.0.1",
Julien Desprez251ec572018-11-01 11:15:48 -0700102 "tradefed-protos",
Nan Zhangd4bde952018-07-18 16:58:43 -0700103 ],
104 libs: [
105 "loganalysis",
106 "tools-common-prebuilt",
107 ],
108 manifest: "MANIFEST.mf",
109}
110
Julien Desprez97ee9992018-11-01 16:17:36 -0700111// Use 1.0.1 version of GRPC to be compatible of current guava version
112java_library_host {
113 name: "tradefed-grpc-lib-1.0.1",
114 srcs: [
115 "proto-gen/**/*.java",
116 ],
117 libs: [
118 "tradefed-protos",
119 "guava",
120 ],
Tobias Thierer12dca902018-11-05 15:21:12 +0000121 openjdk9: {
122 javacflags: [
123 "--add-modules=java.xml.ws.annotation",
124 ],
125 },
Julien Desprez97ee9992018-11-01 16:17:36 -0700126 static_libs: [
127 "grpc-java-context-1.0.1",
128 "grpc-java-core-1.0.1",
129 "grpc-java-netty-1.0.1",
130 "grpc-java-protobuf-1.0.1",
131 "grpc-java-protobuf-lite-1.0.1",
132 "grpc-java-stub-1.0.1",
133 "netty-buffer-java-4.1.3.Final",
134 "netty-codec-java-4.1.3.Final",
135 "netty-codec-http2-java-4.1.3.Final",
136 "netty-common-java-4.1.3.Final",
137 "netty-handler-java-4.1.3.Final",
138 "netty-resolver-java-4.1.3.Final",
139 "netty-transport-java-4.1.3.Final",
140 ]
141}
142
Nan Zhang8e4593b2018-09-18 21:07:24 -0700143droidstubs_host {
144 name: "tradefed-doc-stubs",
Nan Zhangd4bde952018-07-18 16:58:43 -0700145 srcs: [
146 "src/**/*.java",
147 ],
148 libs: [
149 "loganalysis",
150 "tradefed",
151 "tools-common-prebuilt",
152 ],
Nan Zhang8e4593b2018-09-18 21:07:24 -0700153 args: "--package",
154 create_doc_stubs: true,
155}
156
157droiddoc_host {
158 name: "tradefed-docs",
159 srcs: [
160 ":tradefed-doc-stubs",
161 ],
Nan Zhangd4bde952018-07-18 16:58:43 -0700162 custom_template: "droiddoc-templates-sdk",
163 hdf: [
164 "sac true",
165 "devices true",
166 "android.whichdoc online",
167 "css.path /reference/assets/css/doclava-devsite.css",
168 "book.root toc",
169 "book.path /_book.yaml",
170 ],
171 args: "-yaml _book.yaml " +
172 "-apidocsdir reference/tradefed/ " +
173 "-werror " +
174 "-package " +
175 "-devsite ",
176 create_stubs: false,
177}