server
06/11/2022, 6:55 AMdmitriy.novozhilov
06/11/2022, 7:55 AMdmitriy.novozhilov
06/11/2022, 7:56 AMserver
06/11/2022, 11:18 AMserver
06/12/2022, 4:30 AMdmitriy.novozhilov
06/12/2022, 7:33 AMit has .m2 support out of the box.Gradle also supports
.m2
out of box, just add mavenLocal()
to list of repositories. You also can add maven("/some/path")
repository if you want to use some other directory than .m2
How can I connect it in Gradle to a new independent project and use this plugin independently?You need to add your plugin using
-Xplugin=/path/to/plugin.jar
arguments in freeCompilerArgs
for compileKotlin
task
Here is little example how to do it nice if you want to use plugin from some repo instead of manually set path to it:
repositories {
mavenCentral()
mavenLocal() // points to ~/.m2
}
val compilerPlugin by configurations.creating
dependencies {
compilerPlugin("my.awesome:plugin:0.0.1") // name and version of plugin
testImplementation(platform("org.junit:junit-bom:5.8.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
val pluginClasspath = compilerPlugin.files.joinToString(",") { it.canonicalPath }
freeCompilerArgs += "-Xplugin=$pluginClasspath"
}
dmitriy.novozhilov
06/12/2022, 7:34 AMdmitriy.novozhilov
06/12/2022, 7:36 AMquicksteve
06/12/2022, 1:37 PMdmitriy.novozhilov
06/12/2022, 1:38 PMTóth István Zoltán
07/15/2022, 3:20 PM