diff options
author | ksakamoto <ksakamoto@chromium.org> | 2015-05-07 18:46:04 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-08 01:46:41 +0000 |
commit | fdf00f9b7799fc8cee28e6b4053235cba3c15178 (patch) | |
tree | 8e7dce241d68cbebbb6af106f3bcab47c2d6a568 /remoting/webapp/build_template.gni | |
parent | a8f25a0aa7121af5cb727136019a92ee1d8383c3 (diff) | |
download | chromium_src-fdf00f9b7799fc8cee28e6b4053235cba3c15178.zip chromium_src-fdf00f9b7799fc8cee28e6b4053235cba3c15178.tar.gz chromium_src-fdf00f9b7799fc8cee28e6b4053235cba3c15178.tar.bz2 |
Revert of [Chromoting] Add GN build support for ar_sample_app target. (patchset #3 id:40001 of https://codereview.chromium.org/1126393002/)
Reason for revert:
Broke Linux GN Clobber build.
http://build.chromium.org/p/chromium.linux/builders/Linux%20GN%20Clobber/builds/49/steps/compile/logs/stdio
Original issue's description:
> [Chromoting] Add GN build support for ar_sample_app target.
>
> This adds GN build rules for the AppRemoting sample app.
> Some DesktopRemoting build rules were prettified as part of this
> process (to make the App- and Desktop- remoting build rules more
> similar).
>
> BUG=471916
>
> Committed: https://crrev.com/13a3ca1f8053b1b2d195b8f5f52b90e184287ea8
> Cr-Commit-Position: refs/heads/master@{#328871}
TBR=jamiewalch@chromium.org,garykac@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=471916
Review URL: https://codereview.chromium.org/1135603003
Cr-Commit-Position: refs/heads/master@{#328902}
Diffstat (limited to 'remoting/webapp/build_template.gni')
-rw-r--r-- | remoting/webapp/build_template.gni | 330 |
1 files changed, 26 insertions, 304 deletions
diff --git a/remoting/webapp/build_template.gni b/remoting/webapp/build_template.gni index 8930b04..5d4233c 100644 --- a/remoting/webapp/build_template.gni +++ b/remoting/webapp/build_template.gni @@ -15,24 +15,17 @@ import("//remoting/webapp/files.gni") # to this directory. remoting_dir = "//remoting" -buildtype = "Dev" -if (!is_debug) { - if (is_official_build) { - buildtype = "Official" - } else { - buildtype = "Release" - } -} - -template("build_locales_listfile") { - action(target_name) { - locales_listfile_output = invoker.locales_listfile_output +template("remoting_webapp") { + locales_listfile = target_name + "_locales" + listfile = "$target_gen_dir/${target_name}_locales.txt" + listfile_rel = rebase_path(listfile, root_build_dir) + action(locales_listfile) { script = "../tools/build/remoting_localize.py" inputs = [] outputs = [ - locales_listfile_output, + listfile, ] args = [ @@ -40,88 +33,10 @@ template("build_locales_listfile") { rebase_path(webapp_locale_dir, root_build_dir) + "/@{json_suffix}/messages.json", "--locales_listfile", - rebase_path(locales_listfile_output, root_build_dir), + listfile_rel, ] args += remoting_locales } -} - -template("build_webapp_html") { - action(target_name) { - html_template_file = invoker.html_template_file - html_template_files = invoker.html_template_files - js_files = invoker.js_files - html_output = invoker.html_output - - script = "build-html.py" - - inputs = [ html_template_file ] + html_template_files + js_files - - outputs = [ - html_output, - ] - - args = [ - rebase_path(html_output, root_build_dir), - rebase_path(html_template_file, root_build_dir), - ] - args += [ - "--template-dir", - rebase_path(remoting_dir, root_build_dir), - ] - args += [ "--templates" ] + html_template_files - args += [ "--js" ] + rebase_path(js_files, remoting_dir) - } -} - -template("desktop_remoting_webapp") { - locales_listfile = target_name + "_locales" - locales_listfile_output = "$target_gen_dir/${target_name}_locales.txt" - - build_locales_listfile(locales_listfile) { - # Template uses locales_listfile_output from outer scope. - } - - background_html = target_name + "_background_html" - background_html_output = "$target_gen_dir/html/$target_name/background.html" - - build_webapp_html(background_html) { - html_template_file = remoting_webapp_template_background - html_template_files = [] - js_files = remoting_webapp_background_html_all_js_files - html_output = background_html_output - } - - message_window_html = target_name + "_message_window_html" - message_window_html_output = - "$target_gen_dir/html/$target_name/message_window.html" - - build_webapp_html(message_window_html) { - html_template_file = remoting_webapp_template_message_window - html_template_files = [] - js_files = remoting_webapp_message_window_html_all_js_files - html_output = message_window_html_output - } - - wcs_sandbox_html = target_name + "_wcs_sandbox_html" - wcs_sandbox_html_output = "$target_gen_dir/html/$target_name/wcs_sandbox.html" - - build_webapp_html(wcs_sandbox_html) { - html_template_file = remoting_webapp_template_wcs_sandbox - html_template_files = [] - js_files = remoting_webapp_wcs_sandbox_html_all_js_files - html_output = wcs_sandbox_html_output - } - - main_html = target_name + "_main_html" - main_html_output = "$target_gen_dir/html/$target_name/main.html" - - build_webapp_html(main_html) { - html_template_file = remoting_webapp_template_main - html_template_files = remoting_webapp_template_files - js_files = remoting_webapp_crd_main_html_all_js_files - html_output = main_html_output - } action(target_name) { script = "build-webapp.py" @@ -131,37 +46,39 @@ template("desktop_remoting_webapp") { zip_path = invoker.zip_path extra_files = invoker.extra_files - inputs = - [ rebase_path("crd/manifest.json.jinja2", root_build_dir) ] + - remoting_version_files + - rebase_path(remoting_webapp_crd_files, root_build_dir) + extra_files - + inputs = [] outputs = [ "$target_gen_dir/$zip_path", ] deps = [ + ":html", ":$locales_listfile", - ":$background_html", - ":$message_window_html", - ":$wcs_sandbox_html", - ":$main_html", "//remoting/resources", ] - dr_generated_html_files = [ - background_html_output, - message_window_html_output, - wcs_sandbox_html_output, - main_html_output, + buildtype = "Dev" + if (!is_debug) { + if (is_official_build) { + buildtype = "Official" + } else { + buildtype = "Release" + } + } + + generated_html_files = [ + "$target_gen_dir/background.html", + "$target_gen_dir/main.html", + "$target_gen_dir/message_window.html", + "$target_gen_dir/wcs_sandbox.html", ] # Create a file that contains a list of all the resource files needed # to build the webapp. This is needed to avoid problems on platforms that # limit the size of a command line. - file_list = "$target_gen_dir/${target_name}_files.txt" + file_list = "$target_gen_dir/${target_name}_file_list.txt" files = [] - files += rebase_path(dr_generated_html_files, root_build_dir) + files += rebase_path(generated_html_files, root_build_dir) files += rebase_path(remoting_webapp_crd_files, root_build_dir) files += rebase_path(extra_files, root_build_dir) write_file(file_list, files) @@ -180,7 +97,7 @@ template("desktop_remoting_webapp") { ] args += [ "--locales_listfile", - rebase_path(locales_listfile_output, root_build_dir), + listfile_rel, ] args += [ "--use_gcd", @@ -188,198 +105,3 @@ template("desktop_remoting_webapp") { ] } } - -template("app_remoting_webapp") { - locales_listfile = target_name + "_locales" - locales_listfile_output = "$target_gen_dir/${target_name}_locales.txt" - - build_locales_listfile(locales_listfile) { - # Template uses locales_listfile_output from outer scope. - } - - feedback_consent_html = target_name + "_feedback_consent_html" - feedback_consent_html_output = - "$target_gen_dir/html/$target_name/feedback_consent.html" - - build_webapp_html(feedback_consent_html) { - html_template_file = ar_feedback_consent_template - html_template_files = [] - js_files = ar_feedback_consent_html_all_js_files - html_output = feedback_consent_html_output - } - - loading_window_html = target_name + "_loading_window_html" - loading_window_html_output = - "$target_gen_dir/html/$target_name/loading_window.html" - - build_webapp_html(loading_window_html) { - html_template_file = ar_loading_window_template - html_template_files = [] - - # The loading window is just a reskin of the message window -- all JS code - # is shared. - js_files = remoting_webapp_message_window_html_all_js_files - html_output = loading_window_html_output - } - - message_window_html = target_name + "_message_window_html" - message_window_html_output = - "$target_gen_dir/html/$target_name/message_window.html" - - build_webapp_html(message_window_html) { - html_template_file = remoting_webapp_template_message_window - html_template_files = [] - js_files = remoting_webapp_message_window_html_all_js_files - html_output = message_window_html_output - } - - wcs_sandbox_html = target_name + "_wcs_sandbox_html" - wcs_sandbox_html_output = "$target_gen_dir/html/$target_name/wcs_sandbox.html" - - build_webapp_html(wcs_sandbox_html) { - html_template_file = remoting_webapp_template_wcs_sandbox - html_template_files = [] - js_files = remoting_webapp_wcs_sandbox_html_all_js_files - html_output = wcs_sandbox_html_output - } - - main_html = target_name + "_main_html" - main_html_output = "$target_gen_dir/html/$target_name/main.html" - - build_webapp_html(main_html) { - html_template_file = ar_main_template - html_template_files = ar_main_template_files - js_files = ar_main_js_files - html_output = main_html_output - } - - action(target_name) { - script = "build-webapp.py" - - app_key = invoker.app_key - app_id = invoker.app_id - app_client_id = invoker.app_client_id - app_name = invoker.app_name - app_description = invoker.app_description - app_capabilities = invoker.app_capabilities - manifest_key = invoker.manifest_key - - # These asserts are so that these variables get marked as being used so - # that GN doesn't complain about them. - assert(app_key != "" || app_key == "") - assert(app_id != "" || app_id == "") - - # TODO(garykac) For internal targets, we need to extract the vendor and app - # name from the target. - ar_app_name = "sample_app" #target_name - ar_app_path = "app_remoting/apps/$ar_app_name" - ar_app_manifest = "$ar_app_path/manifest.json.jinja2" - ar_app_manifest_common = "app_remoting/manifest_common.json.jinja2" - - output_dir = "remoting/app_remoting/$ar_service_environment/$target_name" - zip_path = "remoting/app_remoting/$ar_service_environment/$target_name.zip" - - ar_app_specific_files = [ - "$ar_app_path/icon16.png", - "$ar_app_path/icon48.png", - "$ar_app_path/icon128.png", - "$ar_app_path/loading_splash.png", - ] - - ar_generated_html_files = [ - feedback_consent_html_output, - loading_window_html_output, - message_window_html_output, - wcs_sandbox_html_output, - main_html_output, - ] - - ar_webapp_files = - ar_app_specific_files + ar_shared_resource_files + ar_all_js_files - - inputs = [ - rebase_path(ar_app_manifest, root_build_dir), - rebase_path(ar_app_manifest_common, root_build_dir), - ] + remoting_version_files + ar_webapp_files - - outputs = [ - "$target_gen_dir/$zip_path", - ] - - deps = [ - ":$locales_listfile", - ":$feedback_consent_html", - ":$loading_window_html", - ":$message_window_html", - ":$wcs_sandbox_html", - ":$main_html", - "//remoting/resources", - ] - - # Create a file that contains a list of all the resource files needed - # to build the webapp. This is needed to avoid problems on platforms that - # limit the size of a command line. - file_list = "$target_gen_dir/${target_name}_files.txt" - files = [] - files += rebase_path(ar_generated_html_files, root_build_dir) - files += rebase_path(ar_webapp_files, root_build_dir) - write_file(file_list, files) - - args = [ - buildtype, - version_full, - output_dir, - zip_path, - rebase_path(ar_app_manifest, root_build_dir), - "app_remoting", # Web app type - ] - args += [ - "--files_listfile", - rebase_path(file_list, root_build_dir), - ] - args += [ - "--locales_listfile", - rebase_path(locales_listfile_output, root_build_dir), - ] - args += [ - "--jinja_paths", - rebase_path("app_remoting", root_build_dir), - ] - - if (is_debug) { - # Normally, the app-id for the orchestrator is automatically extracted - # from the webapp's extension id, but that approach doesn't work for - # dev webapp builds (since they all share the same dev extension id). - # The --appid arg will create a webapp that registers the given app-id - # rather than using the extension id. - # This is only done for Dev apps because the app-id for Release apps - # *must* match the extension id. - args += [ - "--appid", - app_id, - ] - } - - args += [ - "--app_name", - app_name, - ] - args += [ - "--app_description", - app_description, - ] - args += [ "--app_capabilities" ] + app_capabilities - args += [ - "--service_environment", - ar_service_environment, - ] - args += [ - "--manifest_key", - manifest_key, - ] - args += [ - "--app_client_id", - app_client_id, - ] - } -} |