【发布时间】:2019-12-23 06:52:58
【问题描述】:
我尝试使用kapt 和vertx-Codegen 来生成我的服务。但是输出路径是/build/generated/source/kapt/main/。我要/src/main/generated/。
配置build.gradle.kts,我发现生成adoc到/src/main/generated/,但其他文件没有变化。
有build.gradle.kts
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.3.30"
kotlin("kapt") version "1.3.30"
id("io.vertx.vertx-plugin") version "0.8.0"
}
val vertxVersion = "3.8.0"
// ......
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "1.8"
}
}
dependencies {
// ....
implementation("io.vertx:vertx-codegen")
kapt("io.vertx:vertx-service-proxy:$vertxVersion:processor")
kapt("io.vertx:vertx-codegen:$vertxVersion:processor")
// ....
}
kapt{
arguments {
arg("codegen.output", project.file("src/main/generated").path)
arg("kapt.kotlin.generated", project.file("src/main/generated").path)
}
javacOptions {
option("-AoutputDirectory", project.file("src/main/generated").path)
option("-Acodegen.output", project.file("src/main/generated").path)
}
}
我希望输出路径是/src/main/generated/,但实际输出路径是/build/generated/source/kapt/main/。你能帮帮我吗?
【问题讨论】: