Chromium Code Reviews| 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 import("//build/config/android/config.gni") | |
| 5 import("//build/config/android/rules.gni") | 6 import("//build/config/android/rules.gni") |
| 6 import("//build/util/version.gni") | 7 import("//build/util/version.gni") |
| 7 import("//chrome/version.gni") | 8 import("//chrome/version.gni") |
| 8 import("//testing/test.gni") | 9 import("//testing/test.gni") |
| 9 | 10 |
| 10 assert(!is_component_build, "Cronet requires static library build.") | 11 assert(!is_component_build, "Cronet requires static library build.") |
| 11 | 12 |
| 12 declare_args() { | 13 declare_args() { |
| 13 cronet_enable_data_reduction_proxy_support = false | 14 cronet_enable_data_reduction_proxy_support = false |
| 14 } | 15 } |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 446 ] | 447 ] |
| 447 | 448 |
| 448 deps = [ | 449 deps = [ |
| 449 ":cronet_static", | 450 ":cronet_static", |
| 450 "//base", | 451 "//base", |
| 451 "//base/test:test_support", | 452 "//base/test:test_support", |
| 452 "//components/metrics", | 453 "//components/metrics", |
| 453 "//testing/gtest", | 454 "//testing/gtest", |
| 454 ] | 455 ] |
| 455 } | 456 } |
| 457 | |
| 458 _package_dir = "$root_out_dir/cronet" | |
| 459 _extract_cronet_jars_dir = "target_gen_dir/cronet_jar_extract" | |
| 460 | |
| 461 action("extract_cronet_jars") { | |
| 462 script = "//components/cronet/tools/extract_from_jars.py" | |
| 463 depfile = "$root_gen_dir/$target_name.d" | |
|
brettw
2015/12/21 20:25:02
This should probably go in the target gen dir.
| |
| 464 | |
| 465 sources = [ | |
| 466 "$root_out_dir/lib.java/base/base_java.jar", | |
| 467 "$root_out_dir/lib.java/components/cronet/android/cronet_java.jar", | |
| 468 "$root_out_dir/lib.java/net/android/net_java.jar", | |
| 469 "$root_out_dir/lib.java/url/url_java.jar", | |
| 470 ] | |
| 471 outputs = [ | |
| 472 depfile, | |
| 473 ] | |
| 474 | |
| 475 _rebased_sources = rebase_path(sources, root_build_dir) | |
| 476 | |
| 477 args = [ | |
| 478 "--classes-dir", | |
| 479 rebase_path(_extract_cronet_jars_dir, root_build_dir), | |
| 480 "--jars=${_rebased_sources}", | |
| 481 "--depfile", | |
| 482 rebase_path(depfile, root_build_dir), | |
| 483 ] | |
| 484 | |
| 485 deps = [ | |
| 486 ":cronet_java", | |
| 487 "//base:base_java", | |
| 488 "//net/android:net_java", | |
| 489 "//url:url_java", | |
| 490 ] | |
| 491 } | |
| 492 | |
| 493 action("repackage_extracted_jars") { | |
| 494 _output_jar = "$_package_dir/cronet.jar" | |
| 495 | |
| 496 script = "//build/android/gyp/jar.py" | |
| 497 outputs = [ | |
| 498 _output_jar, | |
| 499 ] | |
| 500 | |
| 501 args = [ | |
| 502 "--classes-dir", | |
| 503 rebase_path(_extract_cronet_jars_dir, root_build_dir), | |
| 504 "--jar-path", | |
| 505 rebase_path(_output_jar, root_build_dir), | |
| 506 ] | |
| 507 | |
| 508 deps = [ | |
| 509 ":extract_cronet_jars", | |
| 510 ] | |
| 511 } | |
| 512 | |
| 513 template("jar_src") { | |
| 514 action(target_name) { | |
| 515 _rebased_src_dirs = rebase_path(invoker.src_dirs, root_build_dir) | |
| 516 | |
| 517 script = "//components/cronet/tools/jar_src.py" | |
| 518 depfile = "$target_gen_dir/$target_name.d" | |
|
Dirk Pranke
2015/12/17 01:52:43
It looks like this script gets pointed at a direct
pkotwicz
2015/12/17 16:50:32
jar_src.py is only used by cronet.
We take direct
brettw
2015/12/21 20:25:01
I think this will work because extract_from_jars d
| |
| 519 outputs = [ | |
| 520 depfile, | |
| 521 invoker.jar_path, | |
| 522 ] | |
| 523 args = [ | |
| 524 "--src-dir=${_rebased_src_dirs}", | |
| 525 "--jar-path", | |
| 526 rebase_path(invoker.jar_path, root_build_dir), | |
| 527 "--depfile", | |
| 528 rebase_path(depfile, root_build_dir), | |
| 529 ] | |
| 530 } | |
| 531 } | |
| 532 | |
| 533 jar_src("jar_cronet_api_source") { | |
| 534 src_dirs = [ "api/src" ] | |
| 535 jar_path = "$_package_dir/cronet_api-src.jar" | |
| 536 } | |
| 537 | |
| 538 jar_src("jar_cronet_sample_source") { | |
| 539 src_dirs = [ "sample" ] | |
| 540 jar_path = "$_package_dir/cronet-sample-src.jar" | |
| 541 } | |
| 542 | |
| 543 jar_src("jar_cronet_other_source") { | |
| 544 src_dirs = [ | |
| 545 "//base/android/java/src", | |
| 546 "//components/cronet/android/java/src", | |
| 547 "//net/android/java/src", | |
| 548 "//url/android/java/src", | |
| 549 ] | |
| 550 jar_path = "$_package_dir/cronet-src.jar" | |
| 551 } | |
| 552 | |
| 553 action("generate_licenses") { | |
| 554 _license_path = "$_package_dir/LICENSE" | |
| 555 | |
| 556 script = "//components/cronet/tools/cronet_licenses.py" | |
| 557 outputs = [ | |
| 558 _license_path, | |
| 559 ] | |
| 560 args = [ | |
| 561 "license", | |
| 562 rebase_path(_license_path, root_build_dir), | |
| 563 ] | |
| 564 } | |
| 565 | |
| 566 action("generate_javadoc") { | |
| 567 script = "//components/cronet/tools/generate_javadoc.py" | |
| 568 depfile = "$target_gen_dir/$target_name.d" | |
| 569 outputs = [ | |
| 570 depfile, | |
| 571 ] | |
| 572 | |
| 573 args = [ | |
| 574 "--output-dir", | |
| 575 rebase_path(_package_dir, root_build_dir), | |
| 576 "--input-dir", | |
| 577 rebase_path("//components/cronet", root_build_dir), | |
| 578 "--overview-file", | |
| 579 rebase_path("$_package_dir/README.md.html", root_build_dir), | |
| 580 "--readme-file", | |
| 581 rebase_path("//components/cronet/README.md", root_build_dir), | |
| 582 "--depfile", | |
| 583 rebase_path(depfile, root_build_dir), | |
| 584 ] | |
| 585 } | |
| 586 | |
| 587 copy("cronet_package_copy") { | |
| 588 sources = [ | |
| 589 "$root_out_dir/lib.java/components/cronet/android/cronet_api.jar", | |
| 590 "//AUTHORS", | |
| 591 "//chrome/VERSION", | |
| 592 "//components/cronet/android/proguard.cfg", | |
| 593 ] | |
| 594 outputs = [ | |
| 595 "$_package_dir/{{source_file_part}}", | |
| 596 ] | |
| 597 | |
| 598 deps = [ | |
| 599 ":cronet_api", | |
| 600 ] | |
| 601 } | |
| 602 | |
| 603 copy("cronet_package_copy_native_lib") { | |
| 604 sources = [ | |
| 605 "$root_shlib_dir/libcronet.so", | |
| 606 ] | |
| 607 outputs = [ | |
| 608 "$_package_dir/symbols/${android_app_abi}/libcronet.so", | |
| 609 ] | |
| 610 deps = [ | |
| 611 ":cronet", | |
| 612 ] | |
| 613 } | |
| 614 | |
| 615 group("cronet_package") { | |
| 616 deps = [ | |
| 617 ":cronet_package_copy", | |
| 618 ":cronet_package_copy_native_lib", | |
| 619 ":generate_javadoc", | |
| 620 ":generate_licenses", | |
| 621 ":jar_cronet_api_source", | |
| 622 ":jar_cronet_other_source", | |
| 623 ":jar_cronet_sample_source", | |
| 624 ":repackage_extracted_jars", | |
| 625 ] | |
| 626 } | |
| OLD | NEW |