OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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/config.gni") |
6 import("//build/config/android/internal_rules.gni") | 6 import("//build/config/android/internal_rules.gni") |
7 import("//tools/grit/grit_rule.gni") | 7 import("//tools/grit/grit_rule.gni") |
8 | 8 |
9 assert(is_android) | 9 assert(is_android) |
10 | 10 |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 # This target creates an Android library containing java code and Android | 392 # This target creates an Android library containing java code and Android |
393 # resources. | 393 # resources. |
394 # | 394 # |
395 # Variables | 395 # Variables |
396 # deps: Specifies the dependencies of this target. Java targets in this list | 396 # deps: Specifies the dependencies of this target. Java targets in this list |
397 # will be added to the javac classpath. Android resources in dependencies | 397 # will be added to the javac classpath. Android resources in dependencies |
398 # will be used when building this library. | 398 # will be used when building this library. |
399 # java_files: List of .java files included in this library. | 399 # java_files: List of .java files included in this library. |
400 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars | 400 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars |
401 # will be added to java_files and be included in this library. | 401 # will be added to java_files and be included in this library. |
402 # | 402 # chromium_code: If true, extra static analysis warning/errors will be enabled
. |
403 # jar_excluded_patterns: List of patterns of .class files to exclude from the | 403 # jar_excluded_patterns: List of patterns of .class files to exclude from the |
404 # final jar. | 404 # final jar. |
405 # | 405 # |
406 # Example | 406 # Example |
407 # android_library("foo_java") { | 407 # android_library("foo_java") { |
408 # java_files = [ | 408 # java_files = [ |
409 # "android/org/chromium/foo/Foo.java", | 409 # "android/org/chromium/foo/Foo.java", |
410 # "android/org/chromium/foo/FooInterface.java", | 410 # "android/org/chromium/foo/FooInterface.java", |
411 # "android/org/chromium/foo/FooService.java", | 411 # "android/org/chromium/foo/FooService.java", |
412 # ] | 412 # ] |
(...skipping 18 matching lines...) Expand all Loading... |
431 type = "android_library" | 431 type = "android_library" |
432 | 432 |
433 deps = [] | 433 deps = [] |
434 if (defined(invoker.deps)) { | 434 if (defined(invoker.deps)) { |
435 deps += invoker.deps | 435 deps += invoker.deps |
436 } | 436 } |
437 | 437 |
438 # base_path | 438 # base_path |
439 } | 439 } |
440 | 440 |
| 441 _chromium_code = true |
| 442 if (defined(invoker.chromium_code)) { |
| 443 _chromium_code = invoker.chromium_code |
| 444 } |
| 445 |
441 android_java_library(target_name) { | 446 android_java_library(target_name) { |
| 447 chromium_code = _chromium_code |
442 java_files = invoker.java_files | 448 java_files = invoker.java_files |
443 build_config = build_config | 449 build_config = build_config |
444 | 450 |
445 if (defined(invoker.jar_excluded_patterns)) { | 451 if (defined(invoker.jar_excluded_patterns)) { |
446 jar_excluded_patterns = invoker.jar_excluded_patterns | 452 jar_excluded_patterns = invoker.jar_excluded_patterns |
447 } | 453 } |
448 | 454 |
449 if (defined(invoker.srcjar_deps)) { | 455 if (defined(invoker.srcjar_deps)) { |
450 srcjar_deps = invoker.srcjar_deps | 456 srcjar_deps = invoker.srcjar_deps |
451 } | 457 } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 zip_path = resources_zip_path | 551 zip_path = resources_zip_path |
546 srcjar_path = resource_srcjar_path | 552 srcjar_path = resource_srcjar_path |
547 | 553 |
548 generate_constant_ids = true | 554 generate_constant_ids = true |
549 } | 555 } |
550 | 556 |
551 rebased_build_config = rebase_path(build_config, root_build_dir) | 557 rebased_build_config = rebase_path(build_config, root_build_dir) |
552 | 558 |
553 final_deps += [":${target_name}__java"] | 559 final_deps += [":${target_name}__java"] |
554 android_java_library("${target_name}__java") { | 560 android_java_library("${target_name}__java") { |
| 561 android_manifest = invoker.android_manifest |
555 java_files = invoker.java_files | 562 java_files = invoker.java_files |
556 dex_path = base_path + ".dex.jar" | 563 dex_path = base_path + ".dex.jar" |
557 } | 564 } |
558 | 565 |
559 final_deps += [":${target_name}__final_dex"] | 566 final_deps += [":${target_name}__final_dex"] |
560 dex("${target_name}__final_dex") { | 567 dex("${target_name}__final_dex") { |
561 sources = [jar_path] | 568 sources = [jar_path] |
562 inputs = [build_config] | 569 inputs = [build_config] |
563 output = final_dex_path | 570 output = final_dex_path |
564 dex_arg_key = "${rebased_build_config}:apk_dex:dependency_dex_files" | 571 dex_arg_key = "${rebased_build_config}:apk_dex:dependency_dex_files" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 "//testing/android/java/src/org/chromium/native_test/ChromeNativeTestActiv
ity.java" | 617 "//testing/android/java/src/org/chromium/native_test/ChromeNativeTestActiv
ity.java" |
611 ] | 618 ] |
612 android_manifest = "//testing/android/java/AndroidManifest.xml" | 619 android_manifest = "//testing/android/java/AndroidManifest.xml" |
613 unittests_outputs = get_target_outputs(invoker.unittests_dep) | 620 unittests_outputs = get_target_outputs(invoker.unittests_dep) |
614 native_libs = [unittests_outputs[0]] | 621 native_libs = [unittests_outputs[0]] |
615 if (defined(invoker.deps)) { | 622 if (defined(invoker.deps)) { |
616 deps = invoker.deps | 623 deps = invoker.deps |
617 } | 624 } |
618 } | 625 } |
619 } | 626 } |
OLD | NEW |