UI Designer changes on 2020.1

After upgrading to 2020.1 I noticed some changes on the generated code of the GUI Designer.

Until now I committed the generated code to our GIT repository. But I'm unsure what happens if other people are still using 2019.x or older.

I just found a hint to leave code generation to Gradle. This would be my favorite solution, but how do I get it build on our TeamCity server using Gradle?

I found some hints about a javac2 tool and an ANT task, but those are quite old (2012).

Last recent question about I found here: IDEA-149668

Any suggestion?

0
7 comments
0
Avatar
Permanently deleted user

Thank you for the advice.

We are using Gradle with TeamCity since years, and this was not the question at all.

Meanwhile I found that the hint from the docu:

"if your build actions are delegated to Gradle, GUI Designer will not generate Java source code"

simply says: using Gradle no code is generated and such it does not work.

(and this has nothing to do with TeamCity).

The implied question was: how to tell gradle to run javac2

 

0
Avatar
Permanently deleted user

Some more observations:

I created a tiny test project on GitHub:

https://github.com/dieterstueken/GuiDesignerSample

With 2019.3  (193.6911.18) switching back and forth between Runtime classes and Java source code works seamless.

Using 2020.1 (201.6668.212) the generated code misses an `import java.util.ResourceBundle`, which is easy to repair.

But switching back to 'Binary class files' leaves some code fragments i.E.: '$$$cachedGetBundleMethod$$$'

This is not a big problem, but a bit annoying.

Also, if using generated source code (currently the only possibility with gradle) I have to use something like:

compile group: 'com.intellij', name: 'forms_rt', version: '7.0.3'

but that is quite old (2008). Should I use some actual version instead, like:

compile group: 'com.jetbrains.intellij.java', name: 'java-gui-forms-rt', version: '201.6668.121'

from https://www.jetbrains.com/intellij-repository/releases?

Dieter.

0
Avatar
Permanently deleted user

Meanwhile a found an option "Enable UI forms compilation" with "Generated Ant Builds".

Unfortunately the "Build | Generate Ant Build" dialog is missing with my 2020.1 installation (why?).

I switched back to 2019.3.3 and was able to generate an ant.xml containing those task.

Here I found a task instrumentIdeaExtensions which is exactly what I am searching for (but with gradle please).

Unfortunately I now get a "Class not found error: javax.swing.JPanel".

Seems I need something like "--add-modules java.desktop" here.

I created a new branch "ant-build" on my sample project.

You have to modify the generated path.variables from and.properties accordingly.

0

Sorry for the delay.

 

> Unfortunately the "Build | Generate Ant Build" dialog is missing with my 2020.1 installation (why?).

"Generate Ant build" was moved to "Ant build generation" plugin. You need to install it in 2020 version.

 

> Unfortunately I now get a "Class not found error: javax.swing.JPanel".

There is related issue under investigation: https://youtrack.jetbrains.com/issue/IDEA-207997

 

Also please vote for the this issue: https://youtrack.jetbrains.com/issue/IDEA-223518. Seems that's what you need.

 

1
Avatar
Permanently deleted user

Yes, such a Gradle plugin is exactly what I am searching for.

Thanks.

0
Avatar
Permanently deleted user

Switching back to Java 8 I got it running.

Now, being able to debug the code generator internals, I found it was an internal problem with ANT:

'dropping C:\bin\jdk-12.0.1+12!\java.desktop from path as it doesn't exist'

Seems ANT does not work well with a classpath addressing java9+ modules (generated internally by Idea SDKs settings).

Focusing on Gradle integration, I'll switch over to the Plugin Development discussion ..

0

Please sign in to leave a comment.