Skip to content

Instantly share code, notes, and snippets.

@ligi
Created February 26, 2016 05:50
Show Gist options
  • Save ligi/26e880300af54160c282 to your computer and use it in GitHub Desktop.
Save ligi/26e880300af54160c282 to your computer and use it in GitHub Desktop.
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