Skip to content

Commit

Permalink
[Chromoting] Add GN build support for ar_sample_app target.
Browse files Browse the repository at this point in the history
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).

This re-lands crrev.com/1126393002 without any additional changes
required. The issues with the GN clobber builds are fixed in
crrev.com/1137753002.

BUG=471916

Review URL: https://codereview.chromium.org/1135933002

Cr-Commit-Position: refs/heads/master@{#329206}
  • Loading branch information
garykac authored and Commit bot committed May 11, 2015
1 parent 42417f2 commit 581797d
Show file tree
Hide file tree
Showing 8 changed files with 450 additions and 137 deletions.
1 change: 1 addition & 0 deletions remoting/app_remoting_webapp.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@

'targets': [
{
# GN version: //remoting/webapp:ar_sample_app
# Sample AppRemoting app.
'target_name': 'ar_sample_app',
'app_key': 'Sample_App',
Expand Down
2 changes: 1 addition & 1 deletion remoting/app_remoting_webapp_build.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'app_remoting_webapp_files.gypi',
],

# GN version: See remoting/webapp/build_template.gni
'target_defaults': {
'type': 'none',

Expand Down Expand Up @@ -119,7 +120,6 @@
'<(ar_app_manifest_app)', # Manifest template
'app_remoting', # Web app type
'<@(ar_webapp_files)',
'<@(ar_generated_html_files)',
'--locales_listfile',
'<(ar_webapp_locales_listfile)',
'--jinja_paths',
Expand Down
8 changes: 4 additions & 4 deletions remoting/remoting_client.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@
}, # end of target 'remoting_client'

{
# GN version: //remoting/webapp:html
# GN version: See remoting/webapp/build_template.gni
'target_name': 'remoting_webapp_html',
'type': 'none',
'actions': [
{
# GN version: //remoting/webapp:main_html
'action_name': 'Build Remoting Webapp main.html',
'inputs': [
'webapp/build-html.py',
Expand All @@ -75,7 +74,6 @@
],
},
{
# GN version: //remoting/webapp:wcs_sandbox_html
'action_name': 'Build Remoting Webapp wcs_sandbox.html',
'inputs': [
'webapp/build-html.py',
Expand All @@ -92,7 +90,6 @@
],
},
{
# GN version: //remoting/webapp:background_html
'action_name': 'Build Remoting Webapp background.html',
'inputs': [
'webapp/build-html.py',
Expand Down Expand Up @@ -128,6 +125,7 @@
}, # end of target 'remoting_webapp_html'

{
# GN version: //remoting/webapp:webapp
'target_name': 'remoting_webapp',
'type': 'none',
'dependencies': [
Expand All @@ -143,6 +141,7 @@
}, # end of target 'remoting_webapp'

{
# GN version: //remoting/webapp:webapp_v1
'target_name': 'remoting_webapp_v1',
'type': 'none',
'variables': {
Expand All @@ -158,6 +157,7 @@
['disable_nacl==0 and disable_nacl_untrusted==0', {
'targets': [
{
# GN version: //remoting/webapp:webapp_v1
'target_name': 'remoting_webapp_v2',
'type': 'none',
'variables': {
Expand Down
14 changes: 7 additions & 7 deletions remoting/remoting_version.gni
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (is_chrome_branded) {

# Set these files as being input dependencies to the scripts, so the build will
# be re-run if the files change.
_script_deps = [
remoting_version_files = [
_remoting_version_abspath,
_chrome_version_abspath,
_remoting_branding_abspath,
Expand All @@ -35,7 +35,7 @@ version_major = exec_script(_version_py_abspath,
"-t \"@MAJOR@\"",
],
"value",
_script_deps)
remoting_version_files)

version_minor = exec_script(_version_py_abspath,
[
Expand All @@ -44,7 +44,7 @@ version_minor = exec_script(_version_py_abspath,
"-t \"@REMOTING_PATCH@\"",
],
"value",
_script_deps)
remoting_version_files)

version_short =
"${version_major}.${version_minor}." + exec_script(_version_py_abspath,
Expand All @@ -56,7 +56,7 @@ version_short =
"-t \"@BUILD@\"",
],
"value",
_script_deps)
remoting_version_files)

version_full = "${version_short}." + exec_script(_version_py_abspath,
[
Expand All @@ -67,7 +67,7 @@ version_full = "${version_short}." + exec_script(_version_py_abspath,
"-t \"@PATCH@\"",
],
"value",
_script_deps)
remoting_version_files)

prefpane_bundle_name = exec_script(_version_py_abspath,
[
Expand All @@ -76,7 +76,7 @@ prefpane_bundle_name = exec_script(_version_py_abspath,
"-t \"@MAC_PREFPANE_BUNDLE_NAME@\"",
],
"string",
_script_deps)
remoting_version_files)

host_bundle_name = exec_script(_version_py_abspath,
[
Expand All @@ -85,4 +85,4 @@ host_bundle_name = exec_script(_version_py_abspath,
"-t \"@MAC_HOST_BUNDLE_NAME@\"",
],
"string",
_script_deps)
remoting_version_files)
108 changes: 15 additions & 93 deletions remoting/webapp/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -10,116 +10,38 @@ import("//remoting/webapp/build_template.gni")
group("webapp") {
deps = [
":webapp_v1",
":ar_sample_app",
]

if (enable_nacl) {
deps += [ ":webapp_v2" ]
}
}

remoting_webapp("webapp_v1") {
desktop_remoting_webapp("webapp_v1") {
webapp_type = "v1"
output_dir = "remoting.webapp"
zip_path = "remoting-webapp.zip"
output_dir = "remoting/remoting-webapp"
zip_path = "remoting/remoting-webapp.zip"
extra_files = []
}

remoting_webapp("webapp_v2") {
desktop_remoting_webapp("webapp_v2") {
webapp_type = "v2_pnacl"
output_dir = "remoting.webapp.v2"
zip_path = "remoting-webapp.v2.zip"
output_dir = "remoting/remoting-webapp.v2"
zip_path = "remoting/remoting-webapp.v2.zip"
extra_files = [
"crd/remoting_client_pnacl.nmf.jinja2",
# TODO(garykac): Get correct path to this.
#"<(PRODUCT_DIR)/remoting_client_plugin_newlib.pexe",
]
}

group("html") {
deps = [
":background_html",
":main_html",
":message_window_html",
":wcs_sandbox_html",
]
}

action("main_html") {
script = "build-html.py"

inputs = [ remoting_webapp_template_main ] + remoting_webapp_template_files +
remoting_webapp_crd_main_html_all_js_files

outputs = [
"$target_gen_dir/main.html",
]

args = [
rebase_path("$target_gen_dir/main.html", root_build_dir),
rebase_path(remoting_webapp_template_main, root_build_dir),
]
args += [
"--template-dir",
rebase_path(remoting_dir, root_build_dir),
]
args += [ "--templates" ] +
rebase_path(remoting_webapp_template_files, remoting_dir)
args += [ "--js" ] +
rebase_path(remoting_webapp_crd_main_html_all_js_files, remoting_dir)
}

action("wcs_sandbox_html") {
script = "build-html.py"

inputs = [ remoting_webapp_template_wcs_sandbox ] +
remoting_webapp_wcs_sandbox_html_all_js_files

outputs = [
"$target_gen_dir/wcs_sandbox.html",
]

args = [
rebase_path("$target_gen_dir/wcs_sandbox.html", root_build_dir),
rebase_path(remoting_webapp_template_wcs_sandbox, root_build_dir),
]
args +=
[ "--js" ] +
rebase_path(remoting_webapp_wcs_sandbox_html_all_js_files, remoting_dir)
}

action("background_html") {
script = "build-html.py"

inputs = [ remoting_webapp_template_background ] +
remoting_webapp_background_html_all_js_files

outputs = [
"$target_gen_dir/background.html",
]

args = [
rebase_path("$target_gen_dir/background.html", root_build_dir),
rebase_path(remoting_webapp_template_background, root_build_dir),
]
args += [ "--js" ] + rebase_path(remoting_webapp_background_html_all_js_files,
remoting_dir)
}

action("message_window_html") {
script = "build-html.py"

inputs = [ remoting_webapp_template_message_window ] +
remoting_webapp_message_window_html_all_js_files

outputs = [
"$target_gen_dir/message_window.html",
]

args = [
rebase_path("$target_gen_dir/message_window.html", root_build_dir),
rebase_path(remoting_webapp_template_message_window, root_build_dir),
]
args +=
[ "--js" ] + rebase_path(remoting_webapp_message_window_html_all_js_files,
remoting_dir)
app_remoting_webapp("ar_sample_app") {
app_key = "Sample_App"
app_id = "ljacajndfccfgnfohlgkdphmbnpkjflk"
app_client_id = "sample_client_id"
app_name = "App Remoting Client"
app_description = "App Remoting client"
app_capabilities = [ "GOOGLE_DRIVE" ]
manifest_key = "remotingdevbuild"
}
2 changes: 1 addition & 1 deletion remoting/webapp/build-webapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def buildWebApp(buildtype, version, destination, zip_path,
raise
else:
pass
os.mkdir(destination, 0775)
os.makedirs(destination, 0775)

if buildtype != 'Official' and buildtype != 'Release' and buildtype != 'Dev':
raise Exception('Unknown buildtype: ' + buildtype)
Expand Down
Loading

0 comments on commit 581797d

Please sign in to comment.