Created
January 24, 2013 16:00
-
-
Save scheakur/4623800 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project.ext.files = [] | |
tasks.addRule('Use files as arguments') { taskName -> | |
if (!taskName.equals('dosomething') && file(taskName).isFile()) { | |
files.add taskName | |
task(taskName) // Define task to prevent task-not-found error | |
} | |
} | |
task dosomething << { | |
println 'do something' | |
println files | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gradle dosomething files/a.txt files/b.txt | |
:dosomething | |
do something | |
[files/a.txt, files/b.txt] | |
:files/a.txt UP-TO-DATE | |
:files/b.txt UP-TO-DATE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gradle dosomething files/a.txt files/b.txt -q | |
do something | |
[files/a.txt, files/b.txt] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment