diff --git a/1.21-Interacting With The File System/build.gradle b/1.21-Interacting With The File System/build.gradle new file mode 100644 index 000000000..0670d4613 --- /dev/null +++ b/1.21-Interacting With The File System/build.gradle @@ -0,0 +1,101 @@ +/** +Keep a 'images' directory with images of diffrent types and test the code +*/ + +task copyImages(type: Copy){ + + from 'images' + into 'build' +} + +task copyJpegs(type: Copy){ + + from 'images' + include '*.jpg' + into 'build' +} + +task copyPnges(type: Copy){ + + from 'images' + include '*.png' + into 'build' +} + +task copyImageFolders(type: Copy){ + + from('images'){ + include '*.jpg' + into 'jpeg' + } + + from('images'){ + include '*.png' + into 'png' + } + + into 'build' + +} + + +task zipImages(type: Zip){ + + baseName = 'images' + destinationDir = file('build') + from 'images' + +} + + + +task zipImagesFolders(type: Zip){ + + baseName = 'images' + destinationDir = file('build') + + from('images') { + include '*.jpg' + into 'jpeg' + } + + from('images'){ + include '*.png' + into 'png' + } + +} + +task deleteBuild(type: Delete){ + + delete 'build' + +} + + +task unzip(type: Copy){ + + dependsOn 'deleteBuild' + + def zipInput = file('images.zip') + from zipTree(zipInput) + into 'build' +} + + + + + + + + + + + + + + + + + + diff --git a/1.21-Interacting With The File System/images/_test_directory.txt b/1.21-Interacting With The File System/images/_test_directory.txt new file mode 100644 index 000000000..0c7a75b4c --- /dev/null +++ b/1.21-Interacting With The File System/images/_test_directory.txt @@ -0,0 +1 @@ +Put images with *.png, *.jpeg or *.gif in this directory and run the diffrent tasks to check the code output. \ No newline at end of file diff --git a/1.21-Interacting With The File System/images/first.bmp b/1.21-Interacting With The File System/images/first.bmp new file mode 100644 index 000000000..e69de29bb diff --git a/1.21-Interacting With The File System/images/second.png b/1.21-Interacting With The File System/images/second.png new file mode 100644 index 000000000..e69de29bb diff --git a/1.21-Interacting With The File System/images/third.jpg b/1.21-Interacting With The File System/images/third.jpg new file mode 100644 index 000000000..e69de29bb