Bug 1515662 - Make |geckoview-docs| behave like other |mach android| commands. r=nalexander

Differential Revision: https://phabricator.services.mozilla.com/D15128

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Agi Sferro 2018-12-20 20:05:39 +00:00
Родитель bfc96ac22a
Коммит 61a9102f42
3 изменённых файлов: 24 добавлений и 9 удалений

Просмотреть файл

@ -271,6 +271,26 @@ def gradle_android_archive_geckoview_tasks(build_config):
set_config('GRADLE_ANDROID_ARCHIVE_GECKOVIEW_TASKS', gradle_android_archive_geckoview_tasks)
@depends(gradle_android_build_config)
def gradle_android_geckoview_docs_tasks(build_config):
'''Gradle tasks run by |mach android geckoview-docs|.'''
return [
'geckoview:javadoc{geckoview.variant.name}'.format(geckoview=build_config.geckoview),
]
set_config('GRADLE_ANDROID_GECKOVIEW_DOCS_TASKS', gradle_android_geckoview_docs_tasks)
@depends(gradle_android_build_config)
def gradle_android_geckoview_docs_archive_tasks(build_config):
'''Gradle tasks run by |mach android geckoview-docs --archive| or |... --upload.'''
return [
'geckoview:javadocJar{geckoview.variant.name}'.format(geckoview=build_config.geckoview),
]
set_config('GRADLE_ANDROID_GECKOVIEW_DOCS_ARCHIVE_TASKS', gradle_android_geckoview_docs_archive_tasks)
@depends(gradle_android_build_config)
def gradle_android_archive_coverage_artifacts_tasks(build_config):
'''Gradle tasks run by |mach android archive-coverage-artifacts|.'''

Просмотреть файл

@ -501,17 +501,13 @@ class MachCommands(MachCommandBase):
@CommandArgument('--upload-message', metavar='MSG',
default='GeckoView docs upload',
help='Use the specified message for commits.')
@CommandArgument('--variant', default='debug',
help='Gradle variant used to generate javadoc.')
def android_geckoview_docs(self, archive, upload, upload_branch,
upload_message, variant):
upload_message):
def capitalize(s):
# Can't use str.capitalize because it lower cases trailing letters.
return (s[0].upper() + s[1:]) if s else ''
tasks = (self.substs['GRADLE_ANDROID_GECKOVIEW_DOCS_ARCHIVE_TASKS'] if archive or upload
else self.substs['GRADLE_ANDROID_GECKOVIEW_DOCS_TASKS'])
task = 'geckoview:javadoc' + ('Jar' if archive or upload else '') + capitalize(variant)
ret = self.gradle([task], verbose=True)
ret = self.gradle(tasks, verbose=True)
if ret or not upload:
return ret

Просмотреть файл

@ -11,7 +11,6 @@ config = {
'--upload', 'mozilla/geckoview',
'--upload-branch', 'gh-pages/javadoc/{project}',
'--upload-message', 'Update {project} javadoc to rev {revision}',
'--variant', 'withGeckoBinariesRelease',
],
],
'artifact_flag_build_variant_in_try': None, # There's no artifact equivalent.