| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # Keep in sync with 'remoting_webapp' target in remoting/remoting_client.gypi. | 5 # Keep in sync with 'remoting_webapp' target in remoting/remoting_client.gypi. |
| 6 | 6 |
| 7 import("//build/config/chrome_build.gni") | 7 import("//build/config/chrome_build.gni") |
| 8 import("//remoting/remoting_locales.gni") | 8 import("//remoting/remoting_locales.gni") |
| 9 import("//remoting/remoting_options.gni") | 9 import("//remoting/remoting_options.gni") |
| 10 import("//remoting/remoting_version.gni") | 10 import("//remoting/remoting_version.gni") |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 args += rebase_path(js_files, root_build_dir) | 72 args += rebase_path(js_files, root_build_dir) |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 action(target_name) { | 76 action(target_name) { |
| 77 html_template_file = invoker.html_template_file | 77 html_template_file = invoker.html_template_file |
| 78 html_template_include_files = invoker.html_template_include_files | 78 html_template_include_files = invoker.html_template_include_files |
| 79 js_files = invoker.js_files | 79 js_files = invoker.js_files |
| 80 html_output = invoker.html_output | 80 html_output = invoker.html_output |
| 81 | 81 |
| 82 script = rebase_path("//remoting/webapp/build-html.py", root_build_dir) | 82 script = "build-html.py" |
| 83 | 83 |
| 84 inputs = [ html_template_file ] + html_template_include_files + js_files | 84 inputs = [ html_template_file ] + html_template_include_files + js_files |
| 85 | 85 |
| 86 outputs = [ | 86 outputs = [ |
| 87 html_output, | 87 html_output, |
| 88 ] | 88 ] |
| 89 | 89 |
| 90 if (target_jscompile != "") { | 90 if (target_jscompile != "") { |
| 91 deps = [ | 91 deps = [ |
| 92 ":$target_jscompile", | 92 ":$target_jscompile", |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 main_html_output = "$target_gen_dir/html/$target_name/main.html" | 149 main_html_output = "$target_gen_dir/html/$target_name/main.html" |
| 150 | 150 |
| 151 build_webapp_html(main_html) { | 151 build_webapp_html(main_html) { |
| 152 html_template_file = remoting_webapp_template_main | 152 html_template_file = remoting_webapp_template_main |
| 153 html_template_include_files = remoting_webapp_template_files | 153 html_template_include_files = remoting_webapp_template_files |
| 154 js_files = remoting_webapp_crd_main_html_all_js_files | 154 js_files = remoting_webapp_crd_main_html_all_js_files |
| 155 html_output = main_html_output | 155 html_output = main_html_output |
| 156 } | 156 } |
| 157 | 157 |
| 158 action(target_name) { | 158 action(target_name) { |
| 159 script = "//remoting/webapp/build-webapp.py" | 159 script = "build-webapp.py" |
| 160 | 160 |
| 161 webapp_type = invoker.webapp_type | 161 webapp_type = invoker.webapp_type |
| 162 output_dir = invoker.output_dir | 162 output_dir = invoker.output_dir |
| 163 zip_path = invoker.zip_path | 163 zip_path = invoker.zip_path |
| 164 extra_files = invoker.extra_files | 164 extra_files = invoker.extra_files |
| 165 | 165 |
| 166 inputs = | 166 inputs = |
| 167 [ rebase_path("crd/manifest.json.jinja2", root_build_dir) ] + | 167 [ rebase_path("crd/manifest.json.jinja2", root_build_dir) ] + |
| 168 remoting_version_files + | 168 remoting_version_files + |
| 169 rebase_path(remoting_webapp_crd_files, root_build_dir) + extra_files | 169 rebase_path(remoting_webapp_crd_files, root_build_dir) + extra_files |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 "$remoting_use_gcd", | 219 "$remoting_use_gcd", |
| 220 ] | 220 ] |
| 221 } | 221 } |
| 222 } | 222 } |
| 223 | 223 |
| 224 template("app_remoting_webapp") { | 224 template("app_remoting_webapp") { |
| 225 locales_listfile = target_name + "_locales" | 225 locales_listfile = target_name + "_locales" |
| 226 locales_listfile_output = "$target_gen_dir/${target_name}_locales.txt" | 226 locales_listfile_output = "$target_gen_dir/${target_name}_locales.txt" |
| 227 | 227 |
| 228 build_locales_listfile(locales_listfile) { | 228 build_locales_listfile(locales_listfile) { |
| 229 # TODO(garykac) Replace resources with empty stub rather than duplicating | |
| 230 # all the resources needed by the shared module. | |
| 231 # Template uses locales_listfile_output from outer scope. | 229 # Template uses locales_listfile_output from outer scope. |
| 232 } | 230 } |
| 233 | 231 |
| 232 feedback_consent_html = target_name + "_feedback_consent_html" |
| 233 feedback_consent_html_output = |
| 234 "$target_gen_dir/html/$target_name/feedback_consent.html" |
| 235 |
| 236 build_webapp_html(feedback_consent_html) { |
| 237 html_template_file = ar_feedback_consent_template |
| 238 html_template_include_files = [] |
| 239 js_files = ar_feedback_consent_html_all_js_files |
| 240 html_output = feedback_consent_html_output |
| 241 } |
| 242 |
| 243 loading_window_html = target_name + "_loading_window_html" |
| 244 loading_window_html_output = |
| 245 "$target_gen_dir/html/$target_name/loading_window.html" |
| 246 |
| 247 build_webapp_html(loading_window_html) { |
| 248 html_template_file = ar_loading_window_template |
| 249 html_template_include_files = [] |
| 250 |
| 251 # The loading window is just a reskin of the message window -- all JS code |
| 252 # is shared. |
| 253 js_files = remoting_webapp_message_window_html_all_js_files |
| 254 html_output = loading_window_html_output |
| 255 } |
| 256 |
| 257 message_window_html = target_name + "_message_window_html" |
| 258 message_window_html_output = |
| 259 "$target_gen_dir/html/$target_name/message_window.html" |
| 260 |
| 261 build_webapp_html(message_window_html) { |
| 262 html_template_file = remoting_webapp_template_message_window |
| 263 html_template_include_files = [] |
| 264 js_files = remoting_webapp_message_window_html_all_js_files |
| 265 html_output = message_window_html_output |
| 266 } |
| 267 |
| 268 wcs_sandbox_html = target_name + "_wcs_sandbox_html" |
| 269 wcs_sandbox_html_output = "$target_gen_dir/html/$target_name/wcs_sandbox.html" |
| 270 |
| 271 build_webapp_html(wcs_sandbox_html) { |
| 272 html_template_file = remoting_webapp_template_wcs_sandbox |
| 273 html_template_include_files = [] |
| 274 js_files = remoting_webapp_wcs_sandbox_html_all_js_files |
| 275 html_output = wcs_sandbox_html_output |
| 276 } |
| 277 |
| 278 main_html = target_name + "_main_html" |
| 279 main_html_output = "$target_gen_dir/html/$target_name/main.html" |
| 280 |
| 281 build_webapp_html(main_html) { |
| 282 html_template_file = ar_main_template |
| 283 html_template_include_files = ar_main_template_files |
| 284 js_files = ar_main_js_files |
| 285 html_output = main_html_output |
| 286 } |
| 287 |
| 234 action(target_name) { | 288 action(target_name) { |
| 235 script = "//remoting/webapp/build-webapp.py" | 289 script = "build-webapp.py" |
| 236 | 290 |
| 237 app_key = invoker.app_key | 291 app_key = invoker.app_key |
| 238 app_id = invoker.app_id | 292 app_id = invoker.app_id |
| 239 app_client_id = invoker.app_client_id | 293 app_client_id = invoker.app_client_id |
| 240 app_vendor = invoker.app_vendor | |
| 241 app_name = invoker.app_name | 294 app_name = invoker.app_name |
| 242 app_fullname = invoker.app_fullname | |
| 243 app_description = invoker.app_description | 295 app_description = invoker.app_description |
| 244 app_capabilities = invoker.app_capabilities | 296 app_capabilities = invoker.app_capabilities |
| 245 manifest_key = invoker.manifest_key | 297 manifest_key = invoker.manifest_key |
| 246 | 298 |
| 247 # These asserts are so that these variables get marked as being used so | 299 # These asserts are so that these variables get marked as being used so |
| 248 # that GN doesn't complain about them. | 300 # that GN doesn't complain about them. |
| 249 assert(app_key != "" || app_key == "") | 301 assert(app_key != "" || app_key == "") |
| 250 assert(app_id != "" || app_id == "") | 302 assert(app_id != "" || app_id == "") |
| 251 | 303 |
| 252 ar_base_path = "//remoting/webapp/app_remoting" | 304 # TODO(garykac) For internal targets, we need to extract the vendor and app |
| 253 if (app_vendor != "") { | 305 # name from the target. |
| 254 ar_app_path = "$ar_base_path/internal/apps/$app_vendor/$app_name" | 306 ar_app_name = "sample_app" #target_name |
| 255 } else { | 307 ar_app_path = "app_remoting/apps/$ar_app_name" |
| 256 ar_app_path = "$ar_base_path/apps/$app_name" | |
| 257 } | |
| 258 ar_app_manifest = "$ar_app_path/manifest.json.jinja2" | 308 ar_app_manifest = "$ar_app_path/manifest.json.jinja2" |
| 259 ar_app_manifest_common = "$ar_base_path/manifest_common.json.jinja2" | 309 ar_app_manifest_common = "app_remoting/manifest_common.json.jinja2" |
| 260 | 310 |
| 261 output_dir = "remoting/app_remoting/$ar_service_environment/$target_name" | 311 output_dir = "remoting/app_remoting/$ar_service_environment/$target_name" |
| 262 zip_path = "remoting/app_remoting/$ar_service_environment/$target_name.zip" | 312 zip_path = "remoting/app_remoting/$ar_service_environment/$target_name.zip" |
| 263 | 313 |
| 264 # TODO(garykac) Move this list of files into files.gni. | |
| 265 ar_app_specific_files = [ | 314 ar_app_specific_files = [ |
| 266 "$ar_app_path/icon16.png", | 315 "$ar_app_path/icon16.png", |
| 267 "$ar_app_path/icon48.png", | 316 "$ar_app_path/icon48.png", |
| 268 "$ar_app_path/icon128.png", | 317 "$ar_app_path/icon128.png", |
| 269 "$ar_app_path/loading_splash.png", | 318 "$ar_app_path/loading_splash.png", |
| 270 ] | 319 ] |
| 271 | 320 |
| 321 ar_generated_html_files = [ |
| 322 feedback_consent_html_output, |
| 323 loading_window_html_output, |
| 324 message_window_html_output, |
| 325 wcs_sandbox_html_output, |
| 326 main_html_output, |
| 327 ] |
| 328 |
| 272 ar_webapp_files = | 329 ar_webapp_files = |
| 273 ar_app_specific_files + ar_vendor_js_files + ar_vendor_html_files | 330 ar_app_specific_files + ar_shared_resource_files + ar_all_js_files |
| 274 | 331 |
| 275 inputs = [ | 332 inputs = [ |
| 276 rebase_path(ar_app_manifest, root_build_dir), | 333 rebase_path(ar_app_manifest, root_build_dir), |
| 277 rebase_path(ar_app_manifest_common, root_build_dir), | 334 rebase_path(ar_app_manifest_common, root_build_dir), |
| 278 ] + remoting_version_files + ar_webapp_files | 335 ] + remoting_version_files + ar_webapp_files |
| 279 | 336 |
| 280 outputs = [ | 337 outputs = [ |
| 281 "$target_gen_dir/$zip_path", | 338 "$target_gen_dir/$zip_path", |
| 282 ] | 339 ] |
| 283 | 340 |
| 284 deps = [ | 341 deps = [ |
| 285 ":$locales_listfile", | 342 ":$locales_listfile", |
| 343 ":$feedback_consent_html", |
| 344 ":$loading_window_html", |
| 345 ":$message_window_html", |
| 346 ":$wcs_sandbox_html", |
| 347 ":$main_html", |
| 286 "//remoting/resources", | 348 "//remoting/resources", |
| 287 ] | 349 ] |
| 288 | 350 |
| 289 # Create a file that contains a list of all the resource files needed | 351 # Create a file that contains a list of all the resource files needed |
| 290 # to build the webapp. This is needed to avoid problems on platforms that | 352 # to build the webapp. This is needed to avoid problems on platforms that |
| 291 # limit the size of a command line. | 353 # limit the size of a command line. |
| 292 file_list = "$target_gen_dir/${target_name}_files.txt" | 354 file_list = "$target_gen_dir/${target_name}_files.txt" |
| 293 files = [] | 355 files = [] |
| 356 files += rebase_path(ar_generated_html_files, root_build_dir) |
| 294 files += rebase_path(ar_webapp_files, root_build_dir) | 357 files += rebase_path(ar_webapp_files, root_build_dir) |
| 295 write_file(file_list, files) | 358 write_file(file_list, files) |
| 296 | 359 |
| 297 args = [ | 360 args = [ |
| 298 buildtype, | 361 buildtype, |
| 299 version_full, | 362 version_full, |
| 300 output_dir, | 363 output_dir, |
| 301 zip_path, | 364 zip_path, |
| 302 rebase_path(ar_app_manifest, root_build_dir), | 365 rebase_path(ar_app_manifest, root_build_dir), |
| 303 "app_remoting", # Web app type | 366 "app_remoting", # Web app type |
| 304 ] | 367 ] |
| 305 args += [ | 368 args += [ |
| 306 "--files_listfile", | 369 "--files_listfile", |
| 307 rebase_path(file_list, root_build_dir), | 370 rebase_path(file_list, root_build_dir), |
| 308 ] | 371 ] |
| 309 args += [ | 372 args += [ |
| 310 "--locales_listfile", | 373 "--locales_listfile", |
| 311 rebase_path(locales_listfile_output, root_build_dir), | 374 rebase_path(locales_listfile_output, root_build_dir), |
| 312 ] | 375 ] |
| 313 args += [ | 376 args += [ |
| 314 "--jinja_paths", | 377 "--jinja_paths", |
| 315 rebase_path("//remoting/webapp/app_remoting", root_build_dir), | 378 rebase_path("app_remoting", root_build_dir), |
| 316 ] | 379 ] |
| 317 | 380 |
| 318 if (is_debug) { | 381 if (is_debug) { |
| 319 # Normally, the app-id for the orchestrator is automatically extracted | 382 # Normally, the app-id for the orchestrator is automatically extracted |
| 320 # from the webapp's extension id, but that approach doesn't work for | 383 # from the webapp's extension id, but that approach doesn't work for |
| 321 # dev webapp builds (since they all share the same dev extension id). | 384 # dev webapp builds (since they all share the same dev extension id). |
| 322 # The --appid arg will create a webapp that registers the given app-id | 385 # The --appid arg will create a webapp that registers the given app-id |
| 323 # rather than using the extension id. | 386 # rather than using the extension id. |
| 324 # This is only done for Dev apps because the app-id for Release apps | 387 # This is only done for Dev apps because the app-id for Release apps |
| 325 # *must* match the extension id. | 388 # *must* match the extension id. |
| 326 args += [ | 389 args += [ |
| 327 "--appid", | 390 "--appid", |
| 328 app_id, | 391 app_id, |
| 329 ] | 392 ] |
| 330 } | 393 } |
| 331 | 394 |
| 332 args += [ | 395 args += [ |
| 333 "--app_name", | 396 "--app_name", |
| 334 app_fullname, | 397 app_name, |
| 335 ] | 398 ] |
| 336 args += [ | 399 args += [ |
| 337 "--app_description", | 400 "--app_description", |
| 338 app_description, | 401 app_description, |
| 339 ] | 402 ] |
| 340 args += [ "--app_capabilities" ] + app_capabilities | 403 args += [ "--app_capabilities" ] + app_capabilities |
| 341 args += [ | 404 args += [ |
| 342 "--service_environment", | 405 "--service_environment", |
| 343 ar_service_environment, | 406 ar_service_environment, |
| 344 ] | 407 ] |
| 345 args += [ | 408 args += [ |
| 346 "--manifest_key", | 409 "--manifest_key", |
| 347 manifest_key, | 410 manifest_key, |
| 348 ] | 411 ] |
| 349 args += [ | 412 args += [ |
| 350 "--app_client_id", | 413 "--app_client_id", |
| 351 app_client_id, | 414 app_client_id, |
| 352 ] | 415 ] |
| 353 } | 416 } |
| 354 } | 417 } |
| 355 | |
| 356 template("app_remoting_shared_module") { | |
| 357 locales_listfile = target_name + "_locales" | |
| 358 locales_listfile_output = "$target_gen_dir/${target_name}_locales.txt" | |
| 359 | |
| 360 build_locales_listfile(locales_listfile) { | |
| 361 # Template uses locales_listfile_output from outer scope. | |
| 362 } | |
| 363 | |
| 364 feedback_consent_html = target_name + "_feedback_consent_html" | |
| 365 feedback_consent_html_output = | |
| 366 "$target_gen_dir/html/$target_name/feedback_consent.html" | |
| 367 | |
| 368 build_webapp_html(feedback_consent_html) { | |
| 369 html_template_file = ar_feedback_consent_template | |
| 370 html_template_include_files = [] | |
| 371 js_files = ar_feedback_consent_html_all_js_files | |
| 372 html_output = feedback_consent_html_output | |
| 373 } | |
| 374 | |
| 375 loading_window_html = target_name + "_loading_window_html" | |
| 376 loading_window_html_output = | |
| 377 "$target_gen_dir/html/$target_name/loading_window.html" | |
| 378 | |
| 379 build_webapp_html(loading_window_html) { | |
| 380 html_template_file = ar_loading_window_template | |
| 381 html_template_include_files = [] | |
| 382 | |
| 383 # The loading window is just a reskin of the message window -- all JS code | |
| 384 # is shared. | |
| 385 js_files = remoting_webapp_message_window_html_all_js_files | |
| 386 html_output = loading_window_html_output | |
| 387 } | |
| 388 | |
| 389 message_window_html = target_name + "_message_window_html" | |
| 390 message_window_html_output = | |
| 391 "$target_gen_dir/html/$target_name/message_window.html" | |
| 392 | |
| 393 build_webapp_html(message_window_html) { | |
| 394 html_template_file = remoting_webapp_template_message_window | |
| 395 html_template_include_files = [] | |
| 396 js_files = remoting_webapp_message_window_html_all_js_files | |
| 397 html_output = message_window_html_output | |
| 398 } | |
| 399 | |
| 400 wcs_sandbox_html = target_name + "_wcs_sandbox_html" | |
| 401 wcs_sandbox_html_output = "$target_gen_dir/html/$target_name/wcs_sandbox.html" | |
| 402 | |
| 403 build_webapp_html(wcs_sandbox_html) { | |
| 404 html_template_file = remoting_webapp_template_wcs_sandbox | |
| 405 html_template_include_files = [] | |
| 406 js_files = remoting_webapp_wcs_sandbox_html_all_js_files | |
| 407 html_output = wcs_sandbox_html_output | |
| 408 } | |
| 409 | |
| 410 background_html = target_name + "_background_html" | |
| 411 background_html_output = | |
| 412 "$target_gen_dir/html/$target_name/ar_background.html" | |
| 413 | |
| 414 build_webapp_html(background_html) { | |
| 415 html_template_file = ar_background_template | |
| 416 html_template_include_files = [] | |
| 417 js_files = ar_background_html_js_files | |
| 418 html_output = background_html_output | |
| 419 } | |
| 420 | |
| 421 main_html = target_name + "_main_html" | |
| 422 main_html_output = "$target_gen_dir/html/$target_name/main.html" | |
| 423 | |
| 424 build_webapp_html(main_html) { | |
| 425 html_template_file = ar_main_template | |
| 426 html_template_include_files = ar_main_template_files | |
| 427 js_files = ar_main_js_files | |
| 428 html_output = main_html_output | |
| 429 } | |
| 430 | |
| 431 action(target_name) { | |
| 432 script = "build-webapp.py" | |
| 433 | |
| 434 app_client_id = invoker.app_client_id | |
| 435 app_name = invoker.app_name | |
| 436 app_fullname = invoker.app_fullname | |
| 437 app_description = invoker.app_description | |
| 438 manifest_key = invoker.manifest_key | |
| 439 | |
| 440 ar_path = "app_remoting/$app_name" | |
| 441 ar_manifest = "$ar_path/manifest.json" | |
| 442 | |
| 443 output_dir = "remoting/app_remoting/$target_name" | |
| 444 zip_path = "remoting/app_remoting/$target_name.zip" | |
| 445 | |
| 446 ar_generated_html_files = [ | |
| 447 background_html_output, | |
| 448 feedback_consent_html_output, | |
| 449 loading_window_html_output, | |
| 450 message_window_html_output, | |
| 451 wcs_sandbox_html_output, | |
| 452 main_html_output, | |
| 453 ] | |
| 454 | |
| 455 ar_webapp_files = | |
| 456 ar_shared_resource_files + ar_all_js_files + ar_generated_html_files | |
| 457 | |
| 458 inputs = [ rebase_path(ar_manifest, root_build_dir) ] + | |
| 459 remoting_version_files + ar_webapp_files | |
| 460 | |
| 461 outputs = [ | |
| 462 "$target_gen_dir/$zip_path", | |
| 463 ] | |
| 464 | |
| 465 deps = [ | |
| 466 ":$locales_listfile", | |
| 467 ":$feedback_consent_html", | |
| 468 ":$loading_window_html", | |
| 469 ":$message_window_html", | |
| 470 ":$wcs_sandbox_html", | |
| 471 ":$main_html", | |
| 472 "//remoting/resources", | |
| 473 ] | |
| 474 | |
| 475 # Create a file that contains a list of all the resource files needed | |
| 476 # to build the webapp. This is needed to avoid problems on platforms that | |
| 477 # limit the size of a command line. | |
| 478 file_list = "$target_gen_dir/${target_name}_files.txt" | |
| 479 files = [] | |
| 480 files += rebase_path(ar_webapp_files, root_build_dir) | |
| 481 write_file(file_list, files) | |
| 482 | |
| 483 args = [ | |
| 484 buildtype, | |
| 485 version_full, | |
| 486 output_dir, | |
| 487 zip_path, | |
| 488 rebase_path(ar_manifest, root_build_dir), | |
| 489 "shared_module", # Web app type | |
| 490 ] | |
| 491 args += [ | |
| 492 "--files_listfile", | |
| 493 rebase_path(file_list, root_build_dir), | |
| 494 ] | |
| 495 args += [ | |
| 496 "--locales_listfile", | |
| 497 rebase_path(locales_listfile_output, root_build_dir), | |
| 498 ] | |
| 499 | |
| 500 args += [ | |
| 501 "--app_name", | |
| 502 app_fullname, | |
| 503 ] | |
| 504 args += [ | |
| 505 "--app_description", | |
| 506 app_description, | |
| 507 ] | |
| 508 args += [ | |
| 509 "--manifest_key", | |
| 510 manifest_key, | |
| 511 ] | |
| 512 args += [ | |
| 513 "--app_client_id", | |
| 514 app_client_id, | |
| 515 ] | |
| 516 } | |
| 517 } | |
| OLD | NEW |