Commit ca254112 authored by peter@chromium.org's avatar peter@chromium.org

Introduce the --sdk-build flag for Android's native test generator

This flag supersedes --ant-compile and takes its value from gyp's sdk_build
variable. It will tell the native test generator script to use Ant for Java
compilation (default) instead of the Android.mk file.
    
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10821128

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149440 0039d316-1c4b-4281-b951-d872f2087c98
parent 3ff0ff79
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
'<(android_app_abi)', '<(android_app_abi)',
'--ant-args', '--ant-args',
'-DPRODUCT_DIR=<(ant_build_out)', '-DPRODUCT_DIR=<(ant_build_out)',
'--ant-compile' '--sdk-build=<(sdk_build)',
], ],
}], }],
}], # 'OS == "android" and gtest_target_type == "shared_library" }], # 'OS == "android" and gtest_target_type == "shared_library"
......
...@@ -128,9 +128,9 @@ class NativeTestApkGenerator(object): ...@@ -128,9 +128,9 @@ class NativeTestApkGenerator(object):
logging.warn('%s --> %s', jar, dest) logging.warn('%s --> %s', jar, dest)
shutil.copyfile(jar, dest) shutil.copyfile(jar, dest)
def CreateBundle(self, ant_compile): def CreateBundle(self, sdk_build):
"""Create the apk bundle source and assemble components.""" """Create the apk bundle source and assemble components."""
if not ant_compile: if not sdk_build:
self._SOURCE_FILES.append('Android.mk') self._SOURCE_FILES.append('Android.mk')
self._REPLACEME_FILES.append('Android.mk') self._REPLACEME_FILES.append('Android.mk')
self._CopyTemplateFilesAndClearDir() self._CopyTemplateFilesAndClearDir()
...@@ -180,6 +180,11 @@ def main(argv): ...@@ -180,6 +180,11 @@ def main(argv):
help='Output directory for generated files.') help='Output directory for generated files.')
parser.add_option('--app_abi', default='armeabi', parser.add_option('--app_abi', default='armeabi',
help='ABI for native shared library') help='ABI for native shared library')
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 '
'source tree using Android.mk.')
# FIXME(beverloo): Remove --ant-compile when all users adopted.
parser.add_option('--ant-compile', action='store_true', parser.add_option('--ant-compile', action='store_true',
help=('If specified, build the generated apk with ant. ' help=('If specified, build the generated apk with ant. '
'Otherwise assume compiling within the Android ' 'Otherwise assume compiling within the Android '
...@@ -207,9 +212,9 @@ def main(argv): ...@@ -207,9 +212,9 @@ def main(argv):
jars=jar_list, jars=jar_list,
output_directory=options.output, output_directory=options.output,
target_abi=options.app_abi) target_abi=options.app_abi)
ntag.CreateBundle(options.ant_compile) ntag.CreateBundle(options.sdk_build or options.ant_compile)
if options.ant_compile: if options.sdk_build or options.ant_compile:
ntag.Compile(options.ant_args) ntag.Compile(options.ant_args)
else: else:
ntag.CompileAndroidMk() ntag.CompileAndroidMk()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment