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 81java_library { 82 name: "truth-liteproto-extension", 83 host_supported: true, 84 srcs: ["extensions/liteproto/src/main/java/**/*.java"], 85 libs: [ 86 "auto_value_annotations", 87 "error_prone_annotations", 88 "guava-android-annotation-stubs", 89 "truth", 90 ], 91 static_libs: [ 92 "guava", 93 "libprotobuf-java-lite", 94 ], 95 sdk_version: "current", 96} 97 98java_library_host { 99 name: "truth-proto-extension", 100 srcs: ["extensions/proto/src/main/java/**/*.java"], 101 libs: [ 102 "auto_value_annotations", 103 "auto_value_memoized_extension_annotations", 104 "error_prone_annotations", 105 "guava-android-annotation-stubs", 106 "truth", 107 "truth-liteproto-extension", 108 ], 109 plugins: [ 110 "auto_oneof_plugin", 111 "auto_value_memoized_extension_plugin", 112 "auto_value_plugin", 113 ], 114 static_libs: [ 115 "guava", 116 "libprotobuf-java-full", 117 ], 118} 119