Kotlin UI DSL Version 2 compatibility problems against IU-222.4459.24

Answered

Dear Sir/Madam,

I hope you're having great times.

I updated my plugin settings to Kotlin UI DSL Version 2. However when I run `Run Verifications`, it throws the below error (you can also check this GitHub action);

Plugin com.github.yusufugurozbek.testcontainers.port.updater:1.1.0 against IU-222.4459.24: 6 compatibility problems
Compatibility problems (6): 
    #Invocation of unresolved method com.intellij.ui.dsl.builder.Panel.row$default(Panel, JLabel, Function1, int, Object) : Row
        Method com.github.yusufugurozbek.testcontainers.port.updater.settings.TpuSettingsComponent.settingsPanel$1$3.invoke(com.intellij.ui.dsl.builder.Panel $this$buttonsGroup) : void contains an *invokestatic* instruction referencing an unresolved method com.intellij.ui.dsl.builder.Panel.row$default(com.intellij.ui.dsl.builder.Panel, javax.swing.JLabel, kotlin.jvm.functions.Function1, int, java.lang.Object) : com.intellij.ui.dsl.builder.Row. This can lead to **NoSuchMethodError** exception at runtime.
        The method might have been declared in the super interface: com.intellij.ui.dsl.builder.CellBase
        Method com.github.yusufugurozbek.testcontainers.port.updater.settings.TpuSettingsComponent.settingsPanel$1.invoke(com.intellij.ui.dsl.builder.Panel $this$panel) : void contains an *invokestatic* instruction referencing an unresolved method com.intellij.ui.dsl.builder.Panel.row$default(com.intellij.ui.dsl.builder.Panel, javax.swing.JLabel, kotlin.jvm.functions.Function1, int, java.lang.Object) : com.intellij.ui.dsl.builder.Row. This can lead to **NoSuchMethodError** exception at runtime.
        The method might have been declared in the super interface: com.intellij.ui.dsl.builder.CellBase
    #Invocation of unresolved method com.intellij.ui.dsl.builder.Panel.buttonsGroup$default(Panel, String, boolean, Function1, int, Object) : ButtonsGroup
        Method com.github.yusufugurozbek.testcontainers.port.updater.settings.TpuSettingsComponent.settingsPanel$1.invoke(com.intellij.ui.dsl.builder.Panel $this$panel) : void contains an *invokestatic* instruction referencing an unresolved method com.intellij.ui.dsl.builder.Panel.buttonsGroup$default(com.intellij.ui.dsl.builder.Panel, java.lang.String, boolean, kotlin.jvm.functions.Function1, int, java.lang.Object) : com.intellij.ui.dsl.builder.ButtonsGroup. This can lead to **NoSuchMethodError** exception at runtime.
        The method might have been declared in the super interface: com.intellij.ui.dsl.builder.CellBase
    #Invocation of unresolved method com.intellij.ui.dsl.builder.Row.text$default(Row, String, int, HyperlinkEventAction, int, Object) : Cell
        Method com.github.yusufugurozbek.testcontainers.port.updater.settings.TpuSettingsComponent.settingsPanel$1$5.invoke(com.intellij.ui.dsl.builder.Row $this$row) : void contains an *invokestatic* instruction referencing an unresolved method com.intellij.ui.dsl.builder.Row.text$default(com.intellij.ui.dsl.builder.Row, java.lang.String, int, com.intellij.ui.dsl.builder.HyperlinkEventAction, int, java.lang.Object) : com.intellij.ui.dsl.builder.Cell. This can lead to **NoSuchMethodError** exception at runtime.
        Method com.github.yusufugurozbek.testcontainers.port.updater.settings.TpuSettingsComponent.settingsPanel$1$3$1.invoke(com.intellij.ui.dsl.builder.Row $this$row) : void contains an *invokestatic* instruction referencing an unresolved method com.intellij.ui.dsl.builder.Row.text$default(com.intellij.ui.dsl.builder.Row, java.lang.String, int, com.intellij.ui.dsl.builder.HyperlinkEventAction, int, java.lang.Object) : com.intellij.ui.dsl.builder.Cell. This can lead to **NoSuchMethodError** exception at runtime.
    #Invocation of unresolved method com.intellij.ui.dsl.builder.Panel.separator$default(Panel, Color, int, Object) : Row
        Method com.github.yusufugurozbek.testcontainers.port.updater.settings.TpuSettingsComponent.settingsPanel$1.invoke(com.intellij.ui.dsl.builder.Panel $this$panel) : void contains an *invokestatic* instruction referencing an unresolved method com.intellij.ui.dsl.builder.Panel.separator$default(com.intellij.ui.dsl.builder.Panel, java.awt.Color, int, java.lang.Object) : com.intellij.ui.dsl.builder.Row. This can lead to **NoSuchMethodError** exception at runtime.
        The method might have been declared in the super interface: com.intellij.ui.dsl.builder.CellBase

