1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Add tools.jar on the annotation plug-in classpath.

This commit is contained in:
Cedric Beust 2017-04-19 08:20:02 -07:00
parent 1febd47368
commit 35fe4f6494

View file

@ -151,11 +151,6 @@ class AptPlugin @Inject constructor(val dependencyManager: DependencyManager, va
val allDeps = arrayListOf<IClasspathDependency>()
allDeps.add(annotationProcessorDependency())
allDeps.addAll(aptJarDependencies(project))
// jvm.toolsJar?.let { toolsJar ->
// allDeps.add(FileDependency(toolsJar.absolutePath))
// }
return allDeps
}
@ -175,11 +170,17 @@ class AptPlugin @Inject constructor(val dependencyManager: DependencyManager, va
val allDeps = allDependencies(project)
flags.add("-Xplugin")
flags.add(annotationProcessorDependency().jarFile.get().absolutePath)
flags.add("-P")
// Also need tools.jar on the plug-in classpath
jvm.toolsJar?.let { toolsJar ->
flags.add("-Xplugin")
flags.add(toolsJar.absolutePath)
}
//
// Pass options to the annotation plugin
//
flags.add("-P")
fun kaptPluginFlag(flagValue: String) = "plugin:org.jetbrains.kotlin.kapt3:$flagValue"
val kaptPluginFlags = arrayListOf<String>()
val verbose = KobaltLogger.LOG_LEVEL >= 2