xref: /aosp_15_r20/libcore/Android.bp (revision 89a6322812dc8573315e60046e7959c50dad91d4)
1*89a63228SAndroid Build Coastguard Worker// Copyright (C) 2017 The Android Open Source Project
2*89a63228SAndroid Build Coastguard Worker//
3*89a63228SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License");
4*89a63228SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License.
5*89a63228SAndroid Build Coastguard Worker// You may obtain a copy of the License at
6*89a63228SAndroid Build Coastguard Worker//
7*89a63228SAndroid Build Coastguard Worker//      http://www.apache.org/licenses/LICENSE-2.0
8*89a63228SAndroid Build Coastguard Worker//
9*89a63228SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software
10*89a63228SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS,
11*89a63228SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*89a63228SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and
13*89a63228SAndroid Build Coastguard Worker// limitations under the License.
14*89a63228SAndroid Build Coastguard Worker
15*89a63228SAndroid Build Coastguard Workerpackage {
16*89a63228SAndroid Build Coastguard Worker    default_visibility: [":__subpackages__"],
17*89a63228SAndroid Build Coastguard Worker    default_applicable_licenses: ["libcore_license"],
18*89a63228SAndroid Build Coastguard Worker    default_team: "trendy_team_java_core_libraries",
19*89a63228SAndroid Build Coastguard Worker}
20*89a63228SAndroid Build Coastguard Worker
21*89a63228SAndroid Build Coastguard Worker// Added automatically by a large-scale-change that took the approach of
22*89a63228SAndroid Build Coastguard Worker// 'apply every license found to every target'. While this makes sure we respect
23*89a63228SAndroid Build Coastguard Worker// every license restriction, it may not be entirely correct.
24*89a63228SAndroid Build Coastguard Worker//
25*89a63228SAndroid Build Coastguard Worker// e.g. GPL in an MIT project might only apply to the contrib/ directory.
26*89a63228SAndroid Build Coastguard Worker//
27*89a63228SAndroid Build Coastguard Worker// Please consider splitting the single license below into multiple licenses,
28*89a63228SAndroid Build Coastguard Worker// taking care not to lose any license_kind information, and overriding the
29*89a63228SAndroid Build Coastguard Worker// default license using the 'licenses: [...]' property on targets as needed.
30*89a63228SAndroid Build Coastguard Worker//
31*89a63228SAndroid Build Coastguard Worker// For unused files, consider creating a 'filegroup' with "//visibility:private"
32*89a63228SAndroid Build Coastguard Worker// to attach the license to, and including a comment whether the files may be
33*89a63228SAndroid Build Coastguard Worker// used in the current project.
34*89a63228SAndroid Build Coastguard Worker//
35*89a63228SAndroid Build Coastguard Worker// large-scale-change included anything that looked like it might be a license
36*89a63228SAndroid Build Coastguard Worker// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
37*89a63228SAndroid Build Coastguard Worker//
38*89a63228SAndroid Build Coastguard Worker// Please consider removing redundant or irrelevant files from 'license_text:'.
39*89a63228SAndroid Build Coastguard Worker// http://go/android-license-faq
40*89a63228SAndroid Build Coastguard Workerlicense {
41*89a63228SAndroid Build Coastguard Worker    name: "libcore_license",
42*89a63228SAndroid Build Coastguard Worker    visibility: [":__subpackages__"],
43*89a63228SAndroid Build Coastguard Worker    license_kinds: [
44*89a63228SAndroid Build Coastguard Worker        "SPDX-license-identifier-Apache-2.0",
45*89a63228SAndroid Build Coastguard Worker        "SPDX-license-identifier-BSD",
46*89a63228SAndroid Build Coastguard Worker        "SPDX-license-identifier-GPL-2.0-with-classpath-exception",
47*89a63228SAndroid Build Coastguard Worker        "SPDX-license-identifier-MIT",
48*89a63228SAndroid Build Coastguard Worker        "SPDX-license-identifier-OpenSSL",
49*89a63228SAndroid Build Coastguard Worker        "SPDX-license-identifier-Unicode-DFS",
50*89a63228SAndroid Build Coastguard Worker        "SPDX-license-identifier-W3C",
51*89a63228SAndroid Build Coastguard Worker        "legacy_unencumbered",
52*89a63228SAndroid Build Coastguard Worker    ],
53*89a63228SAndroid Build Coastguard Worker    license_text: [
54*89a63228SAndroid Build Coastguard Worker        "LICENSE",
55*89a63228SAndroid Build Coastguard Worker        "NOTICE",
56*89a63228SAndroid Build Coastguard Worker        "ojluni/src/main/NOTICE",
57*89a63228SAndroid Build Coastguard Worker    ],
58*89a63228SAndroid Build Coastguard Worker}
59*89a63228SAndroid Build Coastguard Worker
60*89a63228SAndroid Build Coastguard Workerbuild = [
61*89a63228SAndroid Build Coastguard Worker    "JavaLibrary.bp",
62*89a63228SAndroid Build Coastguard Worker    "NativeCode.bp",
63*89a63228SAndroid Build Coastguard Worker    "Extras.bp",
64*89a63228SAndroid Build Coastguard Worker]
65*89a63228SAndroid Build Coastguard Worker
66*89a63228SAndroid Build Coastguard Workergen_notice {
67*89a63228SAndroid Build Coastguard Worker    name: "libcore-library-notices",
68*89a63228SAndroid Build Coastguard Worker    for: [
69*89a63228SAndroid Build Coastguard Worker        "core-oj",
70*89a63228SAndroid Build Coastguard Worker        "core-libart",
71*89a63228SAndroid Build Coastguard Worker    ],
72*89a63228SAndroid Build Coastguard Worker    stem: "libcore-NOTICES",
73*89a63228SAndroid Build Coastguard Worker    suffix: ".txt",
74*89a63228SAndroid Build Coastguard Worker}
75*89a63228SAndroid Build Coastguard Worker
76*89a63228SAndroid Build Coastguard Workerjava_genrule {
77*89a63228SAndroid Build Coastguard Worker    name: "notices-for-stubs-jar",
78*89a63228SAndroid Build Coastguard Worker    tools: ["soong_zip"],
79*89a63228SAndroid Build Coastguard Worker    srcs: [":libcore-library-notices"],
80*89a63228SAndroid Build Coastguard Worker    cmd: "mkdir $(genDir)/NOTICES && " +
81*89a63228SAndroid Build Coastguard Worker        "cp -f $(in) $(genDir)/NOTICES && " +
82*89a63228SAndroid Build Coastguard Worker        "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)/NOTICES",
83*89a63228SAndroid Build Coastguard Worker    out: ["notices-for-stubs.jar"],
84*89a63228SAndroid Build Coastguard Worker    write_if_changed: true,
85*89a63228SAndroid Build Coastguard Worker}
86