I'm looking into putting together an alternative t...
# build-tools
j
I'm looking into putting together an alternative to Gradle and Amper for KMP projects, mostly as a hobby. I think I've figured out the majority of what I need by reading through Amper's source, but I'm lost on how these integrate into IntelliJ - I've seen how IntelliJ only JVM projects use
.iml
files to define the modules, but the Gradle integration does not appear to generate any of these files, yet somehow works. Is an IntelliJ plugin necessary to define the projects and modules? If so, can anyone get me a good starting point? My non-multiplatform version of this project just used those `.iml`s but that's not an option this time around.
g
Intellij has a special Gradle plugin and it relies on Gradle tooling API to get project structure translated than to intellij internal project setup
I see you are not looking for easy hobbies 😅
IML probably the easier solution, I heard that intellij integrations for bazel also worked by generating them, but not really know details and not sure that it still true (there is a plugin for it already)
j
No, I have a habit of trying to fix awfully difficult problems for a hobby for sure, lol. I'll go look into Bazel's old KMP integration then. Hopefully it yields something.
t
cc @Aleksei Cherepanov
a
Hi 👋
the Gradle integration does not appear to generate any of these files
Gradle does it but in different way. It generates the same iml files but as xml and in IJ cache folders, e.g.
~/Library/Caches/JetBrains/IntelliJIdea***/projects/***/external_build_system/modules
For Gradle you have an option to save those files under
.idea/modules
to store in VCS (pic), but be careful because there are plans to remove this functionality IDEA-367043 Remove the "Generate .iml files..." check box I think that
JpsProjectModelSynchronizer
should do this logic, but there are also plans to get rid of it for external build systems IJPL-176998 Don't store workspace entities in XML files if it was imported from the build system So imls had two purposes - 1) store project info for JPS projects and 2) allow IJ quickly restore project data from disk, but the second option is no longer needed as all project info is already duplicated in the new workspace model in binary format