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

Pick up .ij.import.rc file for dynamic pantsrc insertion #324

Merged
merged 14 commits into from
Dec 26, 2017

Conversation

wisechengyi
Copy link
Collaborator

@wisechengyi wisechengyi commented Dec 20, 2017

Problem

Currently all the pants command args from intellij pants plugin are hardcoded from the plugin, so we do not have a way to dynamically tweak per repo, which would be useful if when we want to inject flags for experimental pants features, debug flags, etc.

Solution

Add a mechanism to recognize /.ij.import.rc file for dynamic argument changes per repo.

@wisechengyi wisechengyi changed the title Add mechanism to recognize .ijrc for dynamic arg insertion/removal .ijrc file for dynamic arg insertion/removal Dec 20, 2017
@stuhood
Copy link
Member

stuhood commented Dec 20, 2017

My first thought here is: why not just directly use pants' rc files?

Basically the equivalent of:

// At import time.
String importRc = "$buildroot/.ij.import.rc";
if (new File(importRc).isFile()) {
  args.add("--pantsrc-files=" + importRc);
}

@wisechengyi
Copy link
Collaborator Author

Ah good idea! The only thing is that using pantsrc cannot remove any command line args the plugin passes to pants due to ranked value, but that should not really be an issue.

@wisechengyi
Copy link
Collaborator Author

Adjusted.

@wisechengyi wisechengyi changed the title .ijrc file for dynamic arg insertion/removal .ij.import.rc file for dynamic pantsrc insertion Dec 21, 2017
@wisechengyi wisechengyi changed the title .ij.import.rc file for dynamic pantsrc insertion Pick up .ij.import.rc file for dynamic pantsrc insertion Dec 21, 2017
@wisechengyi
Copy link
Collaborator Author

wisechengyi commented Dec 26, 2017

Merging this one since it's a relatively simple change. Like before, if there is any issue, I can do a follow up patch.

@wisechengyi wisechengyi merged commit 6fc1ecf into pantsbuild:master Dec 26, 2017
@wisechengyi wisechengyi deleted the ijrc branch December 26, 2017 19:30
wisechengyi added a commit that referenced this pull request Mar 12, 2018
### Notable Changes

* Fix "Unrecognized command line flags on global scope: --async" (#323)
* Pick up .ij.import.rc file for dynamic pantsrc insertion (#324)
* Exclude jars imported into the project for IntelliJ Junit/Scala runner (#331)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants