-
Notifications
You must be signed in to change notification settings - Fork 27
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
IntelliJ IDEA interoperability #42
Comments
As an update: It works better in Gradle! IntelliJ correctly uses JCP in multi module projects. The only downside is that a run/compile is needed to view code changes from other modules. That doesn't happen live. |
One other thing I noticed is that IntelliJ incorrectly marks the source directories, making the project harder to work with. If I configure the project like here, I need to unmark I did try to use the idea.module {
sourceDirs = mutableSetOf(File("./src/main/kotlin"))
} but to no avail... Any tips in this regard? Can I somehow revert my code sourceSets when the building/deploying is finished? Edit: I updated the same example. |
With the updated example, the folders are marked correctly, but IntelliJ still skips the preprocessing defined in gradle, instead opting for an incremental build :( |
@raydac My current state: Inside the preprocess task: tasks.compileKotlin {
dependsOn(preprocessMain)
outputs.upToDateWhen { false }
} It seems that IntelliJ skips the compilation preprocessing step instead doing an incremental update, but it does check the outputs.upToDateWhen predicates. |
Incremental build support for Gradle might actually be nice to speed up JCP builds! |
What a cool concept this is!
Not only does it allow me to change source code for Java files, but also for Kotlin and Scala files (which is what I use it for at the moment).
However, I do seem to have some issues to make IntelliJ understand what's happening in my multi-module maven project.
The current problem I'm having: when running mvn compile, all works well. The tests work, I can hit run in IntelliJ on a file (which is not delegated to maven because that fails in multi module projects because of the other module's package being "not available on maven central") and I get the properly modified sources.
However, when I change the source code in a module that contains bits that need preprocessing and I hit run on a file in another module that uses it, the preprocessing won't take place and it won't work anymore (since IntelliJ then skips maven).
Is there any way to make IntelliJ somehow aware of this preprocessor, like it is for annotation processors, so that it always gets preprocessed before executing?
Or would I for instance have to switch to Gradle for better multi-module support?
If a plugin would be needed for this, something similar already exists for a JCP-like preprocessor:
https://github.com/FalseHonesty/intellij-preprocessor which also does nice highlighting and such. It's just a bit out of date, but autocomplete and highlighting might actually be a nice feature for JCP too :).
The text was updated successfully, but these errors were encountered: