What exactly IntelliJ is doing when compiling proj

2019-02-26 08:53发布

问题:

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.

回答1:

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.