Last active
August 29, 2015 14:03
-
-
Save sizovs/1b1f3753198d91bb2420 to your computer and use it in GitHub Desktop.
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
new File('.').eachFileRecurse(groovy.io.FileType.FILES) { | |
if (it.name.endsWith(".java")) { | |
def hits = it.text =~ /\/\/\s*DROP\s*\[\s*(.*)\s*\]\n/ | |
hits.each { match, key -> | |
def dropConditionForAGivenKey = dropConditions[(key)] | |
if (!dropConditionForAGivenKey) { | |
println("<!> Cannot find drop conditions for key '$key'") | |
return | |
} | |
try { | |
def canBeDropped = dropConditionForAGivenKey() | |
if (canBeDropped) { | |
println "--- Drop condition for key '$key' is satisfied. Time to cleanup $it.name" | |
} | |
} catch (IOException ioException) { | |
println("<!> Cannot evaluate drop condition for key '$key' due to: $ioException") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment