Skip to content

Commit

Permalink
Change some option defaults.
Browse files Browse the repository at this point in the history
These are based on common pants.ini configs at Square, Foursquare and Twitter.

The nature of these options is such that changing the default is unlikely to have
adverse impact on anyone not currently setting them explicitly in pants.ini,
and we'd like to make them more useful before we freeze them in 1.0.

But please verify that these won't hurt your org.

Testing Done:
CI passes: https://travis-ci.org/pantsbuild/pants/builds/122111992

Reviewed at https://rbcommons.com/s/twitter/r/3678/
  • Loading branch information
benjyw committed Apr 11, 2016
1 parent 7ccb7ea commit 60298ec
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def _portable_analysis_for_target(analysis_dir, target):
@classmethod
def register_options(cls, register):
super(JvmCompile, cls).register_options(register)
register('--jvm-options', advanced=True, type=list, default=[],
register('--jvm-options', advanced=True, type=list,
default=list(cls.get_jvm_options_default(register.bootstrap)),
help='Run the compiler with these JVM options.')

register('--args', advanced=True, type=list,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,23 @@ def compiler_plugin_types(cls):
"""A tuple of target types which are compiler plugins."""
return (AnnotationProcessor, ScalacPlugin)

@classmethod
def get_jvm_options_default(cls, bootstrap_option_values):
return ('-Dfile.encoding=UTF-8', '-Dzinc.analysis.cache.limit=1000',
'-Djava.awt.headless=true', '-Xmx2g')

@classmethod
def get_args_default(cls, bootstrap_option_values):
return ('-S-encoding', '-SUTF-8', '-S-g:vars')
return ('-C-encoding', '-CUTF-8', '-S-encoding', '-SUTF-8', '-S-g:vars')

@classmethod
def get_warning_args_default(cls):
return ('-S-deprecation', '-S-unchecked')
return ('-C-deprecation', '-C-Xlint:all', '-C-Xlint:-serial', '-C-Xlint:-path',
'-S-deprecation', '-S-unchecked', '-S-Xlint')

@classmethod
def get_no_warning_args_default(cls):
return ('-S-nowarn',)
return ('-C-nowarn', '-C-Xlint:none', '-S-nowarn', '-S-Xlint:none', )

@classmethod
def get_fatal_warnings_enabled_args_default(cls):
Expand Down Expand Up @@ -199,7 +205,8 @@ def __init__(self, *args, **kwargs):
self._processor_info_dir = os.path.join(self.workdir, 'apt-processor-info')

# Validate zinc options.
ZincCompile.validate_arguments(self.context.log, self.get_options().whitelisted_args, self._args)
ZincCompile.validate_arguments(self.context.log, self.get_options().whitelisted_args,
self._args)
# A directory independent of any other classpath which can contain per-target
# plugin resource files.
self._plugin_info_dir = os.path.join(self.workdir, 'scalac-plugin-info')
Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/option/global_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ def register_options(cls, register):
help='Exclude targets that match these regexes.',
recursive=True) # TODO: Does this need to be recursive? What does that even mean?
register('--ignore-patterns', advanced=True, type=list, fromfile=True,
default=['.*'],
help='Patterns for ignoring files when reading BUILD files. '
default=['.*', '/dist', 'bower_components', 'node_modules', '*.egg-info'],
help='Glob patterns for ignoring files when reading BUILD files. '
'Use to ignore unneeded directories or BUILD files. '
'Entries use the gitignore pattern syntax (https://git-scm.com/docs/gitignore).')
register('--fail-fast', advanced=True, type=bool, recursive=True,
Expand Down

0 comments on commit 60298ec

Please sign in to comment.