Update Android build files with license info
The downstream copy of SwiftShader in AOSP has license info changes:
https://android-review.googlesource.com/c/platform/external/swiftshader/+/1576044
This change cherry picks it into the upstream repo.
Also add natsu@ and schuffelen@ to OWNERS to retain their privileges
when we directly roll SwiftShader into AOSP.
Bug: skia:11901
Change-Id: Ibfba7640d0133740c38fc0f00d32fcb5e11f8a11
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/54148
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Commit-Queue: Nicolas Capens <nicolascapens@google.com>
diff --git a/Android.bp b/Android.bp
index 94c173e..62c46e1 100644
--- a/Android.bp
+++ b/Android.bp
@@ -14,6 +14,43 @@
// limitations under the License.
//
+package {
+ default_applicable_licenses: ["external_swiftshader_license"],
+}
+
+// Added automatically by a large-scale-change that took the approach of
+// 'apply every license found to every target'. While this makes sure we respect
+// every license restriction, it may not be entirely correct.
+//
+// e.g. GPL in an MIT project might only apply to the contrib/ directory.
+//
+// Please consider splitting the single license below into multiple licenses,
+// taking care not to lose any license_kind information, and overriding the
+// default license using the 'licenses: [...]' property on targets as needed.
+//
+// For unused files, consider creating a 'filegroup' with "//visibility:private"
+// to attach the license to, and including a comment whether the files may be
+// used in the current project.
+//
+// large-scale-change filtered out the below license kinds as false-positives:
+// SPDX-license-identifier-GPL
+// SPDX-license-identifier-GPL-3.0
+// http://go/android-license-faq
+license {
+ name: "external_swiftshader_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-Apache-2.0",
+ "SPDX-license-identifier-BSD",
+ "SPDX-license-identifier-MIT",
+ "SPDX-license-identifier-NCSA",
+ "legacy_unencumbered",
+ ],
+ license_text: [
+ "LICENSE.txt",
+ ],
+}
+
cc_defaults {
name: "swiftshader_common",
diff --git a/OWNERS b/OWNERS
index 352a699..096f9b0 100644
--- a/OWNERS
+++ b/OWNERS
@@ -13,3 +13,5 @@
chrisforbes@google.com
cwallez@google.com
amaiorano@google.com
+natsu@google.com
+schuffelen@google.com
\ No newline at end of file
diff --git a/src/Android.bp b/src/Android.bp
index a59cd4f..ed1b022 100644
--- a/src/Android.bp
+++ b/src/Android.bp
@@ -14,6 +14,15 @@
// limitations under the License.
//
+package {
+ // http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // the below license kinds from "external_swiftshader_license":
+ // SPDX-license-identifier-Apache-2.0
+ // SPDX-license-identifier-BSD
+ default_applicable_licenses: ["external_swiftshader_license"],
+}
+
cc_defaults {
name: "libswiftshader",
vendor: true,
diff --git a/third_party/SPIRV-Headers/Android.bp b/third_party/SPIRV-Headers/Android.bp
index 88bfc41..59e005d 100644
--- a/third_party/SPIRV-Headers/Android.bp
+++ b/third_party/SPIRV-Headers/Android.bp
@@ -14,6 +14,38 @@
// limitations under the License.
//
+package {
+ default_applicable_licenses: [
+ "external_swiftshader_third_party_SPIRV-Headers_license",
+ ],
+}
+
+// Added automatically by a large-scale-change that took the approach of
+// 'apply every license found to every target'. While this makes sure we respect
+// every license restriction, it may not be entirely correct.
+//
+// e.g. GPL in an MIT project might only apply to the contrib/ directory.
+//
+// Please consider splitting the single license below into multiple licenses,
+// taking care not to lose any license_kind information, and overriding the
+// default license using the 'licenses: [...]' property on targets as needed.
+//
+// For unused files, consider creating a 'filegroup' with "//visibility:private"
+// to attach the license to, and including a comment whether the files may be
+// used in the current project.
+// http://go/android-license-faq
+license {
+ name: "external_swiftshader_third_party_SPIRV-Headers_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-MIT",
+ "legacy_unencumbered",
+ ],
+ license_text: [
+ "LICENSE",
+ ],
+}
+
filegroup {
name: "swiftshader_spirv_headers_unified1_spirv.core.grammar.json",
srcs: ["include/spirv/unified1/spirv.core.grammar.json"],
diff --git a/third_party/SPIRV-Tools/Android.bp b/third_party/SPIRV-Tools/Android.bp
index baf94a2..80bde2f 100644
--- a/third_party/SPIRV-Tools/Android.bp
+++ b/third_party/SPIRV-Tools/Android.bp
@@ -22,6 +22,39 @@
// Find Python invocations.
// Use regex replacements to get "cmd:" lines below.
+package {
+ default_applicable_licenses: [
+ "external_swiftshader_third_party_SPIRV-Tools_license",
+ ],
+}
+
+// Added automatically by a large-scale-change that took the approach of
+// 'apply every license found to every target'. While this makes sure we respect
+// every license restriction, it may not be entirely correct.
+//
+// e.g. GPL in an MIT project might only apply to the contrib/ directory.
+//
+// Please consider splitting the single license below into multiple licenses,
+// taking care not to lose any license_kind information, and overriding the
+// default license using the 'licenses: [...]' property on targets as needed.
+//
+// For unused files, consider creating a 'filegroup' with "//visibility:private"
+// to attach the license to, and including a comment whether the files may be
+// used in the current project.
+// http://go/android-license-faq
+license {
+ name: "external_swiftshader_third_party_SPIRV-Tools_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-Apache-2.0",
+ "SPDX-license-identifier-BSD",
+ "SPDX-license-identifier-MIT",
+ ],
+ license_text: [
+ "LICENSE",
+ ],
+}
+
genrule {
name: "swiftshader_spvtools_generate_grammar_tables",
out: [
diff --git a/third_party/astc-encoder/Android.bp b/third_party/astc-encoder/Android.bp
index 25ad2a4..9139f28 100644
--- a/third_party/astc-encoder/Android.bp
+++ b/third_party/astc-encoder/Android.bp
@@ -14,6 +14,25 @@
// limitations under the License.
//
+package {
+ default_applicable_licenses: [
+ "external_swiftshader_third_party_astc-encoder_license",
+ ],
+}
+
+// Added automatically by a large-scale-change
+// http://go/android-license-faq
+license {
+ name: "external_swiftshader_third_party_astc-encoder_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-Apache-2.0",
+ ],
+ license_text: [
+ "LICENSE.txt",
+ ],
+}
+
cc_library_static {
name: "swiftshader_astc",
diff --git a/third_party/llvm-10.0/Android.bp b/third_party/llvm-10.0/Android.bp
index 034b147..e5d50a6 100644
--- a/third_party/llvm-10.0/Android.bp
+++ b/third_party/llvm-10.0/Android.bp
@@ -1,3 +1,15 @@
+package {
+ // http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // the below license kinds from "external_swiftshader_license":
+ // SPDX-license-identifier-Apache-2.0
+ // SPDX-license-identifier-BSD
+ // SPDX-license-identifier-MIT
+ // SPDX-license-identifier-NCSA
+ // legacy_unencumbered
+ default_applicable_licenses: ["external_swiftshader_license"],
+}
+
cc_defaults {
name: "libLLVM10_swiftshader_defaults",
diff --git a/third_party/llvm-subzero/Android.bp b/third_party/llvm-subzero/Android.bp
index f1646b7..bf70dc5 100644
--- a/third_party/llvm-subzero/Android.bp
+++ b/third_party/llvm-subzero/Android.bp
@@ -14,6 +14,41 @@
// limitations under the License.
//
+package {
+ default_applicable_licenses: [
+ "external_swiftshader_third_party_llvm-subzero_license",
+ ],
+}
+
+// Added automatically by a large-scale-change that took the approach of
+// 'apply every license found to every target'. While this makes sure we respect
+// every license restriction, it may not be entirely correct.
+//
+// e.g. GPL in an MIT project might only apply to the contrib/ directory.
+//
+// Please consider splitting the single license below into multiple licenses,
+// taking care not to lose any license_kind information, and overriding the
+// default license using the 'licenses: [...]' property on targets as needed.
+//
+// For unused files, consider creating a 'filegroup' with "//visibility:private"
+// to attach the license to, and including a comment whether the files may be
+// used in the current project.
+// http://go/android-license-faq
+license {
+ name: "external_swiftshader_third_party_llvm-subzero_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-Apache-2.0",
+ "SPDX-license-identifier-BSD",
+ "SPDX-license-identifier-MIT",
+ "SPDX-license-identifier-NCSA",
+ "legacy_unencumbered",
+ ],
+ license_text: [
+ "LICENSE.TXT",
+ ],
+}
+
cc_library_static {
name: "libLLVMSupport_subzero",
diff --git a/third_party/marl/Android.bp b/third_party/marl/Android.bp
index fab2122..9dd9d59 100644
--- a/third_party/marl/Android.bp
+++ b/third_party/marl/Android.bp
@@ -14,6 +14,25 @@
// limitations under the License.
//
+package {
+ default_applicable_licenses: [
+ "external_swiftshader_third_party_marl_license",
+ ],
+}
+
+// Added automatically by a large-scale-change
+// http://go/android-license-faq
+license {
+ name: "external_swiftshader_third_party_marl_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-Apache-2.0",
+ ],
+ license_text: [
+ "LICENSE",
+ ],
+}
+
cc_library_static {
name: "swiftshader_marl",
vendor_available: true,