OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # On Android we build unit test bundles as shared libraries. To run | 6 # On Android we build unit test bundles as shared libraries. To run |
7 # tests, we launch a special "test runner" apk which loads the library | 7 # tests, we launch a special "test runner" apk which loads the library |
8 # then jumps into it. Since java is required for many tests | 8 # then jumps into it. Since java is required for many tests |
9 # (e.g. PathUtils.java), a "pure native" test bundle is inadequate. | 9 # (e.g. PathUtils.java), a "pure native" test bundle is inadequate. |
10 # | 10 # |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 raise Exception('No output directory specified for generated files') | 204 raise Exception('No output directory specified for generated files') |
205 | 205 |
206 if options.verbose: | 206 if options.verbose: |
207 logging.basicConfig(level=logging.DEBUG, format=' %(message)s') | 207 logging.basicConfig(level=logging.DEBUG, format=' %(message)s') |
208 | 208 |
209 # Remove all quotes from the jars string | 209 # Remove all quotes from the jars string |
210 jar_list = [] | 210 jar_list = [] |
211 if options.jars: | 211 if options.jars: |
212 jar_list = options.jars.replace('"', '').split() | 212 jar_list = options.jars.replace('"', '').split() |
213 | 213 |
214 # Ignore --ant-compile when building with Android source. | |
215 if 'ANDROID_BUILD_TOP' in os.environ: | |
216 options.ant_compile = False | |
217 | |
218 ntag = NativeTestApkGenerator(native_library=options.native_library, | 214 ntag = NativeTestApkGenerator(native_library=options.native_library, |
219 jars=jar_list, | 215 jars=jar_list, |
220 output_directory=options.output, | 216 output_directory=options.output, |
221 target_abi=options.app_abi) | 217 target_abi=options.app_abi) |
222 ntag.CreateBundle(options.ant_compile) | 218 ntag.CreateBundle(options.ant_compile) |
223 | 219 |
224 if options.ant_compile: | 220 if options.ant_compile: |
225 ntag.Compile(options.ant_args) | 221 ntag.Compile(options.ant_args) |
226 else: | 222 else: |
227 ntag.CompileAndroidMk() | 223 ntag.CompileAndroidMk() |
228 | 224 |
229 logging.warn('COMPLETE.') | 225 logging.warn('COMPLETE.') |
230 | 226 |
231 if __name__ == '__main__': | 227 if __name__ == '__main__': |
232 sys.exit(main(sys.argv)) | 228 sys.exit(main(sys.argv)) |
OLD | NEW |