JetBrains / gradle-idea-ext-plugin

Plugin to store IJ settings in gradle script
Apache License 2.0
232 stars 39 forks source link

Task declared in beforeRun is added to all run configurations #97

Closed DreierF closed 4 years ago

DreierF commented 4 years ago

Adding a gradle task in the beforeRun block in one of my run configurations adds the task not only to the run configuration it is defined in, but also to all other run configurations. In the example the Simple Run config does also contain the generateMyResources after importing it into IntelliJ.

...
settings {
    runConfigurations {
        'Simple Run config'(Application) {
            mainClass = 'com.MyMain
            moduleName = 'MyProject.module.main'
        }
        'Complex Run Config'(Application) {
            mainClass = 'com.MyMain'
            moduleName = 'MyProject.module.main'
            beforeRun {
                'generateMyResources'(GradleTask) {
                    project('subproject').afterEvaluate {
                        task = project('subproject').tasks.generateMyResources
                    }
                }
            }
        }
    }
}

idea-ext version: 0.7 Gradle: 6.0.1 IntelliJ IDEA Ultimate: 2019.3.1

trunkate commented 4 years ago

I'm facing the same issue even configuring several plugins

idea-ext version: 0.7 Gradle: 6.4 IntelliJ IDEA Ultimate: 2020.1

entrypointkr commented 4 years ago

@nskvortsov I can confirm this fixed by https://github.com/JetBrains/intellij-community/pull/1416

trunkate commented 4 years ago

@nskvortsov I can confirm this fixed by JetBrains/intellij-community#1416 sorry but no,

idea-ext version: 0.8.1 Gradle: 6.4 IntelliJ IDEA Community: 2020.1.3

entrypointkr commented 4 years ago

@trunkate That commit not released yet. Maybe this will available on next version of IDEA. If you want to confirm it, you can with the master branch at least after https://github.com/JetBrains/intellij-community/commit/bf5dc34e951292d6fd4db62607184b30b070c176. See How to build IDEA

perok commented 4 years ago

I'm facing this issue as well.

idea-ext version: 0.8.1 Gradle: 6.6 IntelliJ IDEA Ultimate: 2020.2