You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The plugin is sensitive to application order.
This is discouraged bad practice and should be avoided.
Currently, the plugin checks in its apply method project.getPlugins().hasPlugin('com.android.application') and uses a different report task class accordingly.
Using project.getPlugins() per-se is bad already (see its JavaDoc).
But even if using the recommended alternative project.getPluginManager().hasPlugin(...), this would not fix the ordering sensitivity.
This only works as intended when the Android Application Plugin is applied before the License Report Plugin.
And also only if they are applied to the same project.
I don't know why you only make the task cacheable if the Android Application Plugin is not applied too, but if there is a substantial reason, it might also cause problems when applying the License Report Plugin to the root project and the Android Application Plugin to some subproject?
But even if the problem with cacheability really is only there if the two plugins are applied to the same project, the @Classpath input should most probably always be there, not only when the task is cacheable, or you might for example miss some implicit task dependencies that would have been necessary.
So I would suggest to
move the @Classpath property to the ReportTask,
declare the ReportTask as @CacheableTask,
delete the CacheableReportTask,
if the task really must not be cacheable if the Android Application Plugin is applied to the same project, then just use the runtime api like
Hi @Vampire! Thank you for bringing this up. It was actually lazy me back then who disabled caching for android projects in #119 instead of fixing it. So I believe that the ordering issue can be solved in a way you suggested.
The project.getPlugins().hasPlugin('com.android.application') clause is also used to determine configuration default, but this is something I can also work around.
The plugin is sensitive to application order.
This is discouraged bad practice and should be avoided.
Currently, the plugin checks in its
apply
methodproject.getPlugins().hasPlugin('com.android.application')
and uses a different report task class accordingly.Using
project.getPlugins()
per-se is bad already (see its JavaDoc).But even if using the recommended alternative
project.getPluginManager().hasPlugin(...)
, this would not fix the ordering sensitivity.This only works as intended when the Android Application Plugin is applied before the License Report Plugin.
And also only if they are applied to the same project.
I don't know why you only make the task cacheable if the Android Application Plugin is not applied too, but if there is a substantial reason, it might also cause problems when applying the License Report Plugin to the root project and the Android Application Plugin to some subproject?
But even if the problem with cacheability really is only there if the two plugins are applied to the same project, the
@Classpath
input should most probably always be there, not only when the task is cacheable, or you might for example miss some implicit task dependencies that would have been necessary.So I would suggest to
@Classpath
property to theReportTask
,ReportTask
as@CacheableTask
,CacheableReportTask
,The text was updated successfully, but these errors were encountered: