Chromium Code Reviews| Index: build/config/android/internal_rules.gni |
| diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni |
| index 2034ca836c0c43d3b9b049512cff27e0b516aada..d68125ac505e693378abcd4094a98a31c91fe2be 100644 |
| --- a/build/config/android/internal_rules.gni |
| +++ b/build/config/android/internal_rules.gni |
| @@ -23,13 +23,12 @@ rebased_android_sdk_build_tools = rebase_path(android_sdk_build_tools, root_buil |
| # build/android/gyp/util/build_utils.py:ExpandFileArgs |
| template("write_build_config") { |
| assert(defined(invoker.type)) |
| - assert(defined(invoker.base_path)) |
| + assert(defined(invoker.build_config)) |
| - base_path = invoker.base_path |
| type = invoker.type |
| - build_config = base_path + ".build_config" |
| + build_config = invoker.build_config |
| - assert(type == "android_binary" || type == "android_library" || type == "android_resources") |
| + assert(type == "android_apk" || type == "android_library" || type == "android_resources") |
| action(target_name) { |
| script = "//build/android/gyp/write_build_config.py" |
| @@ -52,6 +51,7 @@ template("write_build_config") { |
| possible_deps_configs += [ "$dep_gen_dir/$dep_name.build_config" ] |
| } |
| rebase_possible_deps_configs = rebase_path(possible_deps_configs) |
| + |
| args = [ |
| "--type", type, |
| "--depfile", rebase_path(depfile, root_build_dir), |
| @@ -59,23 +59,23 @@ template("write_build_config") { |
| "--build-config", rebase_path(build_config, root_build_dir), |
| ] |
| - if (type == "android_library") { |
| - jar_path = base_path + ".jar" |
| + if (type == "android_library" || type == "android_apk") { |
| args += [ |
| - "--jar-path", rebase_path(jar_path, root_build_dir), |
| + "--jar-path", rebase_path(invoker.jar_path, root_build_dir), |
| ] |
| } |
| - if (type == "android_resources") { |
| + if (type == "android_resources" || type == "android_apk") { |
| assert(defined(invoker.resources_zip)) |
| args += [ |
| "--resources-zip", rebase_path(invoker.resources_zip, root_build_dir), |
| ] |
| - if (defined(invoker.srcjar)) { |
| - args += [ |
| - "--srcjar", rebase_path(invoker.srcjar, root_build_dir) |
| - ] |
| - } |
| + } |
| + |
| + if (defined(invoker.srcjar)) { |
| + args += [ |
| + "--srcjar", rebase_path(invoker.srcjar, root_build_dir) |
| + ] |
| } |
| } |
| } |
| @@ -110,7 +110,6 @@ template("zip") { |
| } |
| } |
| - |
| # Compiles and jars a set of java files. |
| # |
| # Outputs: |
| @@ -229,17 +228,17 @@ template("java_library") { |
| # Dexes the output jar for inclusion in an APK. |
| template("android_java_library") { |
| assert(defined(invoker.java_files)) |
| - |
| assert(defined(invoker.build_config)) |
| assert(defined(invoker.jar_path)) |
| + jar_path = invoker.jar_path |
|
newt (away)
2014/07/17 20:11:47
is jar_path still visible to the java_library temp
cjhopman
2014/07/18 00:58:01
It is. As discussed, I've changed it to make it mo
|
| + |
| java_library("${target_name}__java_library") { |
| if (defined(invoker.jar_excluded_patterns)) { |
| jar_excluded_patterns = invoker.jar_excluded_patterns |
| } |
| build_config = invoker.build_config |
| java_files = invoker.java_files |
| - jar_path = invoker.jar_path |
| if (defined(invoker.srcjar_deps)) { |
| srcjar_deps = invoker.srcjar_deps |
| @@ -265,6 +264,11 @@ template("process_resources") { |
| resource_dirs = invoker.resource_dirs |
| android_manifest = invoker.android_manifest |
| + non_constant_id = true |
| + if (defined(invoker.generate_constant_ids) && invoker.generate_constant_ids) { |
| + non_constant_id = false |
| + } |
| + |
| action(target_name) { |
| script = "//build/android/gyp/process_resources.py" |
| @@ -293,7 +297,6 @@ template("process_resources") { |
| "--depfile", rebase_path(depfile, root_build_dir), |
| "--android-sdk", rebase_path(android_sdk, root_build_dir), |
| "--android-sdk-tools", rebase_path(android_sdk_build_tools, root_build_dir), |
| - "--non-constant-id", |
| "--android-manifest", rebase_path(android_manifest, root_build_dir), |
| "--resource-dirs=$rebase_resource_dirs", |
| @@ -303,6 +306,10 @@ template("process_resources") { |
| "--dependencies-res-zips=@FileArg($rebase_build_config:resources:dependency_zips)", |
| ] |
| + if (non_constant_id) { |
| + args += [ "--non-constant-id" ] |
| + } |
| + |
| if (defined(invoker.custom_package)) { |
| args += [ |
| "--custom-package", invoker.custom_package, |
| @@ -312,5 +319,17 @@ template("process_resources") { |
| if (defined(invoker.v14_verify_only) && invoker.v14_verify_only) { |
| args += ["--v14-verify-only"] |
| } |
| + |
| + if (defined(invoker.all_resources_zip_path)) { |
| + all_resources_zip = invoker.all_resources_zip_path |
| + outputs += [ all_resources_zip ] |
| + args += [ |
| + "--all-resources-zip-out", rebase_path(all_resources_zip, root_build_dir) |
| + ] |
| + } |
| + |
| + if (defined(invoker.args)) { |
| + args += invoker.args |
| + } |
| } |
| } |