-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotation not available to testFixtures post-Kotlin 2.0.10 #393
Comments
It might be better to no-op the compiler plugin if the runtime isn't present in a compilation unit. |
Not sure Poko's compiler plugin is the problem here - it's that Kotlin, when compiling test fixtures, doesn't find Poko's annotation on the compile classpath. The solution might just be to recommend adding an explicit annotation dependency if you're referencing classes with |
That error comes from the plugin attempting to locate its own runtime: Poko/poko-compiler-plugin/src/main/kotlin/dev/drewhamilton/poko/ir/PokoIrGenerationExtension.kt Line 19 in ab565f5
The compiler plugin is being applied to the test fixture compilation but the runtime is not. The use of the Poko annotation in the main source set and/or referencing types which use it from a test fixture is not a problem. |
Ah! Nice. No-oping the compiler plugin sounds like the move, then. Happy to send a PR through for this shortly. |
It should probably still emit that message as a warning, as you may be defining a custom annotation type and wondering why it isn't working (because of a typo or missing dependency or something). |
Changed the error to an information message to not break |
Kotlin 2.0.10 fixed a bug around friendPaths and test-fixtures, where previously
implementation
dependencies would be exposed to the fixtures compile classpath.Using
@Poko
in main sources without addingtestFixturesImplementation("dev.drewhamilton.poko:poko-annotations:0.17.0")
results in a compilation error due to missing classes:A thought to address this: Configuring the annotations dependency as
api
doesn't feel like the right solution. Is it possible for the Poko Gradle Plugin to add this dependency to the test fixtures configuration if java-test-fixtures is applied?The text was updated successfully, but these errors were encountered: