raulraja
10/04/2019, 6:45 PMe: java.lang.IllegalStateException: The provided plugin arrow.meta.MetaPlugin is not compatible with this version of compiler
My current config for the shadow plugin looks like:
shadowJar {
configurations = [project.configurations.compile]
relocate 'org.jetbrains.kotlin.com.intellij', 'com.intellij'
dependencies {
exclude(dependency {
it.moduleGroup.startsWith('org.jetbrains') || it.moduleGroup.startsWith('org.intellij')
})
}
//relocate 'org.jetbrains.kotlin.load', 'kotlin.reflect.jvm.internal.impl.load'
}
Same behavior regardless if I include the embedded Kotlin deps or not. Whenever I shadow a compiler plugin I get that error. does anyone know if there is a special setting or something I am missing?. The only difference between the jars I’ve noticed is that due to the package relocation the shadowed version may have different size .class files. Any help is much appreciated. Thanks.Hanno
10/04/2019, 8:09 PMraulraja
10/04/2019, 8:14 PMraulraja
10/04/2019, 8:14 PMraulraja
10/04/2019, 8:15 PMraulraja
10/04/2019, 8:15 PMHanno
10/04/2019, 8:42 PMraulraja
10/04/2019, 10:05 PMraulraja
10/04/2019, 10:05 PMraulraja
10/04/2019, 10:05 PMraulraja
10/04/2019, 10:06 PMkralli
10/05/2019, 10:42 AMorg.jetbrains.kotlin:kotlin-compiler
dependency using the com.intellij
namespace. I then repacked it for the gradle cli compiler by chaning the namespace to org.jetbrains.kotlin.com.intellij
. The IDE plugin can directly use the compiler plugin as it makes use of the com.intellij
namespace.raulraja
10/05/2019, 11:33 AMraulraja
10/05/2019, 11:33 AMkralli
10/05/2019, 11:41 AMclass WarnowComponentRegistrar : ComponentRegistrar {
init {
runSafe {
val type = ComponentRegistrar::class.java
LOG.debug { "expected (${type.protectionDomain.codeSource.location})" }
type.declaredMethods.filter { it.name == "registerProjectComponents" }.forEach { LOG.debug { " $it" } }
}
runSafe {
val actual = WarnowComponentRegistrar::class.java
LOG.debug { "actual (${actual.protectionDomain.codeSource.location})" }
actual.declaredMethods.filter { it.name == "registerProjectComponents" }.forEach { LOG.debug { " $it" } }
}
}
private inline fun <T> runSafe(block: () -> T): T? {
return try {
block()
} catch (t: Throwable) {
LOG.error(t) { "failed to read signature" }
null
}
}
override fun registerProjectComponents(
project: MockProject,
configuration: CompilerConfiguration
) { ... }
}
kralli
10/05/2019, 11:42 AMkralli
10/05/2019, 11:43 AMraulraja
10/05/2019, 9:59 PMfabianishere
10/05/2019, 11:24 PMorg.jetbrains.kotlin.com.intellij
from your shadowJar, it will probably work again for the CLI. However, it won’t work in the IDE anymore.fabianishere
10/05/2019, 11:25 PMfabianishere
10/05/2019, 11:26 PMraulraja
10/05/2019, 11:36 PM