class CodeCounter { final static TEXT_EXTENSIONS = [] final static FILES_TO_IGNORE = [] def project def CodeCounter(paths) { // load configuration TEXT_EXTENSIONS.addAll(getClass().getResourceAsStream("/text_extensions.txt").readLines()) FILES_TO_IGNORE.addAll(getClass().getResourceAsStream("/ignore.txt").readLines()) // do the magic project = new ProjectInfo() paths.each({ def path = new File(it) if (! path.exists()) { throw new IllegalArgumentException("\"${it}\" doesn't exist"); } else if (! path.isDirectory()) { throw new IllegalArgumentException("\"${it}\" isn't a directory"); } project.addPath(path) }) } }