简体   繁体   中英

How do you run a Gradle task after IntelliJ imports a project from Gradle?

I'd like to be able to trigger the execution of a Gradle task right after IDEA imports my projects. Currently, I'm attempting to work around IDEA-96615 and GRADLE-2198 , but I have some other use cases, such as perhaps generating some source files.

Based upon the documentation from IDEA, I'm not running gradle idea prior to importing because that generates the old style of projects, not the directory based .idea one.

Let me know if I'm misinterpreting what you want, but I'll give it a try.

(this solution works for 2016.2 , and I believe for 15 )

What you can do is go to View -> Tool Windows -> Gradle

Then, click the little Gradle symbol, and it'll let you execute a gradle task: 在此输入图像描述

在此输入图像描述

Hope this helps :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM