gpt4 book ai didi

Gradle增量java编译导致完全重新编译

转载 作者:行者123 更新时间:2023-12-04 16:06:59 32 4
gpt4 key购买 nike

我只更改一个源文件并重新启动构建:

$ gradle jar
Incremental java compilation is an incubating feature.
:compileJava
Full recompilation is required because 'XXX.java' was changed.
Analysis took 0.241 secs.

我的gradle配置有:
compileJava {
options.fork = true
options.incremental = true
}

我希望 Gradle 只重新编译 XXX.java,这不是它应该做的吗?

最佳答案

我不知道该功能究竟是如何工作的,但根据 release notes for Gradle 2.1 ,

The current implementation is not able to fully analyze the impact of all changes to the source code in terms of identifying exactly which classes need to be recompiled. In such situations, all of the source will be recompiled in order to avoid inconsistent compilation results. Incremental Java compilation will improve over coming Gradle versions to be generally faster, and to invoke a full recompile in response to fewer types of changes.



这是几个版本之前的,但您没有指定您使用的是哪个版本。我想在某些情况下可能仍然需要重新编译几个类。

关于Gradle增量java编译导致完全重新编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37732179/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com