-
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).", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 += [ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.