This message was deleted.
# plugin-development
s
This message was deleted.
c
You cannot set the version of the plugin in your test build.gradle, you need to add it to the classpath
WithPluginClasspath is the usual way
If you want to use other versions... You can create another configuration and do .. // Inspired by: https://github.com/square/sqldelight/blob/83145b28cbdd949e98e87819299638074bd21147/sqldelight-gradle-plugin/build.gradle#L18 // Append any extra dependencies to the test fixtures via a custom configuration classpath. This // allows us to apply additional plugins in a fixture while still leveraging dependency resolution // and de-duplication semantics. tasks.named("pluginUnderTestMetadata", PluginUnderTestMetadata::class.java) { pluginClasspath.from(fixtureClasspath) }
v
And if you want to use second approach, better use a dedicated directory instead of
mavenLocal()
or at least use a repository content filter so that only your plugin is taken from there.
👍 3
m
I want use WithPluginClasspath way! But it fail, because gradle do not resolve all dependency for kotlin plugin, and i have ClassNotFoundException
I was expecting the WithPluginClasspath way to resolve the same kotlin dependencies as publicToLocalMaven. But that's not true. Same project with publicToLocalMaven way build successfully, but with WithPluginClasspath way faild with ClassNotFoundException
if these methods lead to different sets of dependencies, then should i prefer publicToLocalMaven because it's more reliable?
Cristian, i read you note, and try to analyze you repository, but it is so hard for me. As I understand it, you were talking about extra dependencies, but I have a problem with core gradle dependencies(kotlin-gradle-plugin-api missing)