Browse Source

Rename properties of GeneratePluralRuleListsTask

pull/4519/head
Chanjung Kim 8 months ago
parent
commit
7f3db17c1c
  1. 9
      components/buildSrc/src/main/kotlin/GeneratePluralRuleListsTask.kt
  2. 5
      components/resources/library/build.gradle.kts

9
components/buildSrc/src/main/kotlin/GeneratePluralRuleListsTask.kt

@ -6,7 +6,6 @@
import groovy.util.Node
import groovy.xml.XmlParser
import org.gradle.api.DefaultTask
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.*
@ -21,20 +20,20 @@ abstract class GeneratePluralRuleListsTask : DefaultTask() {
abstract val pluralsFile: RegularFileProperty
@get:OutputFile
abstract val mainDir: RegularFileProperty
abstract val outputFile: RegularFileProperty
@get:OutputFile
abstract val testDir: RegularFileProperty
abstract val samplesOutputFile: RegularFileProperty
@TaskAction
fun generatePluralRuleLists() {
val pluralRuleLists = parsePluralRuleLists()
val mainContent = generateMainContent(pluralRuleLists)
mainDir.get().asFile.writeText(mainContent)
outputFile.get().asFile.writeText(mainContent)
val testContent = generateTestContent(pluralRuleLists)
testDir.get().asFile.writeText(testContent)
samplesOutputFile.get().asFile.writeText(testContent)
}
private fun parsePluralRuleLists(): List<PluralRuleList> {

5
components/resources/library/build.gradle.kts

@ -1,5 +1,4 @@
import org.jetbrains.compose.ExperimentalComposeLibrary
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
plugins {
@ -202,8 +201,8 @@ compose.experimental {
tasks.register<GeneratePluralRuleListsTask>("generatePluralRuleLists") {
val projectDir = project.layout.projectDirectory
pluralsFile = projectDir.file("CLDRPluralRules/plurals.xml")
mainDir = projectDir.file("src/commonMain/kotlin/org/jetbrains/compose/resources/plural/CLDRPluralRuleLists.kt")
testDir = projectDir.file("src/commonTest/kotlin/org/jetbrains/compose/resources/CLDRPluralRuleLists.test.kt")
outputFile = projectDir.file("src/commonMain/kotlin/org/jetbrains/compose/resources/plural/CLDRPluralRuleLists.kt")
samplesOutputFile = projectDir.file("src/commonTest/kotlin/org/jetbrains/compose/resources/CLDRPluralRuleLists.test.kt")
}
afterEvaluate {

Loading…
Cancel
Save