使用Gradle编译项目时IntelliJ正在做什么? [英] What exactly IntelliJ is doing when compiling project using Gradle?

查看:123
本文介绍了使用Gradle编译项目时IntelliJ正在做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IntelliJ IDEA 2016.3添加了将构建/运行委托给Gradle的能力。



很明显,当Gradle中的委托选项正在做所有事情时。



我的问题是IntelliJ在关闭这个选项时做了什么?



我问这个是因为我有自定义代码在我的Gradle文件中,并且它似乎不像在IntelliJ中构建时执行此代码。当我运行 gradlew build 时,一切正常。

解决方案

它自己的构建系统称为JPS,它使用IntelliJ IDEA项目和.iml文件作为项目模型。当您使用IntelliJ IDEA的默认构建系统构建项目时,它不会在Maven或Gradle文件中执行任何代码;它使用自己的逻辑,只能通过将插件编写到JPS来扩展它。

IntelliJ IDEA 2016.3 add the ability to delegate build/run to Gradle.

It's clear that when the delegate option is on Gradle is doing everything.

My question is what exactly IntelliJ is doing when this option is off?

I'm asking this because I have custom code inside my Gradle files and it does not seems like this code is executed when building in IntelliJ. When I run gradlew build everything works just fine.

解决方案

IntelliJ has its own build system, called JPS, which uses the IntelliJ IDEA project and .iml files as the project model. When you're using IntelliJ IDEA's default build system to build the project, it does not execute any code in Maven or Gradle files; it uses its own logic, which can only be extended by writing plugins to JPS.

这篇关于使用Gradle编译项目时IntelliJ正在做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