Copy entire directory in Gradle -
i have directory structure this:
file1.txt file2.txt dir1/     file3.txt     file4.txt   i want use gradle copy entire structure directory. tried this:
task mytest << {     copy {         "file1.txt"         "file2.txt"         "dir1"          "mytest"     } }   but results in following:
mytest/     file1.txt     file2.txt     file3.txt     file4.txt   see, copy dir1 copied files in dir1, whereas want copy dir1 itself.
is possible directly gradle copy?
so far, have been able come solution:
task mytest << {     copy {         "file1.txt"         "file2.txt"          "mytest"     }      copy {         "dir1"         "mytest/dir1"     } }   for simple example there's not it, in actual case there many directories want copy, , i'd not have repeat much.
you can use . directory path , include specify, files , directories want copy:
copy {     '.'     'mytest'     include 'file*.txt'     include 'dir1/**' }   if both from , into directories, you'll end full copy of source directory in destination directory.
Comments
Post a Comment