1// Copyright (C) 2022 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 15package { 16 default_applicable_licenses: ["external_truth_license"], 17} 18 19license { 20 name: "external_truth_license", 21 visibility: [":__subpackages__"], 22 license_kinds: [ 23 "SPDX-license-identifier-Apache-2.0", 24 ], 25 license_text: [ 26 "LICENSE", 27 ], 28} 29 30java_library { 31 name: "truth", 32 host_supported: true, 33 srcs: ["core/src/main/java/com/google/common/truth/*.java"], 34 libs: [ 35 "auto_value_annotations", 36 "error_prone_annotations", 37 "guava-android-annotation-stubs", 38 "junit", 39 ], 40 static_libs: [ 41 "guava", 42 ], 43 plugins: ["auto_value_plugin"], 44 sdk_version: "current", 45 // Exclude the functionality that requires bytecode analysis on the device. 46 // Android does not use standard Java .class files. 47 target: { 48 android: { 49 exclude_srcs: ["core/src/main/java/com/google/common/truth/ActualValueInference.java"], 50 }, 51 host: { 52 static_libs: ["ow2-asm"], 53 }, 54 }, 55 // b/267831518: Pin tradefed and dependencies to Java 11. 56 java_version: "11", 57 errorprone: { 58 javacflags: [ 59 "-Xep:NoCanIgnoreReturnValueOnClasses:WARN", 60 ], 61 }, 62} 63 64java_library { 65 name: "truth-java8-extension", 66 host_supported: true, 67 srcs: ["extensions/java8/src/main/java/**/*.java"], 68 libs: [ 69 "auto_value_annotations", 70 "error_prone_annotations", 71 "guava-android-annotation-stubs", 72 "truth", 73 ], 74 static_libs: [ 75 "guava", 76 ], 77 java_version: "1.8", 78 sdk_version: "current", 79} 80 81 82java_library { 83 name: "truth-liteproto-extension", 84 host_supported: true, 85 srcs: ["extensions/liteproto/src/main/java/**/*.java"], 86 libs: [ 87 "auto_value_annotations", 88 "error_prone_annotations", 89 "guava-android-annotation-stubs", 90 "truth", 91 ], 92 static_libs: [ 93 "guava", 94 "libprotobuf-java-lite", 95 ], 96 sdk_version: "current", 97} 98