This message was deleted.
# plugin-development
s
This message was deleted.
c
If it's compileOnly it wouldn't be available at runtime, resulting in ClassNotFound
e
yeah I understood that much but I also apply the android gradle plugins at the root build.gradle 🤔 It is my understanding that the AGP classes should also get on the script classpath by way of subprojects inheriting from the rootProject classpath?
c
There's a separation between projects; cleanest for each project to specifically setup its config.
e
The way I reasoned this is that • The included build will contribute its classes to the script classpath. It gets on the script classpath by means of the plugin that I apply to my sub projects. The
compileOnly
on its AGP dependency makes it so that only the IPB classes and not agp are contributed but… • Applying the android plugin at the root level build.gradle with apply(false) will put the AGP classes in the root and subprojects script classpaths, and it should all work Obvs this is wrong but I’ll appreciate some insight into why the above is wrong then maybe how to fix it For added context: if I switch AGP dependency to
implementation
it can find the BuildConfigField class but then it raises another error that AGP is already on the classpath with an unknown version so I cannot reapply it in my root build.gradle. My root build.gradle does some common setup and I’m a bit hesitant to move that.
c
Typically a plug-in would have dependent plugins on its implementation configuration, and can itself apply those plugins (or respond to the consuming script applying them). The root project can also use the AGP, just without a version.