• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2010 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_guava_license"],
17}
18
19// Added automatically by a large-scale-change that took the approach of
20// 'apply every license found to every target'. While this makes sure we respect
21// every license restriction, it may not be entirely correct.
22//
23// e.g. GPL in an MIT project might only apply to the contrib/ directory.
24//
25// Please consider splitting the single license below into multiple licenses,
26// taking care not to lose any license_kind information, and overriding the
27// default license using the 'licenses: [...]' property on targets as needed.
28//
29// For unused files, consider creating a 'fileGroup' with "//visibility:private"
30// to attach the license to, and including a comment whether the files may be
31// used in the current project.
32//
33// large-scale-change included anything that looked like it might be a license
34// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
35//
36// Please consider removing redundant or irrelevant files from 'license_text:'.
37// See: http://go/android-license-faq
38license {
39    name: "external_guava_license",
40    visibility: [":__subpackages__"],
41    license_kinds: [
42        "SPDX-license-identifier-Apache-2.0",
43        "SPDX-license-identifier-CC0-1.0",
44        "legacy_unencumbered",
45    ],
46    license_text: [
47        "COPYING",
48        "NOTICE",
49    ],
50}
51
52java_library {
53    name: "guava",
54    host_supported: true,
55    hostdex: true,
56    sdk_version: "core_current",
57    target: {
58        android: {
59            static_libs: ["guava-android"],
60        },
61        host: {
62            static_libs: ["guava-jre"],
63        },
64    },
65    apex_available: [
66        "//apex_available:platform",
67        "//apex_available:anyapex",
68    ],
69}
70
71java_library {
72    name: "guava-both",
73    host_supported: true,
74    sdk_version: "core_current",
75    srcs: ["futures/failureaccess/**/*.java"],
76    static_libs: ["jsr305"],
77    libs: [
78        "guava-android-annotation-stubs",
79        "error_prone_annotations",
80    ],
81    java_version: "1.8",
82}
83
84java_library_host {
85    name: "guava-jre",
86    srcs: ["guava/src/**/*.java"],
87    static_libs: ["guava-both"],
88    libs: [
89        "guava-android-annotation-stubs",
90        "error_prone_annotations",
91    ],
92    java_version: "1.8",
93}
94
95java_library_host {
96    name: "guava-testlib",
97    srcs: ["guava-testlib/src/**/*.java"],
98    libs: [
99         "error_prone_annotations",
100         "guava",
101         "guava-android-annotation-stubs",
102         "jsr305",
103         "junit",
104    ],
105    java_version: "1.8",
106}
107
108// Guava for Android can't compile against an Android bootclasspath, compile
109// it for the host and then use it on the device.  It uses reflection to
110// prevent calling into methods that don't exist on Android.
111java_library_host {
112    name: "guava-android-host",
113    srcs: ["android/guava/src/**/*.java"],
114    static_libs: ["guava-both"],
115    libs: [
116        "guava-android-annotation-stubs",
117        "error_prone_annotations",
118    ],
119    java_version: "1.8",
120}
121
122java_host_for_device {
123    name: "guava-android",
124    libs: ["guava-android-host"],
125}
126
127// Compatibility name for existing host modules
128java_library_host {
129    name: "guavalib",
130    static_libs: ["guava"],
131}
132
133// Compile dummy implementations of annotations used by guava but not
134// present in the Android tree.
135java_library {
136    name: "guava-android-annotation-stubs",
137    host_supported: true,
138    sdk_version: "core_current",
139    srcs: ["android-annotation-stubs/src/**/*.java"],
140}
141
142// Compile guava testlib
143java_library {
144    name: "guava-android-testlib",
145    srcs: ["android/guava-testlib/src/**/*.java"],
146    libs: [
147        "error_prone_annotations",
148        "guava-android",
149        "guava-android-annotation-stubs",
150        "junit",
151    ],
152}
153