Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change RscCompile --workflow-override flag to --scala-workflow-override #8575

Merged
merged 1 commit into from
Nov 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ def register_options(cls, register):
default=cls.JvmCompileWorkflowType.zinc_only, metavar='<workflow>',
help='The default workflow to use to compile JVM targets. This is overriden on a per-target basis with the force-compiler-tag-prefix tag.', fingerprint=True)

register('--workflow-override', type=cls.JvmCompileWorkflowType,
register('--scala-workflow-override', type=cls.JvmCompileWorkflowType,
choices=cls.JvmCompileWorkflowType.all_values(),
default=None, metavar='<workflow_override>',
help='The workflow to use to compile JVM targets, overriding the "workflow" option as well as any force-compiler-tag-prefix tags applied to targets. An example use case is to quickly turn off outlining workflows in case of errors.', fingerprint=True)
help='Experimental option. The workflow to use to compile Scala targets, overriding the "workflow" option as well as any force-compiler-tag-prefix tags applied to targets. An example use case is to quickly turn off outlining workflows in case of errors.', fingerprint=True)

register('--extra-rsc-args', type=list, default=[],
help='Extra arguments to pass to the rsc invocation.')
Expand Down Expand Up @@ -334,20 +334,16 @@ def _identify_workflow_tags(self, target):
@memoized_method
def _classify_target_compile_workflow(self, target):
"""Return the compile workflow to use for this target."""

workflow_override = self.get_options().workflow_override

if workflow_override is not None:
return self.JvmCompileWorkflowType(workflow_override)


# scala_library() targets may have a `.java_sources` property.
java_sources = getattr(target, 'java_sources', [])
if java_sources or target.has_sources('.java'):
# If there are any java sources to compile, treat it as a java library since rsc can't outline
# java yet.
return self.JvmCompileWorkflowType.zinc_java
if target.has_sources('.scala'):
workflow_override = self.get_options().scala_workflow_override
if workflow_override is not None:
return self.JvmCompileWorkflowType(workflow_override)
return self.get_scalar_mirrored_target_option('workflow', target)
return None

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_basic_binary(self):

@ensure_compile_rsc_execution_strategy(
RscCompileIntegrationBase.rsc_and_zinc,
PANTS_COMPILE_RSC_WORKFLOW_OVERRIDE="zinc-only")
PANTS_COMPILE_RSC_SCALA_WORKFLOW_OVERRIDE="zinc-only")
def test_workflow_override(self):
self._testproject_compile("mutual", "bin", "A", outline_result=False)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_public_inference(self):

@ensure_compile_rsc_execution_strategy(
RscCompileIntegrationBase.outline_and_zinc,
PANTS_COMPILE_RSC_WORKFLOW_OVERRIDE="zinc-only")
PANTS_COMPILE_RSC_SCALA_WORKFLOW_OVERRIDE="zinc-only")
def test_workflow_override(self):
self._testproject_compile("mutual", "bin", "A", outline_result=False)

Expand Down