| 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("//build/config/features.gni") | 8 import("//build/config/features.gni") |
| 9 import("//build/util/version.gni") | 9 import("//build/util/version.gni") |
| 10 import("//remoting/remoting_locales.gni") | 10 import("//remoting/remoting_locales.gni") |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 html_template_include_files = remoting_webapp_public_session_template_files | 205 html_template_include_files = remoting_webapp_public_session_template_files |
| 206 js_files = remoting_webapp_public_session_html_all_js_files | 206 js_files = remoting_webapp_public_session_html_all_js_files |
| 207 html_output = public_session_html_output | 207 html_output = public_session_html_output |
| 208 exclude_js = [] | 208 exclude_js = [] |
| 209 instrument_js = [] | 209 instrument_js = [] |
| 210 } | 210 } |
| 211 | 211 |
| 212 action(target_name) { | 212 action(target_name) { |
| 213 script = "//remoting/webapp/build-webapp.py" | 213 script = "//remoting/webapp/build-webapp.py" |
| 214 | 214 |
| 215 webapp_type = invoker.webapp_type | |
| 216 output_dir = invoker.output_dir | 215 output_dir = invoker.output_dir |
| 217 zip_path = invoker.zip_path | 216 zip_path = invoker.zip_path |
| 218 extra_files = invoker.extra_files | 217 extra_files = invoker.extra_files |
| 219 | 218 |
| 220 dr_generated_html_files = [ | 219 dr_generated_html_files = [ |
| 221 background_html_output, | 220 background_html_output, |
| 222 message_window_html_output, | 221 message_window_html_output, |
| 223 wcs_sandbox_html_output, | 222 wcs_sandbox_html_output, |
| 224 main_html_output, | 223 main_html_output, |
| 225 public_session_html_output, | 224 public_session_html_output, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 files += rebase_path(remoting_webapp_crd_files, root_build_dir) | 272 files += rebase_path(remoting_webapp_crd_files, root_build_dir) |
| 274 files += rebase_path(extra_files, root_build_dir) | 273 files += rebase_path(extra_files, root_build_dir) |
| 275 write_file(file_list, files) | 274 write_file(file_list, files) |
| 276 | 275 |
| 277 args = [ | 276 args = [ |
| 278 buildtype, | 277 buildtype, |
| 279 chrome_version_full, | 278 chrome_version_full, |
| 280 rebase_path(output_dir, root_build_dir), | 279 rebase_path(output_dir, root_build_dir), |
| 281 rebase_path(zip_path, root_build_dir), | 280 rebase_path(zip_path, root_build_dir), |
| 282 rebase_path("crd/manifest.json.jinja2", root_build_dir), | 281 rebase_path("crd/manifest.json.jinja2", root_build_dir), |
| 283 webapp_type, | |
| 284 ] | 282 ] |
| 285 args += [ | 283 args += [ |
| 286 "--files_listfile", | 284 "--files_listfile", |
| 287 rebase_path(file_list, root_build_dir), | 285 rebase_path(file_list, root_build_dir), |
| 288 ] | 286 ] |
| 289 args += [ | 287 args += [ |
| 290 "--locales_listfile", | 288 "--locales_listfile", |
| 291 rebase_path(locales_listfile_output, root_build_dir), | 289 rebase_path(locales_listfile_output, root_build_dir), |
| 292 ] | 290 ] |
| 293 args += [ | 291 args += [ |
| 294 "--use_gcd", | 292 "--use_gcd", |
| 295 "$remoting_use_gcd", | 293 "$remoting_use_gcd", |
| 296 ] | 294 ] |
| 297 } | 295 } |
| 298 } | 296 } |
| 299 | |
| 300 template("app_remoting_webapp") { | |
| 301 locales_listfile = target_name + "_locales" | |
| 302 locales_listfile_output = "$target_gen_dir/${target_name}_locales.txt" | |
| 303 | |
| 304 build_locales_listfile(locales_listfile) { | |
| 305 # TODO(garykac) Replace resources with empty stub rather than duplicating | |
| 306 # all the resources needed by the shared module. | |
| 307 # Template uses locales_listfile_output from outer scope. | |
| 308 } | |
| 309 | |
| 310 action(target_name) { | |
| 311 script = "//remoting/webapp/build-webapp.py" | |
| 312 | |
| 313 app_key = invoker.app_key | |
| 314 app_id = invoker.app_id | |
| 315 app_client_id = invoker.app_client_id | |
| 316 app_vendor = invoker.app_vendor | |
| 317 app_name = invoker.app_name | |
| 318 app_fullname = invoker.app_fullname | |
| 319 app_description = invoker.app_description | |
| 320 app_capabilities = invoker.app_capabilities | |
| 321 manifest_key = invoker.manifest_key | |
| 322 | |
| 323 # These asserts are so that these variables get marked as being used so | |
| 324 # that GN doesn't complain about them. | |
| 325 assert(app_key != "" || app_key == "") | |
| 326 assert(app_id != "" || app_id == "") | |
| 327 | |
| 328 ar_base_path = "//remoting/webapp/app_remoting" | |
| 329 if (app_vendor != "") { | |
| 330 ar_app_path = "$ar_base_path/internal/apps/$app_vendor/$app_name" | |
| 331 } else { | |
| 332 ar_app_path = "$ar_base_path/apps/$app_name" | |
| 333 } | |
| 334 ar_app_manifest = "$ar_app_path/manifest.json.jinja2" | |
| 335 ar_app_manifest_common = "$ar_base_path/manifest_common.json.jinja2" | |
| 336 | |
| 337 output_dir = "$root_build_dir/remoting/app_remoting/" + | |
| 338 "$ar_service_environment/$target_name" | |
| 339 zip_path = "$root_build_dir/remoting/app_remoting/" + | |
| 340 "$ar_service_environment/$target_name.zip" | |
| 341 | |
| 342 # TODO(garykac) Move this list of files into files.gni. | |
| 343 ar_app_specific_files = [ | |
| 344 "$ar_app_path/icon16.png", | |
| 345 "$ar_app_path/icon48.png", | |
| 346 "$ar_app_path/icon128.png", | |
| 347 "$ar_app_path/loading_splash.png", | |
| 348 ] | |
| 349 | |
| 350 ar_webapp_files = | |
| 351 ar_app_specific_files + ar_vendor_js_files + ar_vendor_html_files | |
| 352 | |
| 353 inputs = [ | |
| 354 rebase_path(ar_app_manifest, root_build_dir), | |
| 355 rebase_path(ar_app_manifest_common, root_build_dir), | |
| 356 ] + remoting_version_files + ar_webapp_files | |
| 357 | |
| 358 outputs = [ | |
| 359 zip_path, | |
| 360 ] | |
| 361 | |
| 362 deps = [ | |
| 363 ":$locales_listfile", | |
| 364 "//remoting/resources", | |
| 365 ] | |
| 366 | |
| 367 # Create a file that contains a list of all the resource files needed | |
| 368 # to build the webapp. This is needed to avoid problems on platforms that | |
| 369 # limit the size of a command line. | |
| 370 file_list = "$target_gen_dir/${target_name}_files.txt" | |
| 371 files = [] | |
| 372 files += rebase_path(ar_webapp_files, root_build_dir) | |
| 373 write_file(file_list, files) | |
| 374 | |
| 375 args = [ | |
| 376 buildtype, | |
| 377 chrome_version_full, | |
| 378 rebase_path(output_dir, root_build_dir), | |
| 379 rebase_path(zip_path, root_build_dir), | |
| 380 rebase_path(ar_app_manifest, root_build_dir), | |
| 381 "app_remoting", # Web app type | |
| 382 ] | |
| 383 args += [ | |
| 384 "--files_listfile", | |
| 385 rebase_path(file_list, root_build_dir), | |
| 386 ] | |
| 387 args += [ | |
| 388 "--locales_listfile", | |
| 389 rebase_path(locales_listfile_output, root_build_dir), | |
| 390 ] | |
| 391 args += [ | |
| 392 "--jinja_paths", | |
| 393 rebase_path("//remoting/webapp/app_remoting", root_build_dir), | |
| 394 ] | |
| 395 | |
| 396 if (is_debug) { | |
| 397 # Normally, the app-id for the orchestrator is automatically extracted | |
| 398 # from the webapp's extension id, but that approach doesn't work for | |
| 399 # dev webapp builds (since they all share the same dev extension id). | |
| 400 # The --appid arg will create a webapp that registers the given app-id | |
| 401 # rather than using the extension id. | |
| 402 # This is only done for Dev apps because the app-id for Release apps | |
| 403 # *must* match the extension id. | |
| 404 args += [ | |
| 405 "--appid", | |
| 406 app_id, | |
| 407 ] | |
| 408 } | |
| 409 | |
| 410 args += [ | |
| 411 "--app_name", | |
| 412 app_fullname, | |
| 413 ] | |
| 414 args += [ | |
| 415 "--app_description", | |
| 416 app_description, | |
| 417 ] | |
| 418 args += [ "--app_capabilities" ] + app_capabilities | |
| 419 args += [ | |
| 420 "--service_environment", | |
| 421 ar_service_environment, | |
| 422 ] | |
| 423 args += [ | |
| 424 "--manifest_key", | |
| 425 manifest_key, | |
| 426 ] | |
| 427 args += [ | |
| 428 "--app_client_id", | |
| 429 app_client_id, | |
| 430 ] | |
| 431 } | |
| 432 } | |
| 433 | |
| 434 template("app_remoting_shared_module") { | |
| 435 # TODO(garykac): Include the PNaCl plugin in the shared module once we have | |
| 436 # a GN toolchain (crbug.com/471924). | |
| 437 | |
| 438 locales_listfile = target_name + "_locales" | |
| 439 locales_listfile_output = "$target_gen_dir/${target_name}_locales.txt" | |
| 440 | |
| 441 build_locales_listfile(locales_listfile) { | |
| 442 # Template uses locales_listfile_output from outer scope. | |
| 443 } | |
| 444 | |
| 445 feedback_consent_html = target_name + "_feedback_consent_html" | |
| 446 feedback_consent_html_output = | |
| 447 "$target_gen_dir/html/$target_name/feedback_consent.html" | |
| 448 | |
| 449 build_webapp_html(feedback_consent_html) { | |
| 450 html_template_file = ar_feedback_consent_template | |
| 451 html_template_include_files = [] | |
| 452 js_files = ar_feedback_consent_html_all_js_files | |
| 453 html_output = feedback_consent_html_output | |
| 454 exclude_js = [] | |
| 455 instrument_js = [] | |
| 456 } | |
| 457 | |
| 458 loading_window_html = target_name + "_loading_window_html" | |
| 459 loading_window_html_output = | |
| 460 "$target_gen_dir/html/$target_name/loading_window.html" | |
| 461 | |
| 462 build_webapp_html(loading_window_html) { | |
| 463 html_template_file = ar_loading_window_template | |
| 464 html_template_include_files = [] | |
| 465 | |
| 466 # The loading window is just a reskin of the message window -- all JS code | |
| 467 # is shared. | |
| 468 js_files = remoting_webapp_message_window_html_all_js_files | |
| 469 html_output = loading_window_html_output | |
| 470 exclude_js = [] | |
| 471 instrument_js = [] | |
| 472 } | |
| 473 | |
| 474 message_window_html = target_name + "_message_window_html" | |
| 475 message_window_html_output = | |
| 476 "$target_gen_dir/html/$target_name/message_window.html" | |
| 477 | |
| 478 build_webapp_html(message_window_html) { | |
| 479 html_template_file = remoting_webapp_template_message_window | |
| 480 html_template_include_files = [] | |
| 481 js_files = remoting_webapp_message_window_html_all_js_files | |
| 482 html_output = message_window_html_output | |
| 483 exclude_js = [] | |
| 484 instrument_js = [] | |
| 485 } | |
| 486 | |
| 487 wcs_sandbox_html = target_name + "_wcs_sandbox_html" | |
| 488 wcs_sandbox_html_output = "$target_gen_dir/html/$target_name/wcs_sandbox.html" | |
| 489 | |
| 490 build_webapp_html(wcs_sandbox_html) { | |
| 491 html_template_file = remoting_webapp_template_wcs_sandbox | |
| 492 html_template_include_files = [] | |
| 493 js_files = remoting_webapp_wcs_sandbox_html_all_js_files | |
| 494 html_output = wcs_sandbox_html_output | |
| 495 exclude_js = [] | |
| 496 instrument_js = [] | |
| 497 } | |
| 498 | |
| 499 background_html = target_name + "_background_html" | |
| 500 background_html_output = | |
| 501 "$target_gen_dir/html/$target_name/ar_background.html" | |
| 502 | |
| 503 build_webapp_html(background_html) { | |
| 504 html_template_file = ar_background_template | |
| 505 html_template_include_files = [] | |
| 506 js_files = ar_background_html_js_files | |
| 507 html_output = background_html_output | |
| 508 exclude_js = [] | |
| 509 instrument_js = [] | |
| 510 } | |
| 511 | |
| 512 main_html = target_name + "_main_html" | |
| 513 main_html_output = "$target_gen_dir/html/$target_name/main.html" | |
| 514 | |
| 515 build_webapp_html(main_html) { | |
| 516 html_template_file = ar_main_template | |
| 517 html_template_include_files = ar_main_template_files | |
| 518 js_files = ar_main_js_files | |
| 519 html_output = main_html_output | |
| 520 exclude_js = [] | |
| 521 instrument_js = [] | |
| 522 } | |
| 523 | |
| 524 action(target_name) { | |
| 525 script = "build-webapp.py" | |
| 526 | |
| 527 app_name = invoker.app_name | |
| 528 | |
| 529 ar_path = "app_remoting/$app_name" | |
| 530 ar_manifest = "$ar_path/manifest.json" | |
| 531 | |
| 532 output_dir = "$root_build_dir/remoting/app_remoting/$target_name" | |
| 533 zip_path = "$root_build_dir/remoting/app_remoting/$target_name.zip" | |
| 534 | |
| 535 ar_generated_html_files = [ | |
| 536 background_html_output, | |
| 537 feedback_consent_html_output, | |
| 538 loading_window_html_output, | |
| 539 message_window_html_output, | |
| 540 wcs_sandbox_html_output, | |
| 541 main_html_output, | |
| 542 "$target_gen_dir/credits.html", | |
| 543 ] | |
| 544 | |
| 545 ar_webapp_files = | |
| 546 ar_shared_resource_files + ar_all_js_files + ar_generated_html_files | |
| 547 | |
| 548 inputs = [ rebase_path(ar_manifest, root_build_dir) ] + | |
| 549 remoting_version_files + ar_webapp_files | |
| 550 | |
| 551 outputs = [ | |
| 552 zip_path, | |
| 553 ] | |
| 554 | |
| 555 deps = [ | |
| 556 ":$background_html", | |
| 557 ":$feedback_consent_html", | |
| 558 ":$loading_window_html", | |
| 559 ":$locales_listfile", | |
| 560 ":$main_html", | |
| 561 ":$message_window_html", | |
| 562 ":$wcs_sandbox_html", | |
| 563 "//remoting/resources", | |
| 564 "//remoting/webapp:credits", | |
| 565 ] | |
| 566 | |
| 567 # Create a file that contains a list of all the resource files needed | |
| 568 # to build the webapp. This is needed to avoid problems on platforms that | |
| 569 # limit the size of a command line. | |
| 570 file_list = "$target_gen_dir/${target_name}_files.txt" | |
| 571 files = [] | |
| 572 files += rebase_path(ar_webapp_files, root_build_dir) | |
| 573 write_file(file_list, files) | |
| 574 | |
| 575 args = [ | |
| 576 buildtype, | |
| 577 chrome_version_full, | |
| 578 rebase_path(output_dir, root_build_dir), | |
| 579 rebase_path(zip_path, root_build_dir), | |
| 580 rebase_path(ar_manifest, root_build_dir), | |
| 581 "shared_module", # Web app type | |
| 582 ] | |
| 583 args += [ | |
| 584 "--files_listfile", | |
| 585 rebase_path(file_list, root_build_dir), | |
| 586 ] | |
| 587 args += [ | |
| 588 "--locales_listfile", | |
| 589 rebase_path(locales_listfile_output, root_build_dir), | |
| 590 ] | |
| 591 } | |
| 592 } | |
| OLD | NEW |