diff options
author | mostynb <mostynb@opera.com> | 2015-09-15 15:16:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-15 22:16:32 +0000 |
commit | 3dba3175c9f137742ddb10dbe9a10a5417186402 (patch) | |
tree | 424e509aaeda12f2765dc978c3b7040e1b200c89 | |
parent | 895c6c35457b7fe13da31e862cd50eb537d5e7e6 (diff) | |
download | chromium_src-3dba3175c9f137742ddb10dbe9a10a5417186402.zip chromium_src-3dba3175c9f137742ddb10dbe9a10a5417186402.tar.gz chromium_src-3dba3175c9f137742ddb10dbe9a10a5417186402.tar.bz2 |
move zip template to a non-android-specific .gni file
The zip template really isn't android-specific, let's move it to its
own .gni file which doesn't assert(is_android).
Review URL: https://codereview.chromium.org/1345733002
Cr-Commit-Position: refs/heads/master@{#349016}
-rw-r--r-- | build/config/android/internal_rules.gni | 41 | ||||
-rw-r--r-- | build/config/zip.gni | 53 |
2 files changed, 54 insertions, 40 deletions
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni index 1103cf3..8e2cb0f 100644 --- a/build/config/android/internal_rules.gni +++ b/build/config/android/internal_rules.gni @@ -3,6 +3,7 @@ # found in the LICENSE file. import("//build/config/android/config.gni") +import("//build/config/zip.gni") import("//third_party/ijar/ijar.gni") assert(is_android) @@ -212,46 +213,6 @@ template("dex") { } } -# Creates a zip archive of the inputs. -# If base_dir is provided, the archive paths will be relative to it. -template("zip") { - set_sources_assignment_filter([]) - assert(defined(invoker.inputs)) - assert(defined(invoker.output)) - - rebase_inputs = rebase_path(invoker.inputs, root_build_dir) - rebase_output = rebase_path(invoker.output, root_build_dir) - action(target_name) { - forward_variables_from(invoker, - [ - "data_deps", - "deps", - "public_deps", - "inputs", - "testonly", - "visibility", - ]) - script = "//build/android/gn/zip.py" - depfile = "$target_gen_dir/$target_name.d" - outputs = [ - depfile, - invoker.output, - ] - args = [ - "--depfile", - rebase_path(depfile, root_build_dir), - "--inputs=$rebase_inputs", - "--output=$rebase_output", - ] - if (defined(invoker.base_dir)) { - args += [ - "--base-dir", - rebase_path(invoker.base_dir, root_build_dir), - ] - } - } -} - # Write the target's .build_config file. This is a json file that contains a # dictionary of information about how to build this target (things that # require knowledge about this target's dependencies and cannot be calculated diff --git a/build/config/zip.gni b/build/config/zip.gni new file mode 100644 index 0000000..dd5cb01 --- /dev/null +++ b/build/config/zip.gni @@ -0,0 +1,53 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Creates a zip archive of the inputs. +# If base_dir is provided, the archive paths will be relative to it. +template("zip") { + set_sources_assignment_filter([]) + if (defined(invoker.testonly)) { + testonly = invoker.testonly + } + + assert(defined(invoker.inputs)) + assert(defined(invoker.output)) + + rebase_inputs = rebase_path(invoker.inputs, root_build_dir) + rebase_output = rebase_path(invoker.output, root_build_dir) + action(target_name) { + script = "//build/android/gn/zip.py" + depfile = "$target_gen_dir/$target_name.d" + inputs = invoker.inputs + outputs = [ + depfile, + invoker.output, + ] + args = [ + "--depfile", + rebase_path(depfile, root_build_dir), + "--inputs=$rebase_inputs", + "--output=$rebase_output", + ] + if (defined(invoker.base_dir)) { + args += [ + "--base-dir", + rebase_path(invoker.base_dir, root_build_dir), + ] + } + + if (defined(invoker.deps)) { + deps = invoker.deps + } + if (defined(invoker.public_deps)) { + public_deps = invoker.public_deps + } + if (defined(invoker.data_deps)) { + data_deps = invoker.data_deps + } + + if (defined(invoker.visibility)) { + visibility = invoker.visibility + } + } +} |