Andreas Gampe | d6c02c8 | 2018-05-14 10:52:06 -0700 | [diff] [blame] | 1 | // 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. |
| 17 | java_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 | |
| 48 | java_defaults { |
| 49 | name: "tradefed_defaults", |
| 50 | defaults: [ "tradefed_errorprone_defaults" ], |
| 51 | javacflags: [ |
| 52 | "-g", |
| 53 | "-Xlint", |
| 54 | ], |
| 55 | } |
| 56 | |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 57 | java_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 | |
| 72 | java_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 Zhang | bc2ca02 | 2018-07-23 17:46:34 -0700 | [diff] [blame] | 83 | "--add-modules=java.xml.bind", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 84 | ], |
| 85 | }, |
| 86 | static_libs: [ |
Daniel Peykov | e304789 | 2018-11-01 13:08:35 -0700 | [diff] [blame] | 87 | "aoa-helper", |
Julien Desprez | 251ec57 | 2018-11-01 11:15:48 -0700 | [diff] [blame] | 88 | "commons-compress-prebuilt", |
| 89 | "error_prone_annotations-2.0.18", |
| 90 | "google-api-java-client-min-repackaged", |
Julien Desprez | 512e39d | 2018-11-09 11:02:21 -0800 | [diff] [blame] | 91 | "google-api-services-compute", |
Julien Desprez | 251ec57 | 2018-11-01 11:15:48 -0700 | [diff] [blame] | 92 | "gson-prebuilt-jar", |
| 93 | "guice", |
| 94 | "jline-1.0", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 95 | "junit", |
| 96 | "junit-params", |
| 97 | "kxml2-2.3.0", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 98 | "libprotobuf-java-full", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 99 | "longevity-host-lib", |
gopinath | 515dd2e | 2018-10-25 15:47:37 -0700 | [diff] [blame] | 100 | "perfetto_config-full", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 101 | "platform-test-annotations", |
Julien Desprez | 251ec57 | 2018-11-01 11:15:48 -0700 | [diff] [blame] | 102 | "tf-remote-client", |
Julien Desprez | 97ee999 | 2018-11-01 16:17:36 -0700 | [diff] [blame] | 103 | "tradefed-grpc-lib-1.0.1", |
Julien Desprez | 251ec57 | 2018-11-01 11:15:48 -0700 | [diff] [blame] | 104 | "tradefed-protos", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 105 | ], |
| 106 | libs: [ |
| 107 | "loganalysis", |
| 108 | "tools-common-prebuilt", |
| 109 | ], |
| 110 | manifest: "MANIFEST.mf", |
| 111 | } |
| 112 | |
Julien Desprez | 97ee999 | 2018-11-01 16:17:36 -0700 | [diff] [blame] | 113 | // Use 1.0.1 version of GRPC to be compatible of current guava version |
| 114 | java_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 Thierer | 12dca90 | 2018-11-05 15:21:12 +0000 | [diff] [blame] | 123 | openjdk9: { |
| 124 | javacflags: [ |
| 125 | "--add-modules=java.xml.ws.annotation", |
Tobias Thierer | 7bcb280 | 2018-11-07 19:33:25 +0000 | [diff] [blame] | 126 | ], |
Tobias Thierer | 12dca90 | 2018-11-05 15:21:12 +0000 | [diff] [blame] | 127 | }, |
Julien Desprez | 97ee999 | 2018-11-01 16:17:36 -0700 | [diff] [blame] | 128 | 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 Zhang | 8e4593b | 2018-09-18 21:07:24 -0700 | [diff] [blame] | 145 | droidstubs_host { |
| 146 | name: "tradefed-doc-stubs", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 147 | srcs: [ |
| 148 | "src/**/*.java", |
| 149 | ], |
| 150 | libs: [ |
| 151 | "loganalysis", |
| 152 | "tradefed", |
| 153 | "tools-common-prebuilt", |
| 154 | ], |
Nan Zhang | 8e4593b | 2018-09-18 21:07:24 -0700 | [diff] [blame] | 155 | args: "--package", |
| 156 | create_doc_stubs: true, |
| 157 | } |
| 158 | |
| 159 | droiddoc_host { |
| 160 | name: "tradefed-docs", |
| 161 | srcs: [ |
| 162 | ":tradefed-doc-stubs", |
| 163 | ], |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 164 | 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 | } |