intellij-platform-gradle-plugin icon indicating copy to clipboard operation
intellij-platform-gradle-plugin copied to clipboard

Adds a `testPlugins`

Open bric3 opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. Often during development, the tests requires some plugin to make the test runnable. I would like to limit the actual dependencies (as in compile time dependencies). So I would like to be able to express these runtime dependencies in different scope.

Describe the solution you'd like

At this time the plugins are declared in the intellij extension, so this would like :

intellij {
   // ...

   plugins.set(
       "org.intellij.plugins.markdown",
   )
   testPlugins.set(
       "org.intellij.plugins.markdown",
       "com.intellij.java",
   )
}

Note the testPlugins in this proposition do not inherit the plugins list, so that custom configurations could be used with or without plugins. That said I wonder if this is the right approach.

Describe alternatives you've considered

At this time, the code has to declare plugins in the compile scope even if those are only used for tests, e.g.:

intellij {
    type.set("IC")
    plugins.set(
        listOf(
            "Git4Idea",
            "com.intellij.java" // for tests
            "org.intellij.plugins.markdown",
        )
    )
}

Additional context Somewhat related but out of scope, I believe plugins should be declared as dependencies with their configurations in order to rely on the Gradle semantics, e.g.

dependencies {
    // regular dependencies
    implementation(...)
    testImplementation(...)

    // plugins
    plugin(...)
    testPlugin(...)
}

bric3 avatar May 10 '23 10:05 bric3

related #336, #115, #1586

YannCebron avatar May 11 '23 11:05 YannCebron

Starting with 2.0 release, it is now possible to register new test/run tasks with customized IntelliJ Platform and plugins set:

val customRunIde by intellijPlatformTesting.runIde.registering {
    type = IntelliJPlatformType.Rider
    version = "2024.2"

    plugins {
        plugin("pluginId:version")
        plugin(pluginId, version, channel)
        disablePlugins(bundledPlugiId)
    }
}

val customTest by intellijPlatformTesting.testIde.registering {
    ...
}

hsz avatar Jul 03 '24 20:07 hsz