-
Notifications
You must be signed in to change notification settings - Fork 134
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
Improve gradle-baseline-java integration with IntelliJ import #1411
Conversation
Generate changelog in
|
def checkstyle = project.plugins.findPlugin(BaselineCheckstyle) | ||
if (checkstyle == null) { | ||
project.logger.debug "Baseline: Skipping IDEA checkstyle configuration since baseline-checkstyle not applied" | ||
return | ||
} |
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'd flip this so it performs the action when (and if) the BaselineCheckstyle plugin is applied.
In the current state, you're dependent on the order of application, so if BaselineCheckstyle is applied later, intellij won't be configured correctly.
project.plugins.withType(BaselineCheckstyle) {
// rest of the function
}
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 copied this from the existing checkstyle application. Would you recommend I flip it for both then?
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.
only for code paths that happen at configuration time
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 ended up flipping it for both addCheckstyle
(called from within ideaRootModel.project.ipr.withXml
so maybe that wasn't needed?) and addCheckstyleIntellijImport
(mostly because I didn't see your edit before pushing, but I also think consistency is better - I'd even want to not have duplicate code but didn't find a nice way to do it because I'm not familiar enough with the code and how gradle configuration works yet)
Played around with this locally while importing with intellij and fixed some issues where we were adding extra nodes (that intellij didn't know how to deal with) instead of modifying existing nodes when they exist. Specifically we were always adding
even if such node already existed. This is now fixed |
Thanks for fixing @dansanduleac! Seems like we need another person's approval as well since you contributed? |
Released 3.28.0 |
Before this PR
When directly importing the gradle project in IntelliJ, neither checkstyle nor copyright would be set up properly
After this PR
==COMMIT_MSG==
Adds the proper configuration files upon IntelliJ import of a gradle project for checkstyle and copyright.
This generates the following additional files:
==COMMIT_MSG==
Possible downsides?