0

If I simply add a task definition to build.gradle

task Xml2Java {
    def a;
    a++;
}

, I don't see it in the Gradle Project window.

I can add the configuration:

configure(Xml2Java) {
    group = 'Publishing'
    description = 'Create source code in output directory'
}

Nothing changes.

Please, what steps should I do to create a task and to make it visible in the Gradle Project window in some group?

Gangnus
  • 24,044
  • 16
  • 90
  • 149

2 Answers2

1

Depending on IntelliJ version, please take into consideration that IntelliJ is still not ideal with Gradle, adding dependencies and tasks sometimes need to be refreshed manually, two options here:

  • using a gradle plugin in intellliJ
  • using gradle idea plugin to sync the classpath etc.
LazerBanana
  • 6,865
  • 3
  • 28
  • 47
0

I had found the way out.

It was some strange state of IntelliJ. Normally after changes in tasks and other important things Gradle plugin refreshes all Gradle dependencies automatically. But in my case IntelliJ stopped to do it after any changes in Gradle files of the project.

After pressing the button "Refresh all Gradle projects" that strange state disappeared and now, after any change in task name or config, automatical refresh starts and I see the task in the mentioned group.

It could be a great pain - to try something new on SW in the instable state.

I am afraid, I can't report it as a bug, because I don't know how IJ got into that state and how to repeat it.

Gangnus
  • 24,044
  • 16
  • 90
  • 149