gradle-baseline icon indicating copy to clipboard operation
gradle-baseline copied to clipboard

Recommend `open *.ipr` after generating Intellij IDEA projects

Open iamdanfox opened this issue 5 years ago • 5 comments

There are various different ways of importing java projects into intellij, but the only reliable one to get immutables generation working is to use open *.ipr

iamdanfox avatar Aug 06 '18 11:08 iamdanfox

Important note: it's not whether open *.ipr or the File > Open menu item from within IntelliJ that causes the Immutables generation issues, but instead what response was given to the "Import Unlinked Gradle Project?" popup in IntelliJ (coming from the IntelliJ Gradle plugin) right after opening the project.

If "Do Not Import" is chosen, the org.inferred.processors Gradle plugin seems to do what it's supposed to and generated .java files get placed in $module_root/generated_src directories. If "Import" is chosen, everything goes weird - the generated .java files are placed in $module_root/build/classes/java/my/package/path, and they're not put on the classpath in IntelliJ so you won't be able to import them.

There should be a large warning that the Gradle Intellij plugin shouldn't be used, and a user with it installed should choose "Do Not Import". Otherwise, debugging why the generated files are being placed in build/classes/java instead of generated_src is very non-obvious and time-consuming.

mieubrisse avatar Aug 06 '18 11:08 mieubrisse

This issue has been automatically marked as stale because it has not been touched in the last 60 days. Please comment if you'd like to keep it open, otherwise it'll be closed in 7 days time.

stale[bot] avatar Oct 06 '18 14:10 stale[bot]

Just FYI - this behaves weirdly with latest EAP releases (2018.3), opens 2 windows where none of them have all the function bars

robert3005 avatar Oct 09 '18 09:10 robert3005

This issue has been automatically marked as stale because it has not been touched in the last 60 days. Please comment if you'd like to keep it open, otherwise it'll be closed in 7 days time.

stale[bot] avatar Dec 08 '18 09:12 stale[bot]

This issue has been automatically marked as stale because it has not been touched in the last 60 days. Please comment if you'd like to keep it open, otherwise it'll be closed in 7 days time.

stale[bot] avatar Sep 23 '19 14:09 stale[bot]

Closing, ipr is deprecated

carterkozak avatar Sep 21 '22 12:09 carterkozak