2015-09-16 01:16:03 +03:00
|
|
|
# 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.
|
|
|
|
|
2018-11-30 07:55:56 +03:00
|
|
|
import("python.gni")
|
|
|
|
|
2015-09-16 01:16:03 +03:00
|
|
|
# Creates a zip archive of the inputs.
|
2016-01-30 02:23:10 +03:00
|
|
|
#
|
2018-11-29 23:51:26 +03:00
|
|
|
# output (required)
|
2018-11-30 07:55:56 +03:00
|
|
|
# Path to output zip.
|
|
|
|
# inputs (required)
|
|
|
|
# List of input files to zip.
|
2016-01-30 02:23:10 +03:00
|
|
|
# base_dir (optional)
|
|
|
|
# If provided, the archive paths will be relative to this directory.
|
2018-11-30 07:55:56 +03:00
|
|
|
# Applies only to |inputs|.
|
2016-01-30 02:23:10 +03:00
|
|
|
#
|
2018-11-30 07:55:56 +03:00
|
|
|
# deps, public_deps, data, data_deps, testonly, visibility
|
2016-01-30 02:23:10 +03:00
|
|
|
# Normal meaning.
|
2015-09-16 01:16:03 +03:00
|
|
|
template("zip") {
|
2018-11-30 07:55:56 +03:00
|
|
|
action_with_pydeps(target_name) {
|
|
|
|
forward_variables_from(invoker,
|
|
|
|
[
|
|
|
|
"data",
|
|
|
|
"data_deps",
|
|
|
|
"deps",
|
|
|
|
"public_deps",
|
|
|
|
"testonly",
|
|
|
|
"visibility",
|
|
|
|
])
|
|
|
|
script = "//build/android/gyp/zip.py"
|
2015-09-16 01:16:03 +03:00
|
|
|
inputs = invoker.inputs
|
|
|
|
outputs = [
|
|
|
|
invoker.output,
|
|
|
|
]
|
2016-01-30 02:23:10 +03:00
|
|
|
|
2015-09-16 01:16:03 +03:00
|
|
|
args = [
|
2018-11-30 07:55:56 +03:00
|
|
|
"--output",
|
|
|
|
rebase_path(invoker.output, root_build_dir),
|
2015-09-16 01:16:03 +03:00
|
|
|
]
|
2018-11-30 07:55:56 +03:00
|
|
|
|
|
|
|
_rebased_inputs = rebase_path(invoker.inputs, root_build_dir)
|
|
|
|
args += [ "--input-files=$_rebased_inputs" ]
|
2015-09-16 01:16:03 +03:00
|
|
|
if (defined(invoker.base_dir)) {
|
|
|
|
args += [
|
2018-11-30 07:55:56 +03:00
|
|
|
"--input-files-base-dir",
|
2015-09-16 01:16:03 +03:00
|
|
|
rebase_path(invoker.base_dir, root_build_dir),
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|