Skip to content

Commit

Permalink
Migrate PropertiesFileTransformer.mappings to using Properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Nov 27, 2024
1 parent 77a772c commit 57da1b1
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ public open class PropertiesFileTransformer @Inject constructor(

@Suppress("UNCHECKED_CAST")
@get:Input
public open val mappings: MapProperty<String, Map<String, String>> =
objectFactory.mapProperty(String::class.java, Map::class.java) as MapProperty<String, Map<String, String>>
public open val mappings: MapProperty<String, Properties> =
objectFactory.mapProperty(String::class.java, Map::class.java) as MapProperty<String, Properties>

@get:Input
public open val mergeStrategy: Property<MergeStrategy> = objectFactory.property(MergeStrategy.First)
Expand Down Expand Up @@ -189,11 +189,11 @@ public open class PropertiesFileTransformer @Inject constructor(
val mergeStrategy = mergeStrategy.get().name

mappings[path]?.let {
return it["mergeStrategy"] ?: mergeStrategy
return it.getProperty("mergeStrategy") ?: mergeStrategy
}
for (key in mappings.keys) {
if (key.toRegex().containsMatchIn(path)) {
return mappings[key]?.get("mergeStrategy") ?: mergeStrategy
return mappings[key]?.getProperty("mergeStrategy") ?: mergeStrategy
}
}
return mergeStrategy
Expand All @@ -204,11 +204,11 @@ public open class PropertiesFileTransformer @Inject constructor(
val mergeSeparator = mergeSeparator.get()

mappings[path]?.let {
return it["mergeSeparator"] ?: mergeSeparator
return it.getProperty("mergeSeparator") ?: mergeSeparator
}
for (key in mappings.keys) {
if (key.toRegex().containsMatchIn(path)) {
return mappings[key]?.get("mergeSeparator") ?: mergeSeparator
return mappings[key]?.getProperty("mergeSeparator") ?: mergeSeparator
}
}
return mergeSeparator
Expand Down

0 comments on commit 57da1b1

Please sign in to comment.