Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / build / android / gyp / aidl.py
blobd5aa5467709fdd7d522f755f41f94b1e312578ab
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 """Invokes Android's aidl
8 """
10 import optparse
11 import os
12 import sys
14 from util import build_utils
17 def main(argv):
18 option_parser = optparse.OptionParser()
19 build_utils.AddDepfileOption(option_parser)
20 option_parser.add_option('--aidl-path', help='Path to the aidl binary.')
21 option_parser.add_option('--imports', help='Files to import.')
22 option_parser.add_option('--includes',
23 help='Directories to add as import search paths.')
24 option_parser.add_option('--srcjar', help='Path for srcjar output.')
25 options, args = option_parser.parse_args(argv[1:])
27 with build_utils.TempDir() as temp_dir:
28 for f in args:
29 classname = os.path.splitext(os.path.basename(f))[0]
30 output = os.path.join(temp_dir, classname + '.java')
31 aidl_cmd = [options.aidl_path]
32 aidl_cmd += [
33 '-p' + s for s in build_utils.ParseGypList(options.imports)
35 if options.includes is not None:
36 aidl_cmd += [
37 '-I' + s for s in build_utils.ParseGypList(options.includes)
39 aidl_cmd += [
41 output
43 build_utils.CheckOutput(aidl_cmd)
45 build_utils.ZipDir(options.srcjar, temp_dir)
47 if options.depfile:
48 build_utils.WriteDepfile(
49 options.depfile,
50 build_utils.GetPythonDependencies())
53 if __name__ == '__main__':
54 sys.exit(main(sys.argv))