aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/mcprepack/ProguardWriter.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/mcprepack/ProguardWriter.kt')
-rw-r--r--src/main/kotlin/mcprepack/ProguardWriter.kt35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/main/kotlin/mcprepack/ProguardWriter.kt b/src/main/kotlin/mcprepack/ProguardWriter.kt
new file mode 100644
index 0000000..64d84f8
--- /dev/null
+++ b/src/main/kotlin/mcprepack/ProguardWriter.kt
@@ -0,0 +1,35 @@
+package mcprepack
+
+import java.io.Writer
+
+data class ProguardWriter(val writer: Writer) {
+ fun visitClass(sourceName: String, targetName: String) {
+ writer.write(sourceName)
+ writer.write(" -> ")
+ writer.write(targetName)
+ writer.write(":\n")
+ }
+
+ fun visitField(sourceName: String, targetName: String, proguardType: String) {
+ writer.write(" ")
+ writer.write(proguardType)
+ writer.write(" ")
+ writer.write(sourceName)
+ writer.write(" -> ")
+ writer.write(targetName)
+ writer.write("\n")
+ }
+
+ fun visitMethod(sourceName: String, targetName: String, arguments: List<String>, returnType: String) {
+ writer.write(" ")
+ writer.write(returnType)
+ writer.write(" ")
+ writer.write(sourceName)
+ writer.write("(")
+ writer.write(arguments.joinToString(","))
+ writer.write(") -> ")
+ writer.write(targetName)
+ writer.write("\n")
+ }
+
+} \ No newline at end of file