play-services-plugins
play-services-plugins copied to clipboard
Correct task property annotations and some other miscellaneous fixes
Starting with version 6.0 Gradle will show deprecation warnings for tasks with incorrect annotations. The licenses plugin has a number of these, and in this PR I'm attempting to fix them. I also made some other changes:
- upgraded to Gradle 5.6.4 and enabled checks that will fail if task annotations are incorrectly defined
- turned task fields into Groovy properties, as annotations on fields are not supported in Gradle 6.0+
- removed the
OssLicensesCleanupTaskas it's not required:cleanshould already remove the wholebuilddirectory automatically - no need to pass the
outputDirto each task as Gradle takes care of creating parent directories for@OutputFileproperties automatically - made
LicensesTaskcacheable by default, and added the@PathSensitiveannotation for its input file - removed manually recorded inputs and outputs as they are already tracked via task property annotations
There is still the question of DependencyTask.configurations – this is essentially consuming the whole configuration container as input. This is probably not what is intended, but I left it as is. Someone with better understanding of the intention here should capture the inputs and perhaps make the task cacheable if possible in a separate PR.
There are some other things that could also be improved about the plugin in further PRs:
- use lazy task registration (instead of
project.tasks.create()useproject.tasks.register()) - use
RegularFilePropertytypes for the task properties, so they can be connected to each other without having to manually specifydependsOn()relationships.
Any update on this?