blob: aa89141cf626c83e24eb5e95074d093b483e1729 [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: [
87 "junit",
88 "junit-params",
89 "kxml2-2.3.0",
90 "jline-1.0",
91 "tf-remote-client",
92 "commons-compress-prebuilt",
93 "libprotobuf-java-full",
94 "tradefed-protos",
95 "error_prone_annotations-2.0.18",
96 "longevity-host-lib",
97 "gson-prebuilt-jar",
98 "guice",
99 "platform-test-annotations",
100 ],
101 libs: [
102 "loganalysis",
103 "tools-common-prebuilt",
104 ],
105 manifest: "MANIFEST.mf",
106}
107
Nan Zhang8e4593b2018-09-18 21:07:24 -0700108droidstubs_host {
109 name: "tradefed-doc-stubs",
Nan Zhangd4bde952018-07-18 16:58:43 -0700110 srcs: [
111 "src/**/*.java",
112 ],
113 libs: [
114 "loganalysis",
115 "tradefed",
116 "tools-common-prebuilt",
117 ],
Nan Zhang8e4593b2018-09-18 21:07:24 -0700118 args: "--package",
119 create_doc_stubs: true,
120}
121
122droiddoc_host {
123 name: "tradefed-docs",
124 srcs: [
125 ":tradefed-doc-stubs",
126 ],
Nan Zhangd4bde952018-07-18 16:58:43 -0700127 custom_template: "droiddoc-templates-sdk",
128 hdf: [
129 "sac true",
130 "devices true",
131 "android.whichdoc online",
132 "css.path /reference/assets/css/doclava-devsite.css",
133 "book.root toc",
134 "book.path /_book.yaml",
135 ],
136 args: "-yaml _book.yaml " +
137 "-apidocsdir reference/tradefed/ " +
138 "-werror " +
139 "-package " +
140 "-devsite ",
141 create_stubs: false,
142}