gpt4 book ai didi

kotlin - kapt 不启用增量注释处理

转载 作者:行者123 更新时间:2023-12-03 05:25:40 26 4
gpt4 key购买 nike

出于某种原因,Kapt 提示我的一个模块上没有启用增量编译。但是,我认为没有理由不应该这样做。

运行 core:kaptKotlin 时的警告信息

[WARN] Incremental annotation processing requested, but support is disabled because the following processors are not incremental: io.github.mdsimmo.cmdmsg.TextPreprocessor (NON_INCREMENTAL).

错误显示 io.github.mdsimmo.cmdmsg.TextPreprocessor是模块有问题,但我不明白为什么它不是增量的?

我已添加 kapt.incremental.apt=true在每个模块的 gradle.properties (虽然我不应该因为较新的 kapt 版本默认这样做)。

这是 CmdMsgProcessor/build.gradle(包含 TextPreProcessor 的模块):
plugins {
id 'java'
id "org.jetbrains.kotlin.jvm" version "1.3.72"
id "org.jetbrains.kotlin.kapt" version "1.3.72"
id 'idea'
}

repositories {
mavenCentral()
jcenter()
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.+"

implementation project(":cmdMsg")
implementation('com.google.auto.service:auto-service:1.0-rc6')
kapt('com.google.auto.service:auto-service:1.0-rc6')
}

以及 cmdMsg/build.gradle(在 CmdMsgProcessor/build.gradle 中列出的依赖项)
plugins {
id 'java'
id "org.jetbrains.kotlin.jvm" version "1.3.72"
id 'idea'
}

repositories {
mavenCentral()
jcenter()
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.+"
}


我错过了什么?

最佳答案

根据official guide for kapt ,

Currently, annotation processing can be incremental only if all annotation processors being used are incremental.



kapt 警告您 io.github.mdsimmo.cmdmsg.TextPreprocessor不支持增量注释处理,因此整个构建禁用增量处理。

关于kotlin - kapt 不启用增量注释处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61378542/

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