Skip to content

Commit

Permalink
Fixed unescape property not working
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanImperato committed Nov 20, 2024
1 parent bbfdb4f commit 68a3b3b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugin-build/buildSrc/src/main/java/Coordinates.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
object PluginCoordinates {
const val ID = "io.github.jonathanimperato.loco-sync"
const val GROUP = "io.github.jonathanimperato"
const val VERSION = "0.0.21"
const val VERSION = "0.0.22"
const val IMPLEMENTATION_CLASS = "io.github.jonathanimperato.loco.sync.LocoSyncPlugin"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ abstract class GenerateResourcesTask : DefaultTask() {
fun generate() {
configs.get().forEach { config ->
val resDir = config.resDir
val unescape = config.unescape
val defLang = config.defaultLanguage
config.languages.forEach {
var lang = it
Expand All @@ -45,10 +46,8 @@ abstract class GenerateResourcesTask : DefaultTask() {
val directory = File("$resDir/values$appendix/")
if (!directory.exists()) directory.mkdir()
val file = File(directory.absolutePath + "/" + config.fileName + ".xml")
val textContent = inputStream.bufferedReader().readText().apply {
if (!config.isAndroid) unescapeXml()
}
file.writeText(textContent, Charsets.UTF_8)
val textContent = inputStream.bufferedReader().readText()
file.writeText(if (unescape) textContent.unescapeXml() else textContent, Charsets.UTF_8)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ open class LocoConfig {
var languages: Array<String> = arrayOf("en")
var defaultLanguage: String = "en"
var resDir : String = ""
var isAndroid : Boolean = true
var unescape : Boolean = false
}

0 comments on commit 68a3b3b

Please sign in to comment.