Created
February 26, 2016 05:50
-
-
Save ligi/26e880300af54160c282 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
fun main(args: Array<String>) { | |
val sourceXmlPath = File("/home/ligi/git/VectorDrawableImport/plugin/src/main/resources/data/xml") | |
val resourcePath=File("/home/ligi/git/PassbookForAndroid/android/src/main/res") | |
val map = sourceXmlPath.walk().map { it.name.replace(".xml", "") } | |
val filesToAdd = HashSet<File>() | |
val filesToRemove = HashSet<File>() | |
resourcePath.walk().forEach { | |
if (it.isFile && it.name.startsWith("ic_") && it.name.endsWith(".png")) { | |
val cleanName = it.name.replace("ic_", "").replace(".png", "") | |
if (map.contains(cleanName)) { | |
filesToAdd.add(File(resourcePath,"drawable-anydpi/ic_"+cleanName)) | |
filesToRemove.add(it) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment