Autotest: fixes to compile_gwt_clients.
* Added another directory to check for the gwt installation as that's
where it will be installed in the chroot.
* Fixed the extra java args position so they are passed to the java and
not the gwt application.
* Fixed extra_args piping.
BUG=chromium:345023
Test=ensured I can still run compile_gwt_clients and I can build with it
in an ebuild.
Change-Id: I799ff93669f21b94d4c216cb756898dcb6d779d7
Reviewed-on: https://chromium-review.googlesource.com/187292
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
diff --git a/utils/compile_gwt_clients.py b/utils/compile_gwt_clients.py
index e9aa86a..9f83a1b 100755
--- a/utils/compile_gwt_clients.py
+++ b/utils/compile_gwt_clients.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
import common
-import sys, os, shutil, errno, optparse, logging
+import sys, os, shutil, optparse, logging
from autotest_lib.client.common_lib import error, utils
from autotest_lib.client.common_lib import logging_config, logging_manager
"""
@@ -8,16 +8,16 @@
"""
_AUTOTEST_DIR = common.autotest_dir
-_DEFAULT_GWT_DIR = '/usr/local/lib/gwt'
+_DEFAULT_GWT_DIRS = ['/usr/local/lib/gwt', '/opt/google-web-toolkit']
_DEFAULT_APP_DIR = os.path.join(_AUTOTEST_DIR, 'frontend/client')
_DEFAULT_INSTALL_DIR = os.path.join(_DEFAULT_APP_DIR, 'www')
_TMP_COMPILE_DIR = _DEFAULT_INSTALL_DIR + '.new'
-_COMPILE_LINE = ('java -Xmx512M '
+_COMPILE_LINE = ('java -Xmx512M %(extra_args)s '
'-cp "%(app_dir)s/src:%(app_dir)s/bin:%(gwt_dir)s/gwt-user.jar'
':%(gwt_dir)s/gwt-dev.jar" -Djava.awt.headless=true '
'com.google.gwt.dev.Compiler -war "%(compile_dir)s" '
- '%(extra_args)s %(project_client)s')
+ '%(project_client)s')
class CompileClientsLoggingConfig(logging_config.LoggingConfig):
def configure_logging(self, results_dir=None, verbose=False):
@@ -40,19 +40,17 @@
def find_gwt_dir():
"""See if GWT is installed in site-packages or in the system,
- site-packages is favored over a system install.
+ site-packages is favored over a system install or a /usr/local install.
"""
site_gwt = os.path.join(_AUTOTEST_DIR, 'site-packages', 'gwt')
+ gwt_dirs = [site_gwt] + _DEFAULT_GWT_DIRS
- if os.path.isdir(site_gwt):
- return site_gwt
-
- if not os.path.isdir(_DEFAULT_GWT_DIR):
- logging.error('Unable to find GWT. '
- 'You can use utils/build_externals.py to install it.')
- sys.exit(1)
-
- return _DEFAULT_GWT_DIR
+ for gwt_dir in gwt_dirs:
+ if os.path.isdir(gwt_dir):
+ return gwt_dir
+ logging.error('Unable to find GWT. '
+ 'You can use utils/build_externals.py to install it.')
+ sys.exit(1)
def install_completed_client(compiled_dir, project_client):
@@ -119,7 +117,7 @@
return False
-def compile_all_projects(projects, extra_args=''):
+def compile_all_projects(extra_args=''):
"""Compile all projects available as defined by enumerate_projects.
@returns list of failed client installations
"""