Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions 1.21-Interacting With The File System/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
}


















Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Put images with *.png, *.jpeg or *.gif in this directory and run the diffrent tasks to check the code output.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.