:wave: I’m struggling with some issues while creat...
# gradle
p
👋 I’m struggling with some issues while creating a Gradle plugin generating Java code. Generation is easy but allow IDE to see the code AND compile without error is more difficult. I was thinking
variant.registerJavaGeneratingTask
would be a good way to register output directory + dependsOn the good task like this example: https://github.com/novoda/sqlite-analyzer/blob/master/analyzer/src/main/groovy/com/novoda/sqlite/generator/SqliteAnalyzerPlugin.groovy#L20 Sadly I’m facing errors:
Copy code
> Task :app:compileDebugKotlin FAILED
e:.../app/src/main/java/com/github/pgreze/feature/navigation/MainActivity.kt: (6, 8): Unresolved reference: generated
e: .../app/src/main/java/com/github/pgreze/feature/navigation/MainActivity.kt: (17, 44): Unresolved reference: FeatureNavigator
I tried different strategies including variant.addJavaSourceFoldersToModel / variant.registerExternalAptJavaOutput / and depending on compileDebugKotlin but still the same issue: I can jump to the generated class FeatureNavigator definition but code is not compiling 😢 Thx in advance for your help!