I am trying to migrate a java project that is currently built with native Intellij build system (ipr
and iml
files) to gradle. The idea is to be able to build the application in the CI/CD pipeline. While migration of non-GUI related code worked out of the box, i am having a lot of difficulties with the GUI part of the project. To be more specific, I struggle with handling .form
files that have been generated by Intellij Form Designer. It looks like Intellij delegates generating code for the forms to javac2
compiler, that is available in JetBrains artifactories. There are a number of search results that point to solution of this problem:
Using IntelliJ Javac2 compiler instead of standard compiler in Gradle
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206227509-How-to-make-javac2-work-in-Gradle-to-generate-GUI-Designer-forms-SOLVED
https://www.grahamedgecombe.com/blog/2013/04/03/using-intellij-ideas-javac2-in-gradle
Following this path gives promising results, with the exception of a runtime error Duplicate method name “$$$getFont$$$”, as in:
https://youtrack.jetbrains.com/issue/IJPL-116394/Duplicate-method-name-getFont
And this is where i get stuck. The thread above claims the issue has been solved in 2020 but while using the very recent Intellij (2023.3.4) + gradle 8.6 + bundled gradle IJ plugin (233.14475.28), I still have this problem. Comments on youtrack point to a solution having been released with Gradle IntelliJ Plugin, but then, judging by description, the plugin is used for developing IJ plugins and this is not what i am doing.
Can someone please point me at an example of a gradle project setup with .form
files? It would seem that this is quite a common use case and yet all resources I find are either quite old, few and quite confusing. Am I required to add an IJ plugin to plugins section if i want to work with IJ forms?
Thank you!