Skip to content

Commit

Permalink
gate: add separate tag for style checks that require a build
Browse files Browse the repository at this point in the history
  • Loading branch information
rschatz committed Feb 17, 2016
1 parent a02584b commit 071e32f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -12348,7 +12348,7 @@ def alarm_handler(signum, frame):
# no need to show the stack trace when the user presses CTRL-C
abort(1)

version = VersionSpec("5.8.0")
version = VersionSpec("5.8.1")

currentUmask = None

Expand Down
20 changes: 10 additions & 10 deletions mx_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@
Predefined Task tags.
"""
class Tags:
always = 'always'
style = 'style'
build = 'build'
always = 'always' # special tag that is always implicitly selected
style = 'style' # code style checks (without build)
build = 'build' # build
fullbuild = 'fullbuild' # full build (including warnings, findbugs and ide init)

"""
Context manager for a single gate task that can prevent the
Expand Down Expand Up @@ -253,7 +254,7 @@ def gate(args):
if mx.command_function('pylint')(['--primary']) != 0:
_warn_or_abort('Pylint not configured correctly. Cannot execute Pylint task.', args.strict_mode)

gate_clean(cleanArgs, tasks, tags=[Tags.build, Tags.style])
gate_clean(cleanArgs, tasks, tags=[Tags.build, Tags.fullbuild])

with Task('Distribution Overlap Check', tasks, tags=[Tags.style]) as t:
if t:
Expand All @@ -266,19 +267,18 @@ def gate(args):
if mx.command_function('canonicalizeprojects')([]) != 0:
t.abort('Rerun "mx canonicalizeprojects" and check-in the modified mx/suite*.py files.')

with Task('BuildJavaWithEcj', tasks, tags=[Tags.style]) as t:
with Task('BuildJavaWithEcj', tasks, tags=[Tags.fullbuild]) as t:
if t:
if mx.get_env('JDT'):
mx.command_function('build')(['-p', '--no-native', '--warning-as-error'])
gate_clean(cleanArgs, tasks, name='CleanAfterEcjBuild', tags=[Tags.style])
gate_clean(cleanArgs, tasks, name='CleanAfterEcjBuild', tags=[Tags.fullbuild])
else:
_warn_or_abort('JDT environment variable not set. Cannot execute BuildJavaWithEcj task.', args.strict_mode)

# Tag.style: build needed by findbugs
with Task('BuildJavaWithJavac', tasks, tags=[Tags.build, Tags.style]) as t:
with Task('BuildJavaWithJavac', tasks, tags=[Tags.build, Tags.fullbuild]) as t:
if t: mx.command_function('build')(['-p', '--warning-as-error', '--no-native', '--force-javac'])

with Task('IDEConfigCheck', tasks, tags=[Tags.style]) as t:
with Task('IDEConfigCheck', tasks, tags=[Tags.fullbuild]) as t:
if t:
if args.cleanIDE:
mx.command_function('ideclean')([])
Expand All @@ -301,7 +301,7 @@ def gate(args):
if t and mx.command_function('checkheaders')([]) != 0:
t.abort('Checkheaders warnings were found')

with Task('FindBugs', tasks, tags=[Tags.style]) as t:
with Task('FindBugs', tasks, tags=[Tags.fullbuild]) as t:
if t and mx.command_function('findbugs')([]) != 0:
t.abort('FindBugs warnings were found')

Expand Down

0 comments on commit 071e32f

Please sign in to comment.