Is there a way I can ask gradle to validate a task...
# community-support
t
Is there a way I can ask gradle to validate a tasks inputs without actually running the task? IE: if a task input gets removed I want to have a CI-PR job fail but not actually run those tasks since they feed a 3rd party api on a separate scheduled job.
A problem was found with the configuration of task 'appuploadAkorbiAssets' (type 'UploadAkorbiAssetTask').
- Type 'com.aetna.akorbi.UploadAkorbiAssetTask' property 'translationTargets.$9.enUsFilePath' specifies file '/home/circleci/project/app/src/main/res-features/notificationcenter/values/strings.xml' which doesn't exist.
attempt thus far was to run with
-m
but it doesn't actually trigger the get() on the task inputs.
only next thing to do I can think of is just add another task type with the same inputs to run. IE:
validateAkorbiConfig
v
You could use an init script for that validation run (or doing it in the build script guarded by a project property, whatever you prefer) that calls
taskActions.clear()
(or was it
actions.clear()
?) on that task so that the actual work is not done, then you "execute" the task. If this does not trigger the input validation as Gradle skips the task for having no actions, just register a no-op action using
doLast {}
after clearing the existing actions.
thank you 1