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

Projects
None yet
2 participants
@wisechengyi
Copy link
Contributor

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

wisechengyi commented Dec 21, 2017

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 added some commits Dec 21, 2017

fmt
@wisechengyi

This comment has been minimized.

Copy link
Contributor

wisechengyi commented Dec 21, 2017

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

This comment has been minimized.

Copy link
Contributor

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@wisechengyi wisechengyi deleted the wisechengyi:ijrc branch Dec 26, 2017

@wisechengyi wisechengyi referenced this pull request Mar 11, 2018

Merged

Prepare 1.8.1 release #334

wisechengyi added a commit that referenced this pull request Mar 12, 2018

Prepare 1.8.1 release (#334)
### 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