Created
May 27, 2013 07:50
-
-
Save koenongena/5655702 to your computer and use it in GitHub Desktop.
Rename build.gradle files to ${projectName}.gradle
This file contains 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
import static groovy.io.FileType.* | |
import static groovy.io.FileVisitResult.* | |
def currentFolder = new File(".") | |
def handleBuildFile = {File it -> | |
def folderName = it.parentFile.getName() | |
if (folderName != '.'){ | |
it.renameTo(new File(it.getParentFile(), "${folderName}.gradle")) | |
} | |
} | |
currentFolder.traverse ( | |
type: FILES, nameFilter: ~/build\.gradle$/, visit: handleBuildFile | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment