blob: cbd1e50d72fc3af858ece96991656c791dfbd8da [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",
72 ],
73}
74
75java_library_host {
76 name: "tradefed",
77 defaults: ["tradefed_defaults"],
78 srcs: [
79 "src/**/*.java",
80 ],
81 java_resource_dirs: [
82 "res",
83 ],
84 openjdk9: {
85 javacflags: [
Nan Zhangbc2ca022018-07-23 17:46:34 -070086 "--add-modules=java.xml.bind",
Nan Zhangd4bde952018-07-18 16:58:43 -070087 ],
88 },
89 static_libs: [
Daniel Peykove3047892018-11-01 13:08:35 -070090 "aoa-helper",
Julien Desprez251ec572018-11-01 11:15:48 -070091 "commons-compress-prebuilt",
92 "error_prone_annotations-2.0.18",
93 "google-api-java-client-min-repackaged",
Julien Desprez512e39d2018-11-09 11:02:21 -080094 "google-api-services-compute",
Xing Dai83562b72019-01-02 12:13:10 -080095 "google-api-services-storage",
Julien Desprez251ec572018-11-01 11:15:48 -070096 "gson-prebuilt-jar",
97 "guice",
Oliver Nguyend15cc752018-11-02 15:44:45 -070098 "jacoco-cli",
Julien Desprez251ec572018-11-01 11:15:48 -070099 "jline-1.0",
Nan Zhangd4bde952018-07-18 16:58:43 -0700100 "junit",
101 "junit-params",
102 "kxml2-2.3.0",
Nan Zhangd4bde952018-07-18 16:58:43 -0700103 "libprotobuf-java-full",
Nan Zhangd4bde952018-07-18 16:58:43 -0700104 "longevity-host-lib",
gopinath515dd2e2018-10-25 15:47:37 -0700105 "perfetto_config-full",
Nan Zhangd4bde952018-07-18 16:58:43 -0700106 "platform-test-annotations",
Michael Rosenfeldb2440c32018-12-17 12:17:59 -0800107 "test-composers",
Julien Desprez251ec572018-11-01 11:15:48 -0700108 "tf-remote-client",
109 "tradefed-protos",
Nan Zhangd4bde952018-07-18 16:58:43 -0700110 ],
111 libs: [
112 "loganalysis",
Nan Zhangd4bde952018-07-18 16:58:43 -0700113 ],
114 manifest: "MANIFEST.mf",
115}
116
Tor Norbyee7484822018-12-26 15:03:01 -0800117// Turn off various doclava warnings when generating
118// the docs. These are the same warnings that are
119// turned off in frameworks/base, plus error 101
120// which is necessary here because tradefed is
121// referencing bootclasspath classes that are not
122// feed to metalava when generating the stubs.
123tradefed_docs_only_args = " -hide 101 -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 "
124
Nan Zhang8e4593b2018-09-18 21:07:24 -0700125droidstubs_host {
126 name: "tradefed-doc-stubs",
Nan Zhangd4bde952018-07-18 16:58:43 -0700127 srcs: [
128 "src/**/*.java",
129 ],
130 libs: [
131 "loganalysis",
132 "tradefed",
Nan Zhangd4bde952018-07-18 16:58:43 -0700133 ],
Tor Norbyee7484822018-12-26 15:03:01 -0800134 args: tradefed_docs_only_args + "--package",
Nan Zhang8e4593b2018-09-18 21:07:24 -0700135 create_doc_stubs: true,
136}
137
138droiddoc_host {
139 name: "tradefed-docs",
140 srcs: [
141 ":tradefed-doc-stubs",
142 ],
Tor Norbyee7484822018-12-26 15:03:01 -0800143 libs: [
144 "loganalysis",
145 "tradefed",
Tor Norbyee7484822018-12-26 15:03:01 -0800146 ],
Nan Zhangd4bde952018-07-18 16:58:43 -0700147 custom_template: "droiddoc-templates-sdk",
148 hdf: [
149 "sac true",
150 "devices true",
151 "android.whichdoc online",
152 "css.path /reference/assets/css/doclava-devsite.css",
153 "book.root toc",
154 "book.path /_book.yaml",
155 ],
Tor Norbyee7484822018-12-26 15:03:01 -0800156 args: tradefed_docs_only_args +
157 "-yaml _book.yaml " +
Nan Zhangd4bde952018-07-18 16:58:43 -0700158 "-apidocsdir reference/tradefed/ " +
159 "-werror " +
160 "-package " +
161 "-devsite ",
162 create_stubs: false,
163}