mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1464869 - autopep8 on mobile/ r=nalexander
MozReview-Commit-ID: HtIcv2IeDMy --HG-- extra : rebase_source : e228c0b96309240555baebb5ba523ad842e6c05e
This commit is contained in:
parent
c311ea67ca
commit
4bf3bc91da
@ -92,7 +92,8 @@ def _defines():
|
||||
DEFINES[var] = CONFIG[var]
|
||||
|
||||
# Mangle our package name to avoid Bug 750548.
|
||||
DEFINES['MANGLED_ANDROID_PACKAGE_NAME'] = CONFIG['ANDROID_PACKAGE_NAME'].replace('fennec', 'f3nn3c')
|
||||
DEFINES['MANGLED_ANDROID_PACKAGE_NAME'] = CONFIG['ANDROID_PACKAGE_NAME'].replace(
|
||||
'fennec', 'f3nn3c')
|
||||
DEFINES['MOZ_APP_ABI'] = CONFIG['TARGET_XPCOM_ABI']
|
||||
if not CONFIG['COMPILE_ENVIRONMENT']:
|
||||
# These should really come from the included binaries, but that's not easy.
|
||||
@ -111,7 +112,8 @@ def _defines():
|
||||
if CONFIG['MOZ_ANDROID_POCKET']:
|
||||
DEFINES['MOZ_POCKET_API_KEY'] = CONFIG['MOZ_POCKET_API_KEY']
|
||||
|
||||
DEFINES['MOZ_BUILDID'] = open(os.path.join(buildconfig.topobjdir, 'buildid.h')).readline().split()[2]
|
||||
DEFINES['MOZ_BUILDID'] = open(os.path.join(
|
||||
buildconfig.topobjdir, 'buildid.h')).readline().split()[2]
|
||||
|
||||
# Set the appropriate version code if not set by MOZ_APP_ANDROID_VERSION_CODE.
|
||||
if CONFIG.get('MOZ_APP_ANDROID_VERSION_CODE'):
|
||||
@ -131,9 +133,9 @@ def _defines():
|
||||
|
||||
def generate_java(output_file, input_filename):
|
||||
includes = preprocessor.preprocess(includes=[input_filename],
|
||||
defines=_defines(),
|
||||
output=output_file,
|
||||
marker='//#')
|
||||
defines=_defines(),
|
||||
output=output_file,
|
||||
marker='//#')
|
||||
includes.add(os.path.join(buildconfig.topobjdir, 'buildid.h'))
|
||||
return includes
|
||||
|
||||
|
@ -34,6 +34,7 @@ class DebugKeystore:
|
||||
"""
|
||||
A thin abstraction on top of an Android debug key store.
|
||||
"""
|
||||
|
||||
def __init__(self, keystore):
|
||||
self._keystore = os.path.abspath(os.path.expanduser(keystore))
|
||||
self._alias = 'androiddebugkey'
|
||||
@ -61,12 +62,12 @@ class DebugKeystore:
|
||||
raise Exception("Could not find executable '%s'" % args[0])
|
||||
|
||||
def keystore_contains_alias(self):
|
||||
args = [ self.keytool,
|
||||
'-list',
|
||||
'-keystore', self.keystore,
|
||||
'-storepass', 'android',
|
||||
'-alias', self.alias,
|
||||
]
|
||||
args = [self.keytool,
|
||||
'-list',
|
||||
'-keystore', self.keystore,
|
||||
'-storepass', 'android',
|
||||
'-alias', self.alias,
|
||||
]
|
||||
if self.verbose:
|
||||
args.append('-v')
|
||||
contains = True
|
||||
@ -89,16 +90,16 @@ class DebugKeystore:
|
||||
if exception.errno != errno.EEXIST:
|
||||
raise
|
||||
|
||||
args = [ self.keytool,
|
||||
'-genkeypair',
|
||||
'-keystore', self.keystore,
|
||||
'-storepass', 'android',
|
||||
'-alias', self.alias,
|
||||
'-keypass', 'android',
|
||||
'-dname', 'CN=Android Debug,O=Android,C=US',
|
||||
'-keyalg', 'RSA',
|
||||
'-validity', '365',
|
||||
]
|
||||
args = [self.keytool,
|
||||
'-genkeypair',
|
||||
'-keystore', self.keystore,
|
||||
'-storepass', 'android',
|
||||
'-alias', self.alias,
|
||||
'-keypass', 'android',
|
||||
'-dname', 'CN=Android Debug,O=Android,C=US',
|
||||
'-keyalg', 'RSA',
|
||||
'-validity', '365',
|
||||
]
|
||||
if self.verbose:
|
||||
args.append('-v')
|
||||
self._check(args)
|
||||
@ -110,14 +111,14 @@ class DebugKeystore:
|
||||
if not self.keystore_contains_alias():
|
||||
self.create_alias_in_keystore()
|
||||
|
||||
args = [ self.jarsigner,
|
||||
'-digestalg', 'SHA1',
|
||||
'-sigalg', 'MD5withRSA',
|
||||
'-keystore', self.keystore,
|
||||
'-storepass', 'android',
|
||||
apk,
|
||||
self.alias,
|
||||
]
|
||||
args = [self.jarsigner,
|
||||
'-digestalg', 'SHA1',
|
||||
'-sigalg', 'MD5withRSA',
|
||||
'-keystore', self.keystore,
|
||||
'-storepass', 'android',
|
||||
apk,
|
||||
self.alias,
|
||||
]
|
||||
if self.verbose:
|
||||
args.append('-verbose')
|
||||
self._check(args)
|
||||
@ -183,5 +184,6 @@ def main():
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
|
@ -182,14 +182,14 @@ htmlhelp_basename = 'FirefoxforAndroiddoc'
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
# 'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
# 'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
# 'preamble': '',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
|
@ -7,68 +7,69 @@ reported and l10n-merged.
|
||||
This needs to stay in sync with the copy in mobile/locales.
|
||||
"""
|
||||
|
||||
def test(mod, path, entity = None):
|
||||
import re
|
||||
# ignore anything but mobile, which is our local repo checkout name
|
||||
if mod not in ("dom", "toolkit", "mobile",
|
||||
"mobile/android/base", "mobile/android"):
|
||||
return "ignore"
|
||||
|
||||
if mod == "toolkit":
|
||||
# keep this file list in sync with jar.mn
|
||||
if path in (
|
||||
"chrome/global/aboutAbout.dtd",
|
||||
"chrome/global/aboutReader.properties",
|
||||
"chrome/global/aboutRights.dtd",
|
||||
"chrome/global/charsetMenu.properties",
|
||||
"chrome/global/commonDialogs.properties",
|
||||
"chrome/global/intl.properties",
|
||||
"chrome/global/intl.css",
|
||||
"chrome/search/search.properties",
|
||||
"chrome/pluginproblem/pluginproblem.dtd",
|
||||
"chrome/global/aboutSupport.dtd",
|
||||
"chrome/global/aboutSupport.properties",
|
||||
"crashreporter/crashes.dtd",
|
||||
"crashreporter/crashes.properties",
|
||||
"chrome/global/mozilla.dtd",
|
||||
"chrome/global/aboutTelemetry.dtd",
|
||||
"chrome/global/aboutTelemetry.properties",
|
||||
"chrome/global/aboutWebrtc.properties"):
|
||||
return "error"
|
||||
return "ignore"
|
||||
|
||||
if mod == "dom":
|
||||
# keep this file list in sync with jar.mn
|
||||
if path in (
|
||||
"chrome/global.dtd",
|
||||
"chrome/accessibility/AccessFu.properties",
|
||||
"chrome/dom/dom.properties",
|
||||
"chrome/plugins.properties"):
|
||||
return "error"
|
||||
return "ignore"
|
||||
|
||||
if mod not in ("mobile", "mobile/android"):
|
||||
# we only have exceptions for mobile*
|
||||
return "error"
|
||||
if mod == "mobile/android":
|
||||
if entity is None:
|
||||
if (re.match(r"mobile-l10n.js", path) or
|
||||
re.match(r"defines.inc", path)):
|
||||
def test(mod, path, entity=None):
|
||||
import re
|
||||
# ignore anything but mobile, which is our local repo checkout name
|
||||
if mod not in ("dom", "toolkit", "mobile",
|
||||
"mobile/android/base", "mobile/android"):
|
||||
return "ignore"
|
||||
if path == "defines.inc":
|
||||
if entity == "MOZ_LANGPACK_CONTRIBUTORS":
|
||||
|
||||
if mod == "toolkit":
|
||||
# keep this file list in sync with jar.mn
|
||||
if path in (
|
||||
"chrome/global/aboutAbout.dtd",
|
||||
"chrome/global/aboutReader.properties",
|
||||
"chrome/global/aboutRights.dtd",
|
||||
"chrome/global/charsetMenu.properties",
|
||||
"chrome/global/commonDialogs.properties",
|
||||
"chrome/global/intl.properties",
|
||||
"chrome/global/intl.css",
|
||||
"chrome/search/search.properties",
|
||||
"chrome/pluginproblem/pluginproblem.dtd",
|
||||
"chrome/global/aboutSupport.dtd",
|
||||
"chrome/global/aboutSupport.properties",
|
||||
"crashreporter/crashes.dtd",
|
||||
"crashreporter/crashes.properties",
|
||||
"chrome/global/mozilla.dtd",
|
||||
"chrome/global/aboutTelemetry.dtd",
|
||||
"chrome/global/aboutTelemetry.properties",
|
||||
"chrome/global/aboutWebrtc.properties"):
|
||||
return "error"
|
||||
return "ignore"
|
||||
|
||||
if mod == "dom":
|
||||
# keep this file list in sync with jar.mn
|
||||
if path in (
|
||||
"chrome/global.dtd",
|
||||
"chrome/accessibility/AccessFu.properties",
|
||||
"chrome/dom/dom.properties",
|
||||
"chrome/plugins.properties"):
|
||||
return "error"
|
||||
return "ignore"
|
||||
|
||||
if mod not in ("mobile", "mobile/android"):
|
||||
# we only have exceptions for mobile*
|
||||
return "error"
|
||||
if mod == "mobile/android":
|
||||
if entity is None:
|
||||
if (re.match(r"mobile-l10n.js", path) or
|
||||
re.match(r"defines.inc", path)):
|
||||
return "ignore"
|
||||
if path == "defines.inc":
|
||||
if entity == "MOZ_LANGPACK_CONTRIBUTORS":
|
||||
return "ignore"
|
||||
return "error"
|
||||
|
||||
# we're in mod == "mobile"
|
||||
if path == "chrome/region.properties":
|
||||
# only region.properties exceptions remain
|
||||
if (re.match(r"browser\.search\.order\.[1-9]", entity) or
|
||||
re.match(r"browser\.search\.[a-zA-Z]+\.US", entity) or
|
||||
re.match(r"browser\.contentHandlers\.types\.[0-5]", entity) or
|
||||
re.match(r"gecko\.handlerService\.schemes\.", entity) or
|
||||
re.match(r"gecko\.handlerService\.defaultHandlersVersion", entity) or
|
||||
re.match(r"browser\.suggestedsites\.", entity)):
|
||||
return "ignore"
|
||||
|
||||
return "error"
|
||||
|
||||
# we're in mod == "mobile"
|
||||
if path == "chrome/region.properties":
|
||||
# only region.properties exceptions remain
|
||||
if (re.match(r"browser\.search\.order\.[1-9]", entity) or
|
||||
re.match(r"browser\.search\.[a-zA-Z]+\.US", entity) or
|
||||
re.match(r"browser\.contentHandlers\.types\.[0-5]", entity) or
|
||||
re.match(r"gecko\.handlerService\.schemes\.", entity) or
|
||||
re.match(r"gecko\.handlerService\.defaultHandlersVersion", entity) or
|
||||
re.match(r"browser\.suggestedsites\.", entity)):
|
||||
return "ignore"
|
||||
|
||||
return "error"
|
||||
|
@ -46,25 +46,24 @@ class MachCommands(MachCommandBase):
|
||||
else:
|
||||
return os.path.join(self.topobjdir, objdir)
|
||||
|
||||
|
||||
@Command('android', category='devenv',
|
||||
description='Run Android-specific commands.',
|
||||
conditions=[conditions.is_android])
|
||||
description='Run Android-specific commands.',
|
||||
conditions=[conditions.is_android])
|
||||
def android(self):
|
||||
pass
|
||||
|
||||
@SubCommand('android', 'assemble-app',
|
||||
"""Assemble Firefox for Android.
|
||||
"""Assemble Firefox for Android.
|
||||
See http://firefox-source-docs.mozilla.org/build/buildsystem/toolchains.html#firefox-for-android-with-gradle""")
|
||||
@CommandArgument('args', nargs=argparse.REMAINDER)
|
||||
def android_assemble_app(self, args):
|
||||
ret = self.gradle(self.substs['GRADLE_ANDROID_APP_TASKS'] + ['-x', 'lint', '--continue'] + args, verbose=True)
|
||||
ret = self.gradle(self.substs['GRADLE_ANDROID_APP_TASKS'] +
|
||||
['-x', 'lint', '--continue'] + args, verbose=True)
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
@SubCommand('android', 'generate-sdk-bindings',
|
||||
"""Generate SDK bindings used when building GeckoView.""")
|
||||
"""Generate SDK bindings used when building GeckoView.""")
|
||||
@CommandArgument('inputs', nargs='+', help='config files, like [/path/to/ClassName-classes.txt]+')
|
||||
@CommandArgument('args', nargs=argparse.REMAINDER)
|
||||
def android_generate_sdk_bindings(self, inputs, args):
|
||||
@ -77,35 +76,36 @@ class MachCommands(MachCommandBase):
|
||||
bindings_inputs = list(itertools.chain(*((input, stem(input)) for input in inputs)))
|
||||
bindings_args = '-Pgenerate_sdk_bindings_args={}'.format(':'.join(bindings_inputs))
|
||||
|
||||
ret = self.gradle(self.substs['GRADLE_ANDROID_GENERATE_SDK_BINDINGS_TASKS'] + [bindings_args] + args, verbose=True)
|
||||
ret = self.gradle(
|
||||
self.substs['GRADLE_ANDROID_GENERATE_SDK_BINDINGS_TASKS'] + [bindings_args] + args, verbose=True)
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
@SubCommand('android', 'generate-generated-jni-wrappers',
|
||||
"""Generate GeckoView JNI wrappers used when building GeckoView.""")
|
||||
"""Generate GeckoView JNI wrappers used when building GeckoView.""")
|
||||
@CommandArgument('args', nargs=argparse.REMAINDER)
|
||||
def android_generate_generated_jni_wrappers(self, args):
|
||||
ret = self.gradle(self.substs['GRADLE_ANDROID_GENERATE_GENERATED_JNI_WRAPPERS_TASKS'] + args, verbose=True)
|
||||
ret = self.gradle(
|
||||
self.substs['GRADLE_ANDROID_GENERATE_GENERATED_JNI_WRAPPERS_TASKS'] + args, verbose=True)
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
@SubCommand('android', 'generate-fennec-jni-wrappers',
|
||||
"""Generate Fennec-specific JNI wrappers used when building Firefox for Android.""")
|
||||
"""Generate Fennec-specific JNI wrappers used when building Firefox for Android.""")
|
||||
@CommandArgument('args', nargs=argparse.REMAINDER)
|
||||
def android_generate_fennec_jni_wrappers(self, args):
|
||||
ret = self.gradle(self.substs['GRADLE_ANDROID_GENERATE_FENNEC_JNI_WRAPPERS_TASKS'] + args, verbose=True)
|
||||
ret = self.gradle(
|
||||
self.substs['GRADLE_ANDROID_GENERATE_FENNEC_JNI_WRAPPERS_TASKS'] + args, verbose=True)
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
@SubCommand('android', 'test',
|
||||
"""Run Android local unit tests.
|
||||
"""Run Android local unit tests.
|
||||
See https://developer.mozilla.org/en-US/docs/Mozilla/Android-specific_test_suites#android-test""")
|
||||
@CommandArgument('args', nargs=argparse.REMAINDER)
|
||||
def android_test(self, args):
|
||||
ret = self.gradle(self.substs['GRADLE_ANDROID_TEST_TASKS'] + ["--continue"] + args, verbose=True)
|
||||
ret = self.gradle(self.substs['GRADLE_ANDROID_TEST_TASKS'] +
|
||||
["--continue"] + args, verbose=True)
|
||||
|
||||
ret |= self._parse_android_test_results('public/app/unittest', 'gradle/build/mobile/android/app',
|
||||
(self.substs['GRADLE_ANDROID_APP_VARIANT_NAME'],))
|
||||
@ -152,7 +152,8 @@ class MachCommands(MachCommandBase):
|
||||
# And make the report display as soon as possible.
|
||||
failed = root.findall('testcase/error') or root.findall('testcase/failure')
|
||||
if failed:
|
||||
print('TEST-UNEXPECTED-FAIL | android-test | There were failing tests. See the reports at: {}/{}/index.html'.format(root_url, report))
|
||||
print(
|
||||
'TEST-UNEXPECTED-FAIL | android-test | There were failing tests. See the reports at: {}/{}/index.html'.format(root_url, report))
|
||||
|
||||
print('SUITE-START | android-test | {} {}'.format(report, root.get('name')))
|
||||
|
||||
@ -191,13 +192,13 @@ class MachCommands(MachCommandBase):
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
@SubCommand('android', 'lint',
|
||||
"""Run Android lint.
|
||||
"""Run Android lint.
|
||||
See https://developer.mozilla.org/en-US/docs/Mozilla/Android-specific_test_suites#android-lint""")
|
||||
@CommandArgument('args', nargs=argparse.REMAINDER)
|
||||
def android_lint(self, args):
|
||||
ret = self.gradle(self.substs['GRADLE_ANDROID_LINT_TASKS'] + ["--continue"] + args, verbose=True)
|
||||
ret = self.gradle(self.substs['GRADLE_ANDROID_LINT_TASKS'] +
|
||||
["--continue"] + args, verbose=True)
|
||||
|
||||
# Android Lint produces both HTML and XML reports. Visit the
|
||||
# XML report(s) to report errors and link to the HTML
|
||||
@ -210,7 +211,8 @@ class MachCommands(MachCommandBase):
|
||||
|
||||
reports = (self.substs['GRADLE_ANDROID_APP_VARIANT_NAME'],)
|
||||
for report in reports:
|
||||
f = open(os.path.join(self.topobjdir, 'gradle/build/mobile/android/app/reports/lint-results-{}.xml'.format(report)), 'rt')
|
||||
f = open(os.path.join(
|
||||
self.topobjdir, 'gradle/build/mobile/android/app/reports/lint-results-{}.xml'.format(report)), 'rt')
|
||||
tree = ET.parse(f)
|
||||
root = tree.getroot()
|
||||
|
||||
@ -236,20 +238,21 @@ class MachCommands(MachCommandBase):
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
@SubCommand('android', 'checkstyle',
|
||||
"""Run Android checkstyle.
|
||||
"""Run Android checkstyle.
|
||||
See https://developer.mozilla.org/en-US/docs/Mozilla/Android-specific_test_suites#android-checkstyle""")
|
||||
@CommandArgument('args', nargs=argparse.REMAINDER)
|
||||
def android_checkstyle(self, args):
|
||||
ret = self.gradle(self.substs['GRADLE_ANDROID_CHECKSTYLE_TASKS'] + ["--continue"] + args, verbose=True)
|
||||
ret = self.gradle(self.substs['GRADLE_ANDROID_CHECKSTYLE_TASKS'] +
|
||||
["--continue"] + args, verbose=True)
|
||||
|
||||
# Checkstyle produces both HTML and XML reports. Visit the
|
||||
# XML report(s) to report errors and link to the HTML
|
||||
# report(s) for human consumption.
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
f = open(os.path.join(self.topobjdir, 'gradle/build/mobile/android/app/reports/checkstyle/checkstyle.xml'), 'rt')
|
||||
f = open(os.path.join(self.topobjdir,
|
||||
'gradle/build/mobile/android/app/reports/checkstyle/checkstyle.xml'), 'rt')
|
||||
tree = ET.parse(f)
|
||||
root = tree.getroot()
|
||||
|
||||
@ -290,13 +293,13 @@ class MachCommands(MachCommandBase):
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
@SubCommand('android', 'findbugs',
|
||||
"""Run Android findbugs.
|
||||
"""Run Android findbugs.
|
||||
See https://developer.mozilla.org/en-US/docs/Mozilla/Android-specific_test_suites#android-findbugs""")
|
||||
@CommandArgument('args', nargs=argparse.REMAINDER)
|
||||
def android_findbugs(self, dryrun=False, args=[]):
|
||||
ret = self.gradle(self.substs['GRADLE_ANDROID_FINDBUGS_TASKS'] + ["--continue"] + args, verbose=True)
|
||||
ret = self.gradle(self.substs['GRADLE_ANDROID_FINDBUGS_TASKS'] +
|
||||
["--continue"] + args, verbose=True)
|
||||
|
||||
# Findbug produces both HTML and XML reports. Visit the
|
||||
# XML report(s) to report errors and link to the HTML
|
||||
@ -310,7 +313,8 @@ class MachCommands(MachCommandBase):
|
||||
reports = (self.substs['GRADLE_ANDROID_APP_VARIANT_NAME'],)
|
||||
for report in reports:
|
||||
try:
|
||||
f = open(os.path.join(self.topobjdir, 'gradle/build/mobile/android/app/reports/findbugs', 'findbugs-{}-output.xml'.format(report)), 'rt')
|
||||
f = open(os.path.join(self.topobjdir, 'gradle/build/mobile/android/app/reports/findbugs',
|
||||
'findbugs-{}-output.xml'.format(report)), 'rt')
|
||||
except IOError:
|
||||
continue
|
||||
|
||||
@ -332,7 +336,8 @@ class MachCommands(MachCommandBase):
|
||||
# There's no particular advantage to formatting the
|
||||
# error, so for now let's just output the <error> XML
|
||||
# tag.
|
||||
print('TEST-UNEXPECTED-FAIL | {}:{} | {}'.format(report, error.get('type'), error.find('Class').get('classname')))
|
||||
print('TEST-UNEXPECTED-FAIL | {}:{} | {}'.format(report,
|
||||
error.get('type'), error.find('Class').get('classname')))
|
||||
for line in ET.tostring(error).strip().splitlines():
|
||||
print('TEST-UNEXPECTED-FAIL | {}:{} | {}'.format(report, error.get('type'), line))
|
||||
ret |= 1
|
||||
@ -340,44 +345,44 @@ class MachCommands(MachCommandBase):
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
@SubCommand('android', 'gradle-dependencies',
|
||||
"""Collect Android Gradle dependencies.
|
||||
"""Collect Android Gradle dependencies.
|
||||
See http://firefox-source-docs.mozilla.org/build/buildsystem/toolchains.html#firefox-for-android-with-gradle""")
|
||||
@CommandArgument('args', nargs=argparse.REMAINDER)
|
||||
def android_gradle_dependencies(self, args):
|
||||
# We don't want to gate producing dependency archives on clean
|
||||
# lint or checkstyle, particularly because toolchain versions
|
||||
# can change the outputs for those processes.
|
||||
self.gradle(self.substs['GRADLE_ANDROID_DEPENDENCIES_TASKS'] + ["--continue"] + args, verbose=True)
|
||||
self.gradle(self.substs['GRADLE_ANDROID_DEPENDENCIES_TASKS'] +
|
||||
["--continue"] + args, verbose=True)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
@SubCommand('android', 'archive-geckoview',
|
||||
"""Create GeckoView archives.
|
||||
"""Create GeckoView archives.
|
||||
See http://firefox-source-docs.mozilla.org/build/buildsystem/toolchains.html#firefox-for-android-with-gradle""")
|
||||
@CommandArgument('args', nargs=argparse.REMAINDER)
|
||||
def android_archive_geckoview(self, args):
|
||||
ret = self.gradle(self.substs['GRADLE_ANDROID_ARCHIVE_GECKOVIEW_TASKS'] + ["--continue"] + args, verbose=True)
|
||||
ret = self.gradle(
|
||||
self.substs['GRADLE_ANDROID_ARCHIVE_GECKOVIEW_TASKS'] + ["--continue"] + args, verbose=True)
|
||||
|
||||
return ret
|
||||
|
||||
@SubCommand('android', 'geckoview-docs',
|
||||
"""Create GeckoView javadoc and optionally upload to Github""")
|
||||
"""Create GeckoView javadoc and optionally upload to Github""")
|
||||
@CommandArgument('--archive', action='store_true',
|
||||
help='Generate a javadoc archive.')
|
||||
help='Generate a javadoc archive.')
|
||||
@CommandArgument('--upload', metavar='USER/REPO',
|
||||
help='Upload generated javadoc to Github, '
|
||||
'using the specified USER/REPO.')
|
||||
help='Upload generated javadoc to Github, '
|
||||
'using the specified USER/REPO.')
|
||||
@CommandArgument('--upload-branch', metavar='BRANCH[/PATH]',
|
||||
default='gh-pages/javadoc',
|
||||
help='Use the specified branch/path for commits.')
|
||||
default='gh-pages/javadoc',
|
||||
help='Use the specified branch/path for commits.')
|
||||
@CommandArgument('--upload-message', metavar='MSG',
|
||||
default='GeckoView docs upload',
|
||||
help='Use the specified message for commits.')
|
||||
default='GeckoView docs upload',
|
||||
help='Use the specified message for commits.')
|
||||
@CommandArgument('--variant', default='debug',
|
||||
help='Gradle variant used to generate javadoc.')
|
||||
help='Gradle variant used to generate javadoc.')
|
||||
def android_geckoview_docs(self, archive, upload, upload_branch,
|
||||
upload_message, variant):
|
||||
|
||||
@ -454,12 +459,11 @@ class MachCommands(MachCommandBase):
|
||||
mozfile.remove(keyfile)
|
||||
return 0
|
||||
|
||||
|
||||
@Command('gradle', category='devenv',
|
||||
description='Run gradle.',
|
||||
conditions=[conditions.is_android])
|
||||
description='Run gradle.',
|
||||
conditions=[conditions.is_android])
|
||||
@CommandArgument('-v', '--verbose', action='store_true',
|
||||
help='Verbose output for what commands the build is running.')
|
||||
help='Verbose output for what commands the build is running.')
|
||||
@CommandArgument('args', nargs=argparse.REMAINDER)
|
||||
def gradle(self, args, verbose=False):
|
||||
if not verbose:
|
||||
@ -472,7 +476,7 @@ class MachCommands(MachCommandBase):
|
||||
java_home = os.path.dirname(os.path.dirname(self.substs['JAVA']))
|
||||
|
||||
gradle_flags = self.substs.get('GRADLE_FLAGS', '') or \
|
||||
os.environ.get('GRADLE_FLAGS', '')
|
||||
os.environ.get('GRADLE_FLAGS', '')
|
||||
gradle_flags = shell_split(gradle_flags)
|
||||
|
||||
# We force the Gradle JVM to run with the UTF-8 encoding, since we
|
||||
@ -494,17 +498,17 @@ class MachCommands(MachCommandBase):
|
||||
# and especially https://stackoverflow.com/a/21755671.
|
||||
|
||||
return self.run_process([self.substs['GRADLE']] + gradle_flags + ['--console=plain'] + args,
|
||||
append_env={
|
||||
append_env={
|
||||
'GRADLE_OPTS': '-Dfile.encoding=utf-8',
|
||||
'JAVA_HOME': java_home,
|
||||
'JAVA_TOOL_OPTIONS': '-Dfile.encoding=utf-8',
|
||||
},
|
||||
pass_thru=True, # Allow user to run gradle interactively.
|
||||
ensure_exit_code=False, # Don't throw on non-zero exit code.
|
||||
pass_thru=True, # Allow user to run gradle interactively.
|
||||
ensure_exit_code=False, # Don't throw on non-zero exit code.
|
||||
cwd=mozpath.join(self.topsrcdir))
|
||||
|
||||
@Command('gradle-install', category='devenv',
|
||||
conditions=[REMOVED])
|
||||
conditions=[REMOVED])
|
||||
def gradle_install(self):
|
||||
pass
|
||||
|
||||
@ -517,21 +521,22 @@ class AndroidEmulatorCommands(MachCommandBase):
|
||||
the tooltool server and installed.
|
||||
"""
|
||||
@Command('android-emulator', category='devenv',
|
||||
conditions=[],
|
||||
description='Run the Android emulator with an AVD from test automation.')
|
||||
conditions=[],
|
||||
description='Run the Android emulator with an AVD from test automation.')
|
||||
@CommandArgument('--version', metavar='VERSION', choices=['4.3', '6.0', '7.0', 'x86', 'x86-6.0', 'x86-7.0'],
|
||||
help='Specify Android version to run in emulator. One of "4.3", "6.0", "7.0", "x86", "x86-6.0", or "x86-7.0".',
|
||||
default='4.3')
|
||||
help='Specify Android version to run in emulator. One of "4.3", "6.0", "7.0", "x86", "x86-6.0", or "x86-7.0".',
|
||||
default='4.3')
|
||||
@CommandArgument('--wait', action='store_true',
|
||||
help='Wait for emulator to be closed.')
|
||||
help='Wait for emulator to be closed.')
|
||||
@CommandArgument('--force-update', action='store_true',
|
||||
help='Update AVD definition even when AVD is already installed.')
|
||||
help='Update AVD definition even when AVD is already installed.')
|
||||
@CommandArgument('--verbose', action='store_true',
|
||||
help='Log informative status messages.')
|
||||
help='Log informative status messages.')
|
||||
def emulator(self, version, wait=False, force_update=False, verbose=False):
|
||||
from mozrunner.devices.android_device import AndroidEmulator
|
||||
|
||||
emulator = AndroidEmulator(version, verbose, substs=self.substs, device_serial='emulator-5554')
|
||||
emulator = AndroidEmulator(version, verbose, substs=self.substs,
|
||||
device_serial='emulator-5554')
|
||||
if emulator.is_running():
|
||||
# It is possible to run multiple emulators simultaneously, but:
|
||||
# - if more than one emulator is using the same avd, errors may
|
||||
@ -597,12 +602,12 @@ class AutophoneCommands(MachCommandBase):
|
||||
If necessary, autophone is cloned from github, installed, and configured.
|
||||
"""
|
||||
@Command('autophone', category='devenv',
|
||||
conditions=[],
|
||||
description='Run autophone.')
|
||||
conditions=[],
|
||||
description='Run autophone.')
|
||||
@CommandArgument('--clean', action='store_true',
|
||||
help='Delete an existing autophone installation.')
|
||||
help='Delete an existing autophone installation.')
|
||||
@CommandArgument('--verbose', action='store_true',
|
||||
help='Log informative status messages.')
|
||||
help='Log informative status messages.')
|
||||
def autophone(self, clean=False, verbose=False):
|
||||
import platform
|
||||
from mozrunner.devices.autophone import AutophoneRunner
|
||||
@ -610,7 +615,7 @@ class AutophoneCommands(MachCommandBase):
|
||||
if platform.system() == "Windows":
|
||||
# Autophone is normally run on Linux or OSX.
|
||||
self.log(logging.ERROR, "autophone", {},
|
||||
"This mach command is not supported on Windows!")
|
||||
"This mach command is not supported on Windows!")
|
||||
return -1
|
||||
|
||||
runner = AutophoneRunner(self, verbose)
|
||||
|
@ -7,68 +7,69 @@ reported and l10n-merged.
|
||||
This needs to stay in sync with the copy in mobile/android/locales.
|
||||
"""
|
||||
|
||||
def test(mod, path, entity = None):
|
||||
import re
|
||||
# ignore anything but mobile, which is our local repo checkout name
|
||||
if mod not in ("dom", "toolkit", "mobile",
|
||||
"mobile/android/base", "mobile/android"):
|
||||
return "ignore"
|
||||
|
||||
if mod == "toolkit":
|
||||
# keep this file list in sync with jar.mn
|
||||
if path in (
|
||||
"chrome/global/aboutAbout.dtd",
|
||||
"chrome/global/aboutReader.properties",
|
||||
"chrome/global/aboutRights.dtd",
|
||||
"chrome/global/charsetMenu.properties",
|
||||
"chrome/global/commonDialogs.properties",
|
||||
"chrome/global/intl.properties",
|
||||
"chrome/global/intl.css",
|
||||
"chrome/search/search.properties",
|
||||
"chrome/pluginproblem/pluginproblem.dtd",
|
||||
"chrome/global/aboutSupport.dtd",
|
||||
"chrome/global/aboutSupport.properties",
|
||||
"crashreporter/crashes.dtd",
|
||||
"crashreporter/crashes.properties",
|
||||
"chrome/global/mozilla.dtd",
|
||||
"chrome/global/aboutTelemetry.dtd",
|
||||
"chrome/global/aboutTelemetry.properties",
|
||||
"chrome/global/aboutWebrtc.properties"):
|
||||
return "error"
|
||||
return "ignore"
|
||||
|
||||
if mod == "dom":
|
||||
# keep this file list in sync with jar.mn
|
||||
if path in (
|
||||
"chrome/global.dtd",
|
||||
"chrome/accessibility/AccessFu.properties",
|
||||
"chrome/dom/dom.properties",
|
||||
"chrome/plugins.properties"):
|
||||
return "error"
|
||||
return "ignore"
|
||||
|
||||
if mod not in ("mobile", "mobile/android"):
|
||||
# we only have exceptions for mobile*
|
||||
return "error"
|
||||
if mod == "mobile/android":
|
||||
if not entity:
|
||||
if (re.match(r"mobile-l10n.js", path) or
|
||||
re.match(r"defines.inc", path)):
|
||||
def test(mod, path, entity=None):
|
||||
import re
|
||||
# ignore anything but mobile, which is our local repo checkout name
|
||||
if mod not in ("dom", "toolkit", "mobile",
|
||||
"mobile/android/base", "mobile/android"):
|
||||
return "ignore"
|
||||
if path == "defines.inc":
|
||||
if entity == "MOZ_LANGPACK_CONTRIBUTORS":
|
||||
|
||||
if mod == "toolkit":
|
||||
# keep this file list in sync with jar.mn
|
||||
if path in (
|
||||
"chrome/global/aboutAbout.dtd",
|
||||
"chrome/global/aboutReader.properties",
|
||||
"chrome/global/aboutRights.dtd",
|
||||
"chrome/global/charsetMenu.properties",
|
||||
"chrome/global/commonDialogs.properties",
|
||||
"chrome/global/intl.properties",
|
||||
"chrome/global/intl.css",
|
||||
"chrome/search/search.properties",
|
||||
"chrome/pluginproblem/pluginproblem.dtd",
|
||||
"chrome/global/aboutSupport.dtd",
|
||||
"chrome/global/aboutSupport.properties",
|
||||
"crashreporter/crashes.dtd",
|
||||
"crashreporter/crashes.properties",
|
||||
"chrome/global/mozilla.dtd",
|
||||
"chrome/global/aboutTelemetry.dtd",
|
||||
"chrome/global/aboutTelemetry.properties",
|
||||
"chrome/global/aboutWebrtc.properties"):
|
||||
return "error"
|
||||
return "ignore"
|
||||
|
||||
if mod == "dom":
|
||||
# keep this file list in sync with jar.mn
|
||||
if path in (
|
||||
"chrome/global.dtd",
|
||||
"chrome/accessibility/AccessFu.properties",
|
||||
"chrome/dom/dom.properties",
|
||||
"chrome/plugins.properties"):
|
||||
return "error"
|
||||
return "ignore"
|
||||
|
||||
if mod not in ("mobile", "mobile/android"):
|
||||
# we only have exceptions for mobile*
|
||||
return "error"
|
||||
if mod == "mobile/android":
|
||||
if not entity:
|
||||
if (re.match(r"mobile-l10n.js", path) or
|
||||
re.match(r"defines.inc", path)):
|
||||
return "ignore"
|
||||
if path == "defines.inc":
|
||||
if entity == "MOZ_LANGPACK_CONTRIBUTORS":
|
||||
return "ignore"
|
||||
return "error"
|
||||
|
||||
# we're in mod == "mobile"
|
||||
if path == "chrome/region.properties":
|
||||
# only region.properties exceptions remain
|
||||
if (re.match(r"browser\.search\.order\.[1-9]", entity) or
|
||||
re.match(r"browser\.search\.[a-zA-Z]+\.US", entity) or
|
||||
re.match(r"browser\.contentHandlers\.types\.[0-5]", entity) or
|
||||
re.match(r"gecko\.handlerService\.schemes\.", entity) or
|
||||
re.match(r"gecko\.handlerService\.defaultHandlersVersion", entity) or
|
||||
re.match(r"browser\.suggestedsites\.", entity)):
|
||||
return "ignore"
|
||||
|
||||
return "error"
|
||||
|
||||
# we're in mod == "mobile"
|
||||
if path == "chrome/region.properties":
|
||||
# only region.properties exceptions remain
|
||||
if (re.match(r"browser\.search\.order\.[1-9]", entity) or
|
||||
re.match(r"browser\.search\.[a-zA-Z]+\.US", entity) or
|
||||
re.match(r"browser\.contentHandlers\.types\.[0-5]", entity) or
|
||||
re.match(r"gecko\.handlerService\.schemes\.", entity) or
|
||||
re.match(r"gecko\.handlerService\.defaultHandlersVersion", entity) or
|
||||
re.match(r"browser\.suggestedsites\.", entity)):
|
||||
return "ignore"
|
||||
|
||||
return "error"
|
||||
|
Loading…
Reference in New Issue
Block a user