Idea plugin seems to be broken. Mainly it does not...
# eap
a
Idea plugin seems to be broken. Mainly it does not propagate gradle mudule dependencies to Idea project model.
The only solution is to add all required modules manually in project manager.
s
Can you give an example?
a
I work on two mulitplatform projects with inter-module dependencies. In both cases inter-module dependencies (like
implementation(projects.mapsKtCore)
are not recognized by Idea. It asks to load appropiate modules when encounters classes from those models. After that they are loaded in Idea project model and it works fine. Cache reset does not help
Here is the example.
s
Can you provide a reproducer? This sounds really bad! Obviously we have tests for this, so I this would be really urgent to find out what is going on?
Or are you using the
idea
gradle plugin?
a
I use regular idea Kotlin plugin updated to 1.9.0-Beta. Gradle build works fine. Right now it happens in some projects and is OK and others. It is possible that it is some cache problem after all.
s
Oh oh! If you have any idea on how I could reproduce this, please let me know! I do not see this in any of my hobby/dogfooding projects and obviously such cases are tested on CI as well.
a
It does not reproduce on all projects, but there is obviously some issue with idea-gradle caching. I deleted project idea and gradle cache and now Idea can't open project at all.
s
The project is not open source, right? Zipping whole project state will not be an option?
a
@Sebastian Sellmair [JB] After total reset, the problem is still there. You can check and see if it reproduces for you: https://github.com/SciProgCentre/maps-kt/tree/dev. Some modules are fine, but demonstrations are broken.
It uses Kotlin 1.8.20. But the issue appeared after switch of Kotlin plugin.
The second project is not open-source. But symptoms are the same.
s
Which IDE are you using?
a
Idea Ultimate
2023.1.2
s
For maps-kt in dev branch I see some unresolved dependencies:
image.png
Would you mind setting
kotlin.mpp.import.enableKgpDependencyResolution=true
in your ~/.gradle/gradle.properties or trying a 2023.2 based IDE?
a
Macos dependencies ane not published, but they are not consumed in the project, so their resolution is not needed.
I added the property to gradle and forced gradle to rebuild model, it did not help. Inter-project depenencies are still not present in idea project model.
s
will a full git clean -fdx resolve the issue?
a
Nope. By the way, it is strange that geometry is not resolved. You can solve this by turning native target at all here: https://github.com/SciProgCentre/maps-kt/blob/921aff46856450e477af8560c570b5027ff9b2b2/trajectory-kt/build.gradle.kts#L13. Just comment the line.
Mac publication is a pain.
And I fixed deployment, so now it should work on damn macs as well.
The problem keeps appearing in other projects. It is definitely a cache problem because it vanishes after project re-creation. But I can't find a way to eliminate it without re-creating a project.
The problem appears only on JVM modules in MPP projects. I can't find any reproducible differences in modules where problem appears and where it does not.
@Sebastian Sellmair [JB] the problem is still there and it makes things difficult, so I opened https://youtrack.jetbrains.com/issue/KTIJ-25663/Jvm-MPP-module-dependencies-are-not-resoled-on-231-1.9.0-Beta-release-209-IJ8770.65