blob: d8cd0e04dfa000f56c366af9d6ecf0aa27c0dc8b [file] [log] [blame]
// Copyright 2018 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Set of error prone rules to ensure code quality
// PackageLocation check requires the androidCompatible=false otherwise it does not do anything.
java_defaults {
name: "tradefed_errorprone_defaults",
errorprone: {
javacflags: [
"-XDandroidCompatible=false",
"-Xep:ArrayToString:ERROR",
"-Xep:BoxedPrimitiveConstructor:ERROR",
"-Xep:CatchFail:ERROR",
"-Xep:ConstantField:ERROR",
"-Xep:DeadException:ERROR",
"-Xep:EqualsIncompatibleType:ERROR",
"-Xep:ExtendingJUnitAssert:ERROR",
"-Xep:FormatString:ERROR",
"-Xep:GetClassOnClass:ERROR",
"-Xep:IdentityBinaryExpression:ERROR",
"-Xep:JUnit3TestNotRun:ERROR",
"-Xep:JUnit4TestNotRun:ERROR",
"-Xep:JUnit4ClassUsedInJUnit3:ERROR",
"-Xep:JUnitAmbiguousTestClass:ERROR",
"-Xep:MissingFail:ERROR",
"-Xep:MissingOverride:ERROR",
"-Xep:ModifiedButNotUsed:ERROR",
"-Xep:MustBeClosedChecker:ERROR",
"-Xep:Overrides:ERROR",
"-Xep:PackageLocation:ERROR",
"-Xep:ParameterName:ERROR",
"-Xep:ReferenceEquality:ERROR",
"-Xep:RemoveUnusedImports:ERROR",
"-Xep:ReturnValueIgnored:ERROR",
"-Xep:SelfEquals:ERROR",
"-Xep:SizeGreaterThanOrEqualsZero:ERROR",
"-Xep:TryFailThrowable:ERROR",
"-Xep:UnnecessaryParentheses:ERROR",
"-Xep:UseCorrectAssertInTests:ERROR",
],
},
}
java_defaults {
name: "tradefed_defaults",
defaults: [ "tradefed_errorprone_defaults" ],
javacflags: [
"-g",
"-Xlint",
],
}
java_library_host {
name: "tradefed-protos",
srcs: ["proto/**/*.proto"],
libs: [
"libprotobuf-java-full",
],
proto: {
include_dirs: ["external/protobuf/src"],
type: "full",
},
static_libs: [
"platformprotos",
"asuite_proto_java",
],
}
// Main Target to build tradefed jar
java_library_host {
name: "tradefed",
defaults: ["tradefed_defaults"],
java_resource_dirs: [
"res",
],
static_libs: [
"tradefed-lib-core",
"tradefed-test-framework",
],
manifest: "MANIFEST.mf",
}
java_library_host {
name: "tradefed-lib-core",
defaults: ["tradefed_defaults"],
srcs: [
"src/**/*.java",
"global_configuration/**/*.java",
],
static_libs: [
"tradefed-common-util",
"tradefed-clearcut-client",
"tradefed-result-interfaces",
"tradefed-device-build-interfaces",
"tradefed-invocation-interfaces",
"protobuf-java-util-prebuilt-jar",
"aoa-helper",
"error_prone_annotations-2.0.18",
"google-api-java-client-min-repackaged",
"google-api-services-compute",
"google-api-services-storage",
"gson-prebuilt-jar",
"guice",
"jacoco-cli",
"jline-1.0",
"junit-params",
"kxml2-2.3.0",
"libprotobuf-java-full",
"platform-test-annotations",
"tf-remote-client",
"tradefed-protos",
"tradefed-isolation-protos",
"tradefed-lite",
],
libs: [
"loganalysis",
],
}
// Turn off various doclava warnings when generating
// the docs. These are the same warnings that are
// turned off in frameworks/base, plus error 101
// which is necessary here because tradefed is
// referencing bootclasspath classes that are not
// feed to metalava when generating the stubs.
tradefed_docs_only_args = " -hide 101 -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 "
droidstubs_host {
name: "tradefed-doc-stubs",
srcs: [
"src/**/*.java",
],
libs: [
"loganalysis",
"tradefed",
],
args: tradefed_docs_only_args + "--package",
create_doc_stubs: true,
}
droiddoc_host {
name: "tradefed-docs",
srcs: [
":tradefed-doc-stubs",
],
libs: [
"loganalysis",
"tradefed",
],
custom_template: "droiddoc-templates-sdk",
hdf: [
"sac true",
"devices true",
"android.whichdoc online",
"css.path /reference/assets/css/doclava-devsite.css",
"book.root toc",
"book.path /_book.yaml",
],
args: tradefed_docs_only_args +
"-yaml _book.yaml " +
"-apidocsdir reference/tradefed/ " +
"-werror " +
"-package " +
"-devsite ",
create_stubs: false,
}
sh_binary_host {
name: "tradefed.sh",
src: "tradefed.sh",
}
sh_binary_host {
name: "tradefed_win",
src: "tradefed_win.bat",
}
sh_binary_host {
name: "script_help.sh",
src: "script_help.sh",
}
sh_binary_host {
name: "run_tf_cmd.sh",
src: "run_tf_cmd.sh",
}
sh_binary_host {
name: "atest_tradefed.sh",
src: "atest_tradefed.sh",
}