Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: components/cronet/android/BUILD.gn

Issue 1488383002: Port cronet_package GYP target to GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/gn_migration.gypi ('k') | components/cronet/tools/extract_from_jars.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 ] 445 ]
445 446
446 deps = [ 447 deps = [
447 ":cronet_static", 448 ":cronet_static",
448 "//base", 449 "//base",
449 "//base/test:test_support", 450 "//base/test:test_support",
450 "//components/metrics", 451 "//components/metrics",
451 "//testing/gtest", 452 "//testing/gtest",
452 ] 453 ]
453 } 454 }
455
456 _package_dir = "$root_out_dir/cronet"
457 _extract_cronet_jars_dir = "$root_gen_dir/cronet_jar_extract"
agrieve 2015/12/02 15:03:13 nit: since this one is temporary, can you use targ
pkotwicz 2015/12/10 22:16:07 Done.
458
459 action("extract_cronet_jars") {
460 script = "//components/cronet/tools/extract_from_jars.py"
461 depfile = "$root_gen_dir/$target_name.d"
462
463 sources = [
464 "$root_out_dir/lib.java/base/base_java.jar",
465 "$root_out_dir/lib.java/components/cronet/android/cronet_java.jar",
466 "$root_out_dir/lib.java/net/android/net_java.jar",
467 "$root_out_dir/lib.java/url/url_java.jar",
468 ]
469 outputs = [
470 depfile,
agrieve 2015/12/02 15:03:13 unfortunate that it can't list any of its outputs
471 ]
472
473 _rebased_sources = rebase_path(sources, root_build_dir)
474
475 args = [
476 "--classes-dir",
477 rebase_path(_extract_cronet_jars_dir, root_build_dir),
478 "--jars=${_rebased_sources}",
479 "--depfile",
480 rebase_path(depfile, root_build_dir),
481 ]
482
483 deps = [
484 ":cronet_java",
485 "//base:base_java",
486 "//net/android:net_java",
487 "//url:url_java",
488 ]
489 }
490
491 action("repackage_extracted_jars") {
492 _output_jar = "$_package_dir/cronet.jar"
493
494 script = "//build/android/gyp/jar.py"
495 outputs = [
496 _output_jar,
497 ]
498
499 args = [
500 "--classes-dir",
501 rebase_path(_extract_cronet_jars_dir, root_build_dir),
502 "--jar-path",
503 rebase_path(_output_jar, root_build_dir),
504 ]
505
506 deps = [
507 ":extract_cronet_jars",
508 ]
509 }
510
511 template("jar_src") {
512 action(target_name) {
513 _rebased_src_dirs = rebase_path(invoker.src_dirs, root_build_dir)
514
515 script = "//components/cronet/tools/jar_src.py"
516 depfile = "$target_gen_dir/$target_name.d"
517 outputs = [
518 depfile,
519 invoker.jar_path,
520 ]
521 args = [
522 "--src-dir=${_rebased_src_dirs}",
523 "--jar-path",
524 rebase_path(invoker.jar_path, root_build_dir),
525 "--depfile",
526 rebase_path(depfile, root_build_dir),
527 ]
528 }
529 }
530
531 jar_src("jar_cronet_api_source") {
532 src_dirs = [ "api/src" ]
533 jar_path = "$_package_dir/cronet_api-src.jar"
534 }
535
536 jar_src("jar_cronet_sample_source") {
537 src_dirs = [ "sample" ]
538 jar_path = "$_package_dir/cronet-sample-src.jar"
539 }
540
541 jar_src("jar_cronet_other_source") {
542 src_dirs = [
543 "//base/android/java/src",
544 "//components/cronet/android/java/src",
545 "//net/android/java/src",
546 "//url/android/java/src",
547 ]
548 jar_path = "$_package_dir/cronet-src.jar"
549 }
550
551 action("generate_licenses") {
552 _license_path = "$_package_dir/LICENSE"
553
554 script = "//components/cronet/tools/cronet_licenses.py"
555 outputs = [
556 _license_path,
557 ]
558 args = [
559 "license",
560 rebase_path(_license_path, root_build_dir),
561 ]
562 }
563
564 action("generate_javadoc") {
565 script = "//components/cronet/tools/generate_javadoc.py"
566 depfile = "$target_gen_dir/$target_name.d"
567 outputs = [
568 depfile,
569 ]
570
571 args = [
572 "--output-dir",
573 rebase_path(_package_dir, root_build_dir),
574 "--input-dir",
575 rebase_path("//components/cronet", root_build_dir),
576 "--overview-file",
577 rebase_path("$_package_dir/README.md.html", root_build_dir),
578 "--readme-file",
579 rebase_path("//components/cronet/README.md", root_build_dir),
580 "--depfile",
581 rebase_path(depfile, root_build_dir),
582 ]
583 }
584
585 copy("cronet_package_copy") {
586 sources = [
587 "$root_out_dir/lib.java/components/cronet/android/cronet_api.jar",
588 "//AUTHORS",
589 "//chrome/VERSION",
590 "//components/cronet/android/proguard.cfg",
591 ]
592 outputs = [
593 "$_package_dir/{{source_file_part}}",
594 ]
595
596 deps = [
597 ":cronet_api",
598 ]
599 }
600
601 copy("cronet_package_copy_native_lib") {
602 sources = [
603 "$root_shlib_dir/libcronet.so",
604 ]
605 outputs = [
606 "$_package_dir/symbols/${android_app_abi}/libcronet.so",
607 ]
608 deps = [
609 ":cronet",
610 ]
611 }
612
613 group("cronet_package") {
614 deps = [
615 ":cronet_package_copy",
616 ":cronet_package_copy_native_lib",
617 ":generate_javadoc",
618 ":generate_licenses",
619 ":jar_cronet_api_source",
620 ":jar_cronet_other_source",
621 ":jar_cronet_sample_source",
622 ":repackage_extracted_jars",
623 ]
624 }
OLDNEW
« no previous file with comments | « build/gn_migration.gypi ('k') | components/cronet/tools/extract_from_jars.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698