Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions build/archives/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ if (build_engine_artifacts && !is_android) {
deps = [
"//flutter/flutter_frontend_server:frontend_server",
"//flutter/impeller/compiler:impellerc",
"//flutter/impeller/compiler:impellerc_license",
"//flutter/impeller/tessellator:tessellator_shared",
"//flutter/lib/snapshot:generate_snapshot_bin",
"//flutter/shell/testing:testing",
"//flutter/tools/path_ops:path_ops",
"//flutter/tools/path_ops:path_ops_license",
"//third_party/dart/runtime/bin:gen_snapshot",
]
if (is_mac) {
Expand Down Expand Up @@ -81,16 +79,6 @@ if (build_engine_artifacts && !is_android) {
source = "$root_out_dir/flutter_tester$exe"
destination = "flutter_tester$exe"
},
{
source =
"$root_out_dir/gen/flutter/impeller/compiler/LICENSE.impellerc.md"
destination = "LICENSE.impellerc.md"
},
{
source =
"$root_out_dir/gen/flutter/tools/path_ops/LICENSE.path_ops.md"
destination = "LICENSE.path_ops.md"
},
{
source = "$root_out_dir/impellerc$exe"
destination = "impellerc$exe"
Expand Down
28 changes: 26 additions & 2 deletions build/zip_bundle.gni
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# found in the LICENSE file.

import("//flutter/common/config.gni")
import("//flutter/shell/version/version.gni")

if (flutter_runtime_mode == "jit_release") {
android_zip_archive_dir = "android-$target_cpu-jit-release"
Expand Down Expand Up @@ -38,16 +39,39 @@ if (flutter_runtime_mode == "jit_release") {
template("zip_bundle") {
assert(defined(invoker.output), "output must be defined")
assert(defined(invoker.files), "files must be defined as a list of scopes")

license_readme = "$target_gen_dir/LICENSE.$target_name.md"
license_target = "_${target_name}_license_md"

generated_file(license_target) {
source_path = rebase_path(".", "//flutter")
license_path =
rebase_path("//flutter/sky/packages/sky_engine/LICENSE", "//flutter")
git_url = "https://github.com/flutter/engine/tree/$engine_version"
outputs = [ license_readme ]
contents = [
"# $target_name",
"",
"This bundle is part of the the Flutter SDK.",
"",
"The source code is hosted at [flutter/engine/$source_path]($git_url/$source_path).",
"The for this bundle is hosted at [flutter/engine/sky/packages/sky_engine/LICENSE]($git_url/$license_path).",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any way we can make this URL point to a file on the same host as the zip files are hosted?

My concern is that the lifetime of github.com and the lifetime of the host where we upload the zip files is not guaranteed to be correlated, so if we suddenly find github goes away and we have to move all the code, all these old files will no longer point to a license file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd have to modify the recipes to do that, but we could. @godofredoc WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think we can now control it from the build json.. I'll look into that tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've added a link to the sky_engine.zip location as well, which should have a full copy of the license.

]
}

action(target_name) {
script = "//flutter/build/zip.py"
outputs = [ "$root_build_dir/zip_archives/${invoker.output}" ]
sources = []
sources = [ license_readme ]
forward_variables_from(invoker, [ "visibility" ])
deps = invoker.deps
deps = [ ":$license_target" ] + invoker.deps

args = [
"-o",
rebase_path(outputs[0]),
"-i",
rebase_path(license_readme),
"LICENSE.md",
]
foreach(input, invoker.files) {
args += [
Expand Down
25 changes: 1 addition & 24 deletions impeller/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -72,26 +72,6 @@ impeller_component("compiler_lib") {
]
}

generated_file("impellerc_license") {
source_path = rebase_path(".", "//flutter")
git_url = "https://github.com/flutter/engine/tree/$engine_version"
outputs = [ "$target_gen_dir/LICENSE.impellerc.md" ]
contents = [
"# impellerc",
"",
"This tool is used by the Flutter SDK to compile shaders.",
"",
"Source code for this tool: [flutter/engine/$source_path]($git_url/$source_path).",
"",
"## Licenses",
"",
"### impellerc",
"",
read_file("//flutter/sky/packages/sky_engine/LICENSE", "string"),
"",
]
}

impeller_component("impellerc") {
target_type = "executable"

Expand All @@ -108,10 +88,7 @@ impeller_component("impellerc") {
}

group("compiler") {
deps = [
":impellerc",
":impellerc_license",
]
deps = [ ":impellerc" ]
}

impeller_component("compiler_unittests") {
Expand Down
22 changes: 0 additions & 22 deletions tools/font-subset/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# found in the LICENSE file.

import("//flutter/build/zip_bundle.gni")
import("//flutter/shell/version/version.gni")

executable("_font-subset") {
output_name = "font-subset"
Expand All @@ -28,22 +27,6 @@ executable("_font-subset") {
}
}

generated_file("_font-subset-license") {
source_path = rebase_path(".", "//flutter")
license_path =
rebase_path("//flutter/sky/packages/sky_engine/LICENSE", "//flutter")
git_url = "https://github.com/flutter/engine/tree/$engine_version"
outputs = [ "$target_gen_dir/LICENSE.font-subset.md" ]
contents = [
"# font-subset",
"",
"This tool is used by the Flutter SDK to tree shake icon fonts.",
"",
"Source code for this tool: [flutter/engine/$source_path]($git_url/$source_path).",
"License for this tool: [flutter/engine/sky/packages/sky_engine/LICENSE]($git_url/$license_path).",
]
}

generated_file("font_entitlement_config") {
outputs = [ "$target_gen_dir/font_subset_without_entitlements.txt" ]

Expand Down Expand Up @@ -75,15 +58,10 @@ zip_bundle("font-subset") {
source = "$root_gen_dir/const_finder.dart.snapshot"
destination = "const_finder.dart.snapshot"
},
{
source = "$target_gen_dir/LICENSE.font-subset.md"
destination = "LICENSE.font-subset.md"
},
]

deps = [
":_font-subset",
":_font-subset-license",
"//flutter/tools/const_finder",
]
if (is_mac) {
Expand Down
28 changes: 1 addition & 27 deletions tools/path_ops/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,12 @@

import("//flutter/shell/version/version.gni")

generated_file("path_ops_license") {
source_path = rebase_path(".", "//flutter")
git_url = "https://github.com/flutter/engine/tree/$engine_version"
outputs = [ "$target_gen_dir/LICENSE.path_ops.md" ]
contents = [
"# path_ops",
"",
"This tool is used by the vector_graphics library to calculate path intersections.",
"",
"Source code for this tool: [flutter/engine/$source_path]($git_url/$source_path).",
"",
"## Licenses",
"",
read_file("//flutter/sky/packages/sky_engine/LICENSE", "string"),
"",
"## Additional open source licenses",
"",
"### Skia",
"",
read_file("//third_party/skia/LICENSE", "string"),
]
}

shared_library("path_ops") {
sources = [
"path_ops.cc",
"path_ops.h",
]
deps = [
":path_ops_license",
"//third_party/skia",
]
deps = [ "//third_party/skia" ]

metadata = {
entitlement_file_path = [ "libpath_ops.dylib" ]
Expand Down