1// Copyright (C) 2017 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_visibility: ["//visibility:private"],
17    default_applicable_licenses: ["libcore_license"],
18}
19
20// Added automatically by a large-scale-change that took the approach of
21// 'apply every license found to every target'. While this makes sure we respect
22// every license restriction, it may not be entirely correct.
23//
24// e.g. GPL in an MIT project might only apply to the contrib/ directory.
25//
26// Please consider splitting the single license below into multiple licenses,
27// taking care not to lose any license_kind information, and overriding the
28// default license using the 'licenses: [...]' property on targets as needed.
29//
30// For unused files, consider creating a 'filegroup' with "//visibility:private"
31// to attach the license to, and including a comment whether the files may be
32// used in the current project.
33//
34// large-scale-change included anything that looked like it might be a license
35// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
36//
37// Please consider removing redundant or irrelevant files from 'license_text:'.
38// http://go/android-license-faq
39license {
40    name: "libcore_license",
41    visibility: [":__subpackages__"],
42    license_kinds: [
43        "SPDX-license-identifier-Apache-2.0",
44        "SPDX-license-identifier-BSD",
45        "SPDX-license-identifier-GPL",
46        "SPDX-license-identifier-GPL-2.0",
47        "SPDX-license-identifier-LGPL",
48        "SPDX-license-identifier-MIT",
49        "SPDX-license-identifier-OpenSSL",
50        "SPDX-license-identifier-Unicode-DFS",
51        "SPDX-license-identifier-W3C",
52        "legacy_unencumbered",
53    ],
54    license_text: [
55        "LICENSE",
56        "NOTICE",
57    ],
58}
59
60build = [
61    "JavaLibrary.bp",
62    "NativeCode.bp",
63]
64
65java_genrule {
66    name: "notices-for-stubs-jar",
67    tools: ["soong_zip"],
68    tool_files: [
69        "NOTICE",
70        "ojluni/NOTICE",
71    ],
72    cmd: "mkdir $(genDir)/NOTICES && " +
73        "cp -f $(location NOTICE) $(genDir)/NOTICES/libcore-NOTICE && " +
74        "cp -f $(location ojluni/NOTICE) $(genDir)/NOTICES/ojluni-NOTICE && " +
75        "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)/NOTICES",
76    out: ["notices-for-stubs.jar"],
77}
78