Created
April 1, 2019 06:35
-
-
Save LiewJunTung/8b84ef83a7e3ce991b059b599d9608c4 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
| task replaceTest { | |
| doLast { | |
| replaceText("$projectDir/tools/app_history_a", "history.txt", "OK Google", "OK Dara") | |
| } | |
| } | |
| void replaceText(String folderPath, String match, String oldText, String newText) { | |
| fileTree(folderPath).matching { | |
| include match | |
| }.each { | |
| println it.text | |
| def replaced = it.text.replace(oldText, newText) | |
| it.setText(replaced) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment