How do I open the Gradle tasks window in Intellij? - intellij-idea

This is probably a very silly question, but I cannot find the gradle tasks window, like with compile, clean, build, instrument etc.
Can anyone help me? Thanks

View -> Tool Windows -> Gradle

In my case the Gradle window was not in the Tool Windosws menu because the project was not linked with Gradle yet. IntelliJ eventually detected that the Gradle files in the project and suggested to link it.
After that (as mentioned by #RaGe) the Gradle window could be surfaced using:
View -> Tool Windows -> Gradle

Related

Missing project level settings

I am running 2018.3 CE of IntelliJ on MacOS Mojave. For some reason I when I pick Preferences -> Build, Execution, Deployment -> Gradle I don't see any of the "Project-level settings". Any help will be very much appreciated.
Do you have a project open that was imported from build.gradle? Some options become available only with the open project and not from the Welcome Screen. Some options are also hidden if the project was not imported from Gradle.

Dependency graph in Gradle projects

Is there a way to get the equivalent of Maven Dependency Graph but for Gradle projects in IntelliJ IDEA Ultimate?
They released that feature on 2019.2.
To view Gradle dependencies as a diagram, click on the Show Dependencies icon on the Gradle tool window toolbar or use the shortcut Alt+Shift+Ctrl+U on Linux and Windows / Alt+Shift+Cmd+U on macOS.
https://blog.jetbrains.com/idea/2019/06/intellij-idea-2019-2-eap6-gradle-dependencies-diagram-and-more/
May be very late to answer, but have you checked https://plugins.jetbrains.com/plugin/7150-gradle-view

IntelliJ IDEA Kotlin plugin - "there aren't configurators available"

I'm having problems using the Kotlin plugin in IntelliJ IDEA. First, upon opening a kotlin project, it pops up that I need to configure Kotlin in this project. But when I do so from the Tools menu, it says "there aren't configurators available"
I had this same problem in Android Studio 3.0 Canary 1. Cneal build, Synchronize, Invalidate Caches and Restart didn't help.
The only thing that worked was to make a change to a build.gradle file and click "Sync now".
I had the same problem with one of my Kotlin gradle project.
Go to View -> Tool Windows -> Gradle. There should be a Reimport all Gradle Projects icon at the top. (Circle with double arrows). Just click on it and it should refresh your gradle project with Kotlin configuration.
I realized the problem was my Gradle plugin was disabled.
This happened to me with Kotlin 1.3 and IntelliJ 2018.2.6.
I tried all the above solutions listed---none of them worked until I actually deleted the .idea folder and .iml file from my Kotlin gradle project directory and then re-imported them in IDEA, then all was well.
Restarting Android Studio and then going to File -> Invalidate Caches, checking "Clear file system cache and Local History" and "Clear VCS Log caches and indexes", and clicking the "Invalidate and Restart" submit button fixed the problem for me :)

Skip tests in IntelliJ using Gradle

Does anyone know how I can skip JUnit tests in IntelliJ when doing a Gradle build like the following command line version? I have searched extensively for a solution but can't find one. I am in the process of converting an existing project to Gradle and need to support many developers that are not familiar with Gradle, some UX, some front end, and some Java. There are many broken Junit tests in the myriad modules and long-term we will fix them. Short term I need all other developers to use the tools they are familiar with to be able to do their job easily.
./gradlew build -x test
The Gradle-Android Compiler settings allow for command-line options but not non-android projects as shown in the IntelliJ settings dialog shown below.
You should be able to run a standard clean build from intellij if it's a gradle project (aka gradle integration in intellij). Then edit the configuration and add at the script parameters : -x test which will run the clean build (or any other task) without running tests.
I am using Intellij IDEA 2019.3 (Community Edition).
You can skip test using following settings.
You can get to this via Gradle panel located at right top corner.
Select task -> Run Configuration -> Right click -> Edit Run Configuration..
From intellij 2021.2 onwards, type the argument directly in Run text

How to use an existing Gradle project in IntelliJ IDEA 13/14

I am using Gradle and IntelliJ IDEA. Normally I use apply plugin: 'idea' to generate the IDEA project files. With IDEA 12 I was used to work with the JetGradle tool view.
Now I updated to IDEA 13 and the JetGradle tool view is gone. When I use the old run configuration gradle:run, IDEA tells me:
Error running gradle:run:
Module 'X' is not backed by gradle.
How can I activate the gradle build in IDEA 13 without the tool view? I found this tweet from Cédric Champeau, but was still not able to solve it. Do I have to turn my simple gradle project into a multi module project or what?
Update
With File - Import Project ... I can import the build.gradle file and than I can choose View - Tool Windows - Gradle, which was hidden before. Is this the way to go?
What you state in your update is the correct way to go. The Gradle Plug-in received a lot of love in the IDEA 13 update and has changed a bit. An import of the Gradle build file is necessary. And as you have noted, the JetGradle tool window is now named simple Gradle
Tested with Gradle 1.9. In my opinion there are 2 issues:
Issue 1: when using gradlew idea I expect to receive a valid IDEA project without the need to import it. There are discussions on the gradle forum, see this Gradle forum post. In this Jetbrains forum post it is told that there is no backward compatibility with IntelliJ 12 gradle projects at the moment.
Issue 2: With IDEA 12 it was possible to open the JetGradle View even if the current project was not a gradle projcet. But the view displayed the message "There is no linked Gradle project. You can Add one" and offered you the possibility to convert the project to an gradle project with a simple click. In IDEA 13 it is not possible to open the Gradle View when the current project is not a gradle project. I asked a question here.
In the Gradle forum post mentioned above Peter Niederweiser stated:
The preferred way of integrating with IDEA 13 is to use IDEA's Gradle import, without running gradle idea. (You should still apply the idea plugin though, and it's still important to apply it to allprojects {} rather than subprojects {} when dealing with multi-project builds.)
So the answer from Mark Vedder is correct, altough I would have liked to have more information.
I have found that when you initially import a gradle project into Idea, if you don't have all of your directories created yet, the gradle tool window vanishes while you are importing into Idea. (It is there when the import starts, but at the end it disappears.) However, if I manually build the project first (on a mac, >gradle clean build), and then go back to IDEA and import the project, the gradle tool window stays active. Hopefully this will help someone else.
you can go to Project Structure (Ctrl + Alt + Shift +S) and then under the Modules, click "Import Module" and choose your build.gradle from the project file repo. It will make the module gradle aware and then you will also see the Gradle window
The simplest way to do this is to use the Import Project option if you cannot use the gradlew idea to produce the idea project