I changed the `platformVersion` locally and run the plugin against the `2022.2.4`. Everything looks fine.

My changes on the next branch and I put the settings component here:

package com.github.yusufugurozbek.testcontainers.port.updater.settings

import com.github.yusufugurozbek.testcontainers.port.updater.common.TpuBundle
import com.intellij.openapi.ui.DialogPanel
import com.intellij.openapi.util.Disposer
import com.intellij.ui.dsl.builder.bind
import com.intellij.ui.dsl.builder.bindSelected
import com.intellij.ui.dsl.builder.bindText
import com.intellij.ui.dsl.builder.panel
import com.intellij.ui.dsl.gridLayout.HorizontalAlign
import com.intellij.ui.dsl.gridLayout.VerticalAlign


class TpuSettingsComponent(private val tpuSettingsState: TpuSettingsState) {
    private val disposable = Disposer.newDisposable()

    val settingsPanel: DialogPanel = panel {
        row {
            checkBox(TpuBundle.message("settings.isNotificationsEnabledText")).bindSelected(tpuSettingsState::isNotificationsEnabled)
                .focused()
        }

        separator()

        row(TpuBundle.message("settings.logEntryPrefixText")) {
            textField().bindText(tpuSettingsState::logEntryPrefix)
                .validationOnInput { if (it.text.isEmpty()) error(TpuBundle.message("settings.logEntryPrefixMustBeGiven")) else null }
        }

        separator()

        buttonsGroup(TpuBundle.message("settings.matchModeText")) {
            row {
                text(TpuBundle.message("settings.matchModeMoreDetailsText"))
            }
            row {
                radioButton(TpuBundle.message("settings.matchModeExactRadioButtonText"), MatchMode.EXACT)
            }
            row {
                radioButton(TpuBundle.message("settings.matchModeEverythingRadioButtonText"), MatchMode.EVERYTHING)
            }
            row {
                radioButton(
                    TpuBundle.message("settings.matchModeWithTcParameterRadioButtonText"),
                    MatchMode.WITH_TESTCONTAINERS_PARAMETER
                )
            }
        }.bind(tpuSettingsState::matchMode)

        separator()

        row {
            text(TpuBundle.message("settings.giveAStar"))
                .verticalAlign(VerticalAlign.BOTTOM)
                .horizontalAlign(HorizontalAlign.RIGHT)
        }
    }.also { it.registerValidators(disposable) }
}

I am looking forward to hearing your answer.

Kind regards,
Yusuf Ugur ÖZBEK

0
3 comments

The plugin is built against 2022.3 but should run on 2022.2.

https://github.com/yusufugurozbek/testcontainers-port-updater/blob/next/gradle.properties#L15

Please try building the plugin against the lowest supported IDE version instead.

0

That looks like it solves my issue. Many thanks for your support Yann Cebron

Could you please point me a documentation which describes that? Shouldn't this one describe what you said?

0

It's currently not documented explicitly anywhere but we plan to document the strategies around building for multiple/large range of supported IDE versions.

The default behavior of Gradle IntelliJ Plugin is indeed to set the since-build to the target IDE platform version, so it's guaranteed to be safe.

0

Please sign in to leave a comment.