outputs keep track of changes and only run if necessary • doLast means “run in build phase” • convert is a groovy function that I made up task convert { FileTree inputFiles = fileTree(dir:'icons/widget', include: '**/*.svg') inputs.files inputFiles outputs.files findOutFiles(res, inputFiles, [‘xxhdpi', 'xhdpi', 'hdpi', 'mdpi', 'ldpi'], '') doLast { def res = ‘src/main/res’ convert(res, 'icons/widget', '', ‘xxhdpi’, '3') convert(res, 'icons/widget', '', ‘xhdpi’, '2') convert(res, 'icons/widget', '', ‘hdpi’, '1.5') convert(res, 'icons/widget', '', ‘mdpi’, '1') convert(res, 'icons/widget', '', ‘ldpi’, '.75') } }