Created
April 24, 2017 19:27
-
-
Save rotty3000/0c0f0aa152214b4decb8ad8fb5142192 to your computer and use it in GitHub Desktop.
gradle flatten while copy
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
/* | |
Where: | |
origin/ | |
├── foo | |
│ └── fum.txt | |
├── bar | |
│ └── other.txt | |
└── biz | |
└── baf | |
└── bop | |
└── default.properties | |
And desired result is: | |
destination/ | |
└── sub | |
├── fum.txt | |
├── other.txt | |
└── default.properties | |
*/ | |
task copyFile(type: Copy) { | |
from "origin" | |
into "destination" | |
include 'foo/fum.txt', 'bar/other.txt', 'biz/baf/bop/default.properties' | |
eachFile { fcd -> | |
fcd.path = "sub/${cfd.name}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment