| //加载本集配置properties文件 | 
| def loadProperties(String name) { | 
|     Properties properties = new Properties() | 
|     InputStream inputStream = project.rootProject.file("${name}.properties").newDataInputStream() | 
|     properties.load(inputStream) | 
|     return properties | 
| } | 
| //递归读取该目录下的文件 | 
| def getAllFiles(ArrayList<File> list, String path) { | 
|     list.clear() | 
|     File file = file(path) | 
|     if (file.isFile()) { | 
|         list.add(file) | 
|         return list | 
|     } | 
|     def files = file.listFiles() | 
|     files.each { | 
|         if (it.isDirectory()) | 
|             getAllFiles(list,it.getAbsolutePath()) | 
|         else | 
|             list.add(it) | 
|         print "\n" | 
|     } | 
|     return list | 
| } | 
|   | 
| ext { | 
|     getAllFiles = this.&getAllFiles | 
|     loadProperties = this.&loadProperties | 
| } |