gradle-docker
gradle-docker copied to clipboard
Set default task inputs and outputs for Docker task
Whenever I make a new Docker task I pretty much always add the following:
inputs.file 'build.gradle'
outputs.dir stageDir
That way the task doesn't always execute and is re-run if I change the task definition. Seems like it might be nice to add this by default (if there is a way to only re-run if the specific task is redefined that would be great, but the build file is a reasonable proxy if that isn't possible).
The inputs to the task should probably be the files that are added to the image. If no files are added then build.gradle serves as a good proxy.
Maybe Gradle's incremental task feature (http://www.gradle.org/docs/current/userguide/custom_tasks.html) might be helpful as well.