JetBrains / intellij-platform-gradle-plugin

Gradle plugin for building plugins for IntelliJ-based IDEs
https://plugins.jetbrains.com/docs/intellij/gradle-prerequisites.html
Apache License 2.0
1.42k stars 271 forks source link

Add support for mute switch for plugin verifier #1646

Closed abrooksv closed 3 months ago

abrooksv commented 3 months ago

Describe the need of your request

The latest release of the plugin verifier (https://github.com/JetBrains/intellij-plugin-verifier/releases/tag/1.367) added a -mute switch.

Can this be exposed as a ListProperty<String> on the verifier block?

Proposed solution

Add new provider on the verifier config

Alternatives you've considered

No response

Additional context

No response

YannCebron commented 3 months ago

There's already https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-tasks.html#verifyPlugin-freeArgs which should work. I don't think it makes sense to expose this via dedicated property, given the total number of affected plugins.

vsaar commented 3 months ago

I tried to mute some errors with freeArgs, since my plugin has the intellij identifier in its name and title:

    verifyPlugin {
        ides {
            recommended()
        }
        freeArgs = listOf("-mute TemplateWordInPluginId,TemplateWordInPluginName")
    }

However, this results in the following error:

Exception in thread "main" java.lang.IllegalArgumentException: IDE must reside in a directory: <path-to-plugin>/build/distributions/plugin-1.11.0.zip
    at com.jetbrains.pluginverifier.options.OptionsParser.createIdeDescriptor(OptionsParser.kt:103)
    at com.jetbrains.pluginverifier.tasks.checkPlugin.DefaultIdeDescriptorParser.parseIdeDescriptors(CheckPluginParamsBuilder.kt:126)
    at com.jetbrains.pluginverifier.tasks.checkPlugin.CheckPluginParamsBuilder.build(CheckPluginParamsBuilder.kt:41)
    at com.jetbrains.pluginverifier.tasks.checkPlugin.CheckPluginParamsBuilder.build(CheckPluginParamsBuilder.kt:27)
    at com.jetbrains.pluginverifier.PluginVerifierMain$main$3$1.invoke(PluginVerifierMain.kt:130)
    at com.jetbrains.pluginverifier.PluginVerifierMain$main$3$1.invoke(PluginVerifierMain.kt:123)
    at com.jetbrains.pluginverifier.tasks.profiling.PluginVerificationProfilingsKt.measurePluginVerification(PluginVerificationProfilings.kt:11)
    at com.jetbrains.pluginverifier.PluginVerifierMain.main(PluginVerifierMain.kt:123)

The command line that is generated looks okay to me, so maybe it's an issue with the plugin verifier itself.

abrooksv commented 3 months ago

@vsaar you need to split the list

        freeArgs = listOf(
            "-mute",
            "TemplateWordInPluginId"
        )
vsaar commented 3 months ago

@abrooksv, thanks, that worked. Though it's not very intuitive.

YannCebron commented 3 months ago

Documented https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-faq.html#how-to-mute-specific-problems-in-verifyplugin

Macariel commented 2 months ago

I just want to comment that the problem of not splitting up the single arguments leading to the error IDE must reside in directory has led me on the wildest goose chase. This is probably a case of a problem not being caught at the right place and in combination with the inability to debug Gradle (in Intellij) and some outdated documentation (even though the plugin was just released), see downloadDirectory, which doesn't exist, leads to a very frustrating experience.

abrooksv commented 2 months ago

@Macariel You can usually debug gradle (as far as gradle is debuggable...) by enabling Gradle script debugging

Screenshot 2024-08-02 at 8 23 53 AM