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

Side by Side Diff: build/config/android/rules.gni

Issue 581273004: Add template for bundling resources generated by previous grit step (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-java-proto
Patch Set: Created 6 years, 2 months 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 | « no previous file | chrome/app/BUILD.gn » ('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 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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 } 462 }
463 463
464 group(target_name) { 464 group(target_name) {
465 deps = [ 465 deps = [
466 ":${target_name}__build_config", 466 ":${target_name}__build_config",
467 ":${target_name}__zip", 467 ":${target_name}__zip",
468 ] 468 ]
469 } 469 }
470 } 470 }
471 471
472 # Declare a target that packages strings.xml generated from a grd file.
473 #
474 # If this target is included in the deps of an android resources/library/apk,
475 # the strings.xml will be included with that target.
476 #
477 # Variables
478 # grit_output_dir: directory containing grit-generated files.
479 # generated_files: list of android resource files to package.
480 #
481 # Example
482 # java_strings_grd_prebuilt("foo_strings_grd") {
483 # grit_output_dir = "$root_gen_dir/foo/grit"
484 # generated_files = [
485 # "values/strings.xml"
486 # ]
487 # }
488 template("java_strings_grd_prebuilt") {
489 if (defined(invoker.testonly)) { testonly = invoker.testonly }
490
491 base_path = "$target_gen_dir/$target_name"
492 resources_zip = base_path + ".resources.zip"
493 build_config = base_path + ".build_config"
494
495 write_build_config("${target_name}__build_config") {
496 type = "android_resources"
497 if (defined(invoker.deps)) {
498 deps = invoker.deps
499 }
500 }
501
502 zip("${target_name}__zip") {
503 base_dir = invoker.grit_output_dir
504 inputs = rebase_path(invoker.generated_files, ".", base_dir)
505 output = resources_zip
506 }
507
508 group(target_name) {
509 deps = [
510 ":${target_name}__build_config",
511 ":${target_name}__zip",
512 ]
513 }
514 }
515
472 516
473 # Declare an Android library target 517 # Declare an Android library target
474 # 518 #
475 # This target creates an Android library containing java code and Android 519 # This target creates an Android library containing java code and Android
476 # resources. 520 # resources.
477 # 521 #
478 # Variables 522 # Variables
479 # deps: Specifies the dependencies of this target. Java targets in this list 523 # deps: Specifies the dependencies of this target. Java targets in this list
480 # will be added to the javac classpath. Android resources in dependencies 524 # will be added to the javac classpath. Android resources in dependencies
481 # will be used when building this library. 525 # will be used when building this library.
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 } 1186 }
1143 1187
1144 android_library(target_name) { 1188 android_library(target_name) {
1145 java_files = [] 1189 java_files = []
1146 srcjar_deps = [ ":${_template_name}__protoc_java" ] 1190 srcjar_deps = [ ":${_template_name}__protoc_java" ]
1147 deps = [ 1191 deps = [
1148 "//third_party/android_protobuf:protobuf_nano_javalib", 1192 "//third_party/android_protobuf:protobuf_nano_javalib",
1149 ] 1193 ]
1150 } 1194 }
1151 } 1195 }
OLDNEW
« no previous file with comments | « no previous file | chrome/app/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698