Rename packages in protobuf-java binaries and sources

#KT-12581 In Progress
This commit is contained in:
Alexander Udalov
2016-06-07 18:56:00 +03:00
parent b1734920b6
commit 952a85414b
2 changed files with 66 additions and 38 deletions
@@ -71,9 +71,10 @@ fun main(args: Array<String>) {
assert(liteProfileReached && keepClasses.isNotEmpty()) { "Wrong pom.xml or the format has changed, check its contents at $POM_PATH" }
ZipOutputStream(BufferedOutputStream(FileOutputStream(File(outputPath)))).use { output ->
val outputFile = File(outputPath).apply { delete() }
ZipOutputStream(BufferedOutputStream(FileOutputStream(outputFile))).use { output ->
for ((name, value) in allFiles) {
val className = name.substringAfter("com/google/protobuf/").substringBeforeLast(".class")
val className = name.substringAfter("org/jetbrains/kotlin/protobuf/").substringBeforeLast(".class")
if (keepClasses.any { className == it || className.startsWith(it + "$") }) {
val (entry, bytes) = value
output.putNextEntry(entry)