I am developing a library for creating classes using annotations and processors. Generated classes must use the Gson library from Google.
My question is: Where should I add the Gson dependency? I am now adding it to the build.gradle processor, but when the classes are generated, Gson is not found, and Android Studio offers to add it to the application module.
processor build.gradle :
implementation project(':lib-annotation') implementation 'com.squareup:javapoet:1.9.0' implementation 'com.google.code.gson:gson:2.8.1' implementation 'com.google.auto.service:auto-service:1.0-rc3'
build.gradle application :
implementation project(':lib-annotation') annotationProcessor project(':lib-processor')
Any help would be greatly appreciated, thanks!
PS The project should be a library. I expect that users will only include my library in their gradle file, and not "dependency dependent".
java android gson annotations dependencies
Omar aflak
source share