OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # On Android we build unit test bundles as shared libraries. To run | 7 # On Android we build unit test bundles as shared libraries. To run |
8 # tests, we launch a special "test runner" apk which loads the library | 8 # tests, we launch a special "test runner" apk which loads the library |
9 # then jumps into it. Since java is required for many tests | 9 # then jumps into it. Since java is required for many tests |
10 # (e.g. PathUtils.java), a "pure native" test bundle is inadequate. | 10 # (e.g. PathUtils.java), a "pure native" test bundle is inadequate. |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 if self._native_library: | 113 if self._native_library: |
114 destdir = os.path.join(self._output_directory, 'libs/' + self._target_abi) | 114 destdir = os.path.join(self._output_directory, 'libs/' + self._target_abi) |
115 if not os.path.exists(destdir): | 115 if not os.path.exists(destdir): |
116 os.makedirs(destdir) | 116 os.makedirs(destdir) |
117 dest = os.path.join(destdir, os.path.basename(self._native_library)) | 117 dest = os.path.join(destdir, os.path.basename(self._native_library)) |
118 logging.warn('strip %s --> %s', self._native_library, dest) | 118 logging.warn('strip %s --> %s', self._native_library, dest) |
119 strip = os.environ['STRIP'] | 119 strip = os.environ['STRIP'] |
120 cmd_helper.RunCmd( | 120 cmd_helper.RunCmd( |
121 [strip, '--strip-unneeded', self._native_library, '-o', dest]) | 121 [strip, '--strip-unneeded', self._native_library, '-o', dest]) |
122 if self._jars: | 122 if self._jars: |
123 destdir = os.path.join(self._output_directory, 'libs') | 123 destdir = os.path.join(self._output_directory, 'java/libs') |
124 if not os.path.exists(destdir): | 124 if not os.path.exists(destdir): |
125 os.makedirs(destdir) | 125 os.makedirs(destdir) |
126 for jar in self._jars: | 126 for jar in self._jars: |
127 dest = os.path.join(destdir, os.path.basename(jar)) | 127 dest = os.path.join(destdir, os.path.basename(jar)) |
128 logging.warn('%s --> %s', jar, dest) | 128 logging.warn('%s --> %s', jar, dest) |
129 shutil.copyfile(jar, dest) | 129 shutil.copyfile(jar, dest) |
130 | 130 |
131 def CreateBundle(self, ant_compile): | 131 def CreateBundle(self, ant_compile): |
132 """Create the apk bundle source and assemble components.""" | 132 """Create the apk bundle source and assemble components.""" |
133 if not ant_compile: | 133 if not ant_compile: |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 if options.ant_compile: | 212 if options.ant_compile: |
213 ntag.Compile(options.ant_args) | 213 ntag.Compile(options.ant_args) |
214 else: | 214 else: |
215 ntag.CompileAndroidMk() | 215 ntag.CompileAndroidMk() |
216 | 216 |
217 logging.warn('COMPLETE.') | 217 logging.warn('COMPLETE.') |
218 | 218 |
219 if __name__ == '__main__': | 219 if __name__ == '__main__': |
220 sys.exit(main(sys.argv)) | 220 sys.exit(main(sys.argv)) |
OLD | NEW |