summaryrefslogtreecommitdiffstats
path: root/testing/android
diff options
context:
space:
mode:
authorpeter@chromium.org <peter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-16 13:52:04 +0000
committerpeter@chromium.org <peter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-16 13:52:04 +0000
commitc0f76313bfdf49191ec71528809dd1a4b73f42ba (patch)
treebe00ad529cb2b4d7a9cfec9245fbe56e5bcea799 /testing/android
parent2713a5228b2612abbd176ae0ae6be1c8311917dc (diff)
downloadchromium_src-c0f76313bfdf49191ec71528809dd1a4b73f42ba.zip
chromium_src-c0f76313bfdf49191ec71528809dd1a4b73f42ba.tar.gz
chromium_src-c0f76313bfdf49191ec71528809dd1a4b73f42ba.tar.bz2
Remove the dependency on the STRIP env variable for Android
Android builds currently rely on the STRIP environment variable to be available during build time, rather than just at project generation time. It shouldn't. BUG=142642 Review URL: https://chromiumcodereview.appspot.com/10832295 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151886 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing/android')
-rwxr-xr-xtesting/android/generate_native_test.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/testing/android/generate_native_test.py b/testing/android/generate_native_test.py
index c100380..aff4f70 100755
--- a/testing/android/generate_native_test.py
+++ b/testing/android/generate_native_test.py
@@ -52,9 +52,11 @@ class NativeTestApkGenerator(object):
'native_test_apk.xml',
'res/values/strings.xml']
- def __init__(self, native_library, jars, output_directory, target_abi):
+ def __init__(self, native_library, jars, 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
self._root_name = None
@@ -116,9 +118,9 @@ class NativeTestApkGenerator(object):
os.makedirs(destdir)
dest = os.path.join(destdir, os.path.basename(self._native_library))
logging.warn('strip %s --> %s', self._native_library, dest)
- strip = os.environ['STRIP']
cmd_helper.RunCmd(
- [strip, '--strip-unneeded', self._native_library, '-o', dest])
+ [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):
@@ -180,6 +182,8 @@ def main(argv):
help='Output directory for generated files.')
parser.add_option('--app_abi', default='armeabi',
help='ABI for native shared library')
+ parser.add_option('--strip-binary',
+ help='Binary to use for stripping the native libraries.')
parser.add_option('--sdk-build', type='int', default=1,
help='Unless set to 0, build the generated apk with ant. '
'Otherwise assume compiling within the Android '
@@ -198,6 +202,11 @@ def main(argv):
if options.verbose:
logging.basicConfig(level=logging.DEBUG, format=' %(message)s')
+ if not options.strip_binary:
+ options.strip_binary = os.getenv('STRIP')
+ if not options.strip_binary:
+ raise Exception('No tool for stripping the libraries has been supplied')
+
# Remove all quotes from the jars string
jar_list = []
if options.jars:
@@ -205,6 +214,7 @@ def main(argv):
ntag = NativeTestApkGenerator(native_library=options.native_library,
jars=jar_list,
+ strip_binary=options.strip_binary,
output_directory=options.output,
target_abi=options.app_abi)
ntag.CreateBundle(options.sdk_build)