diff --git a/deob-processor/build.gradle.kts b/deob-processor/build.gradle.kts index 6e5650de81..c731842ba8 100644 --- a/deob-processor/build.gradle.kts +++ b/deob-processor/build.gradle.kts @@ -6,8 +6,7 @@ plugins { dependencies { implementation(project(":deob-annotations")) implementation(project(":deob-map")) - implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${Versions.jackson}") - implementation("com.fasterxml.jackson.module:jackson-module-kotlin:${Versions.jackson}") + implementation(project(":yaml")) } publishing { diff --git a/deob-processor/src/main/java/dev/openrs2/deob/processor/NameMapProcessor.kt b/deob-processor/src/main/java/dev/openrs2/deob/processor/NameMapProcessor.kt index b2be0dc865..9e98a18245 100644 --- a/deob-processor/src/main/java/dev/openrs2/deob/processor/NameMapProcessor.kt +++ b/deob-processor/src/main/java/dev/openrs2/deob/processor/NameMapProcessor.kt @@ -1,8 +1,7 @@ package dev.openrs2.deob.processor import com.fasterxml.jackson.databind.ObjectMapper -import com.fasterxml.jackson.dataformat.yaml.YAMLFactory -import com.fasterxml.jackson.module.kotlin.registerKotlinModule +import com.google.inject.Guice import com.sun.source.util.Trees import dev.openrs2.asm.MemberRef import dev.openrs2.asm.toInternalClassName @@ -12,6 +11,7 @@ import dev.openrs2.deob.annotation.OriginalMember import dev.openrs2.deob.map.Field import dev.openrs2.deob.map.Method import dev.openrs2.deob.map.NameMap +import dev.openrs2.yaml.YamlModule import java.nio.file.Files import java.nio.file.Path import java.nio.file.Paths @@ -41,9 +41,15 @@ class NameMapProcessor : AbstractProcessor() { private val classes = TreeMap() private val fields = TreeMap() private val methods = TreeMap() + private val mapper: ObjectMapper private lateinit var trees: Trees private lateinit var localScanner: LocalVariableScanner + init { + val injector = Guice.createInjector(YamlModule()) + mapper = injector.getInstance(ObjectMapper::class.java) + } + override fun init(env: ProcessingEnvironment) { super.init(env) trees = Trees.instance(env) @@ -92,7 +98,6 @@ class NameMapProcessor : AbstractProcessor() { if (env.processingOver()) { Files.newBufferedWriter(mapPath).use { writer -> - val mapper = ObjectMapper(YAMLFactory()).registerKotlinModule() mapper.writeValue(writer, NameMap(classes, fields, methods)) } }