Chromium Code Reviews| Index: testing/android/generate_native_test.py |
| diff --git a/testing/android/generate_native_test.py b/testing/android/generate_native_test.py |
| index 153403bd611f52d0dc8ac70be82edd7176461a8f..4ba16bd74ce55afa1e13ece93b275f0f080584be 100755 |
| --- a/testing/android/generate_native_test.py |
| +++ b/testing/android/generate_native_test.py |
| @@ -18,7 +18,6 @@ import logging |
| import optparse |
| import os |
| import re |
| -import shutil |
| import subprocess |
| import sys |
| @@ -52,10 +51,9 @@ class NativeTestApkGenerator(object): |
| 'native_test_apk.xml', |
| 'res/values/strings.xml'] |
| - def __init__(self, native_library, jars, strip_binary, output_directory, |
| + def __init__(self, native_library, strip_binary, output_directory, |
| target_abi): |
| self._native_library = native_library |
| - self._jars = jars |
| self._strip_binary = strip_binary |
| self._output_directory = os.path.abspath(output_directory) |
| self._target_abi = target_abi |
| @@ -110,8 +108,8 @@ class NativeTestApkGenerator(object): |
| dest = dest.replace('replaceme', self._root_name) # update the filename! |
| open(dest, 'w').write(contents) |
| - def _CopyLibraryAndJars(self): |
| - """Copy the shlib and jars into the apk source tree (if relevant).""" |
| + def _CopyLibrary(self): |
| + """Copy the shlib into the apk source tree (if relevant).""" |
| if self._native_library: |
| destdir = os.path.join(self._output_directory, 'libs/' + self._target_abi) |
| if not os.path.exists(destdir): |
| @@ -121,20 +119,12 @@ class NativeTestApkGenerator(object): |
| cmd_helper.RunCmd( |
| [self._strip_binary, '--strip-unneeded', self._native_library, '-o', |
| dest]) |
| - if self._jars: |
| - destdir = os.path.join(self._output_directory, 'java/libs') |
| - if not os.path.exists(destdir): |
| - os.makedirs(destdir) |
| - for jar in self._jars: |
| - dest = os.path.join(destdir, os.path.basename(jar)) |
| - logging.warn('%s --> %s', jar, dest) |
| - shutil.copyfile(jar, dest) |
| def CreateBundle(self): |
| """Create the apk bundle source and assemble components.""" |
| self._CopyTemplateFilesAndClearDir() |
| self._ReplaceStrings() |
| - self._CopyLibraryAndJars() |
| + self._CopyLibrary() |
| def Compile(self, ant_args): |
| """Build the generated apk with ant. |
| @@ -193,9 +183,10 @@ def main(argv): |
| jar_list = [] |
| if options.jars: |
| jar_list = options.jars.replace('"', '').split() |
| + options.ant_args.append('-DINPUT_JARS_PATHS=' + " ".join(jar_list)) |
|
nilesh
2012/12/04 17:24:44
Please add a comment here.
|
| + |
| ntag = NativeTestApkGenerator(native_library=options.native_library, |
| - jars=jar_list, |
| strip_binary=options.strip_binary, |
| output_directory=options.output, |
| target_abi=options.app_abi) |