-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add option to use IntelliJ compiler for Pants projects #447
Add option to use IntelliJ compiler for Pants projects #447
Conversation
TODO: add and fix some tests. |
src/com/twitter/intellij/pants/execution/PantsMakeBeforeRun.java
Outdated
Show resolved
Hide resolved
src/com/twitter/intellij/pants/service/PantsCompileOptionsExecutor.java
Outdated
Show resolved
Hide resolved
src/com/twitter/intellij/pants/service/project/PantsSystemProjectResolver.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! This is looking great!
@@ -112,20 +106,24 @@ else if (runConfiguration instanceof CommonProgramRunConfigurationParameters) { | |||
((CommonProgramRunConfigurationParameters) runConfiguration).setWorkingDirectory(buildRoot.get().getPath()); | |||
} | |||
} | |||
} | |||
|
|||
public static void replaceDefaultMakeWithPantsMake(@NotNull RunConfiguration runConfiguration) { | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover comment line
@@ -77,6 +79,12 @@ protected void fillExtraControls(@NotNull PaintAwarePanel content, int indentLev | |||
myUseIdeaProjectJdkCheckBox.setSelected(mySettings.useIdeaProjectJdk); | |||
myImportSourceDepsAsJarsCheckBox.setSelected(mySettings.importSourceDepsAsJars); | |||
myUseIntellijCompilerCheckBox.setSelected(mySettings.useIntellijCompiler); | |||
LinkLabel<?> intellijCompilerHelpMessage = LinkLabel.create(PantsBundle.message("pants.settings.text.use.intellij.compiler.help.messasge"), new Runnable() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't quite see this message in the UI, it doesn't show up. Where should I be looking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the description under 1). It now shows up at import time.
@@ -76,6 +76,10 @@ public boolean isEnableIncrementalImport() { | |||
return getLinkedProjectsSettings().stream().anyMatch(PantsProjectSettings::isEnableIncrementalImport); | |||
} | |||
|
|||
public boolean isUseIntellijCompiler() { | |||
return getLinkedProjectsSettings().stream().anyMatch(s -> s.useIntellijCompiler); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that if any of my imported projects use the intellij compiler, all of them have to? I'm not sure what getLinkedProjectSettings does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One IntelliJ window can contain multiple projects actually. So yes, that's what this means.
This mostly just follows the pattern there. and the tricky part is that if a source file can belong to multiple projects, then which compiler should we use? I think this should be an okay heuristics.
Problem
Often times shelling off to Pants has non trivial latency. This PR introduces using IntelliJ compiler for an imported Pants project to achieve faster turnaround time.
Visible changes includes:
Once selected, all the test configurations generated will invoke the default
Build
action as belowinstead of
PantsCompile
No longer hide the default
Build Project
button.Module content roots are further trimmed to the top level roots, so intellij won't double count the sources as it gathers all the sources for each content root.
Before
In this case,
WelSpecXYZ
will be passed to the compiler twice, causing errors.After