Roll src/third_party/WebKit e0eac24:489c548 (svn 193311:193320)
[chromium-blink-merge.git] / build / android / gyp / create_dist_jar.py
blob0d31c5db93f5c8329df40842871719b843d3848d
1 #!/usr/bin/env python
3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
7 """Merges a list of jars into a single jar."""
9 import optparse
10 import sys
12 from util import build_utils
14 def main(args):
15 args = build_utils.ExpandFileArgs(args)
16 parser = optparse.OptionParser()
17 build_utils.AddDepfileOption(parser)
18 parser.add_option('--output', help='Path to output jar.')
19 parser.add_option('--inputs', action='append', help='List of jar inputs.')
20 options, _ = parser.parse_args(args)
21 build_utils.CheckOptions(options, parser, ['output', 'inputs'])
23 input_jars = []
24 for inputs_arg in options.inputs:
25 input_jars.extend(build_utils.ParseGypList(inputs_arg))
27 build_utils.MergeZips(options.output, input_jars)
29 if options.depfile:
30 build_utils.WriteDepfile(
31 options.depfile,
32 input_jars + build_utils.GetPythonDependencies())
35 if __name__ == '__main__':
36 sys.exit(main(sys.argv[1:]))