Write configuration to IPR file as well as .idea to avoid errors in legacy projects #810
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this PR
If a project was previously imported from an IPR file (such as that generated by
./gradlew idea
), but later migrated to using the gradle integration, the project configuration is still stored in the{rootProject}.ipr
file, not in the.idea
directory. However, the PJF gradle plugin only updates the IPR file when running./gradlew idea
- when importing a gradle project it only writes to the.idea
directory.This means that intellij tries to use whichever version of PJF was in use when the project was migrated to gradle, which may not even exist on disk any more, causing errors whenever it tries to run.
After this PR
==COMMIT_MSG==
Write configuration to IPR file if it exists, as well as the .idea directory, to avoid errors in legacy projects
==COMMIT_MSG==
Possible downsides?
Maybe we should just migrate the legacy .ipr projects to using the .idea format? But I don't know that it's automatable, and probably isn't the responsibility of this plugin anyway.