-
Notifications
You must be signed in to change notification settings - Fork 6k
Embed a license readme in every zip archive #43974
Changes from 2 commits
938b09f
f313352
2d03346
4cf3037
91a182a
827eda9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" | ||
|
|
@@ -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).", | ||
|
||
| ] | ||
| } | ||
|
|
||
| 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 += [ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.