def __init__(self, context, nailgun_task, jvm_options, color): self.context = context self._nailgun_task = nailgun_task # We run zinc on this task's behalf. self._jvm_options = jvm_options self._color = color self._jvm_tool_bootstrapper = JvmToolBootstrapper( self.context.products) # The target scala version. self._compile_bootstrap_key = 'scalac' self._compile_bootstrap_tools = TargetPlatform( config=context.config).compiler_specs self._jvm_tool_bootstrapper.register_jvm_tool( self._compile_bootstrap_key, self._compile_bootstrap_tools) # The zinc version (and the scala version it needs, which may differ from the target version). self._zinc_bootstrap_key = 'zinc' zinc_bootstrap_tools = context.config.getlist('scala-compile', 'zinc-bootstrap-tools', default=['//:zinc']) self._jvm_tool_bootstrapper.register_jvm_tool(self._zinc_bootstrap_key, zinc_bootstrap_tools) # Compiler plugins. plugins_bootstrap_tools = context.config.getlist( 'scala-compile', 'scalac-plugin-bootstrap-tools', default=[]) if plugins_bootstrap_tools: self._plugins_bootstrap_key = 'plugins' self._jvm_tool_bootstrapper.register_jvm_tool( self._plugins_bootstrap_key, plugins_bootstrap_tools) else: self._plugins_bootstrap_key = None
def jvm_tool_bootstrapper(self): if self._jvm_tool_bootstrapper is None: self._jvm_tool_bootstrapper = JvmToolBootstrapper( self.context.products) return self._jvm_tool_bootstrapper