Transmode / gradle-docker

A Gradle plugin to build Docker images from the build script.
Apache License 2.0
647 stars 142 forks source link

Set default task inputs and outputs for Docker task #20

Open sfitts opened 10 years ago

sfitts commented 10 years ago

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).

mattgruter commented 10 years ago

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.