diff options
author | 2017-11-29 11:42:33 -0500 | |
---|---|---|
committer | 2017-11-29 17:06:25 +0000 | |
commit | 329c5a6d826b7b90e5e75ec0a7824c75ed5f8077 (patch) | |
tree | cdc91f8575ad0f6b210d3df484bacdf439320dec /BUILD.gn | |
parent | 19ea45ef538b0cbcd2088e85fa7e88384d6932e3 (diff) |
Bundle resources and skps directories into iOS app.
Will bundle resources/ for viewer (and skps/ if
that directory exists in the main Skia directory).
Also updates file code on iOS to fall back to bundle directory.
Docs-Preview: https://skia.org/?cl=76803
Bug: skia:7339
Change-Id: I244f67559c866451a6d02c3f1c4948d89457ec84
Reviewed-on: https://skia-review.googlesource.com/76803
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'BUILD.gn')
-rw-r--r-- | BUILD.gn | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -983,6 +983,37 @@ if (skia_enable_tools) { ] } + bundle_ios_data = + defined(invoker.bundle_ios_data) && invoker.bundle_ios_data + + if (bundle_ios_data) { + has_skps = + "True" == exec_script("//gn/checkdir.py", + [ rebase_path("skps", root_build_dir) ], + "trim string") + bundle_data("${app_name}_bundle_resources") { + sources = [ + "resources", + ] + outputs = [ + # iOS reserves the folders 'Resources' and 'resources' so store one level deeper + "{{bundle_resources_dir}}/data/resources", + ] + } + + if (has_skps) { + bundle_data("${app_name}_bundle_skps") { + sources = [ + "skps", + ] + outputs = [ + # Store in same folder as resources + "{{bundle_resources_dir}}/data/skps", + ] + } + } + } + executable("${app_name}_generate_executable") { forward_variables_from(invoker, "*", @@ -1022,6 +1053,12 @@ if (skia_enable_tools) { ":${app_name}_bundle_executable", ":${app_name}_bundle_info_plist", ] + if (bundle_ios_data) { + deps += [ ":${app_name}_bundle_resources" ] + if (has_skps) { + deps += [ ":${app_name}_bundle_skps" ] + } + } # should only code sign when running on a device, not the simulator if (target_cpu != "x64") { @@ -1747,6 +1784,9 @@ if (skia_enable_tools) { if (skia_enable_gpu) { test_app("viewer") { is_shared_library = is_android + if (is_ios) { + bundle_ios_data = true + } sources = [ "tools/viewer/GMSlide.cpp", "tools/viewer/ImageSlide.cpp", |