|
|
|
@ -13,24 +13,24 @@ class ResourcesTest : GradlePluginTestBase() {
|
|
|
|
|
//check generated resource's accessors |
|
|
|
|
gradle("generateComposeResClass").checks { |
|
|
|
|
assertEqualTextFiles( |
|
|
|
|
file("build/generated/compose/resourceGenerator/kotlin/app/group/generated/resources/Res.kt"), |
|
|
|
|
file("build/generated/compose/resourceGenerator/kotlin/app/group/resources_test/generated/resources/Res.kt"), |
|
|
|
|
file("expected/Res.kt") |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//check resource's accessors were regenerated |
|
|
|
|
file("src/commonMain/resources/composeResources/drawable/vector_2.xml").renameTo( |
|
|
|
|
file("src/commonMain/resources/composeResources/drawable/vector_3.xml") |
|
|
|
|
file("src/commonMain/composeResources/drawable/vector_2.xml").renameTo( |
|
|
|
|
file("src/commonMain/composeResources/drawable/vector_3.xml") |
|
|
|
|
) |
|
|
|
|
gradle("generateComposeResClass").checks { |
|
|
|
|
assertNotEqualTextFiles( |
|
|
|
|
file("build/generated/compose/resourceGenerator/kotlin/app/group/generated/resources/Res.kt"), |
|
|
|
|
file("build/generated/compose/resourceGenerator/kotlin/app/group/resources_test/generated/resources/Res.kt"), |
|
|
|
|
file("expected/Res.kt") |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
file("src/commonMain/resources/composeResources/drawable-en").renameTo( |
|
|
|
|
file("src/commonMain/resources/composeResources/drawable-ren") |
|
|
|
|
file("src/commonMain/composeResources/drawable-en").renameTo( |
|
|
|
|
file("src/commonMain/composeResources/drawable-ren") |
|
|
|
|
) |
|
|
|
|
gradle("generateComposeResClass").checks { |
|
|
|
|
check.logContains(""" |
|
|
|
@ -38,8 +38,8 @@ class ResourcesTest : GradlePluginTestBase() {
|
|
|
|
|
""".trimIndent()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
file("src/commonMain/resources/composeResources/drawable-ren").renameTo( |
|
|
|
|
file("src/commonMain/resources/composeResources/drawable-rUS-en") |
|
|
|
|
file("src/commonMain/composeResources/drawable-ren").renameTo( |
|
|
|
|
file("src/commonMain/composeResources/drawable-rUS-en") |
|
|
|
|
) |
|
|
|
|
gradle("generateComposeResClass").checks { |
|
|
|
|
check.logContains(""" |
|
|
|
@ -47,8 +47,8 @@ class ResourcesTest : GradlePluginTestBase() {
|
|
|
|
|
""".trimIndent()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
file("src/commonMain/resources/composeResources/drawable-rUS-en").renameTo( |
|
|
|
|
file("src/commonMain/resources/composeResources/drawable-rUS") |
|
|
|
|
file("src/commonMain/composeResources/drawable-rUS-en").renameTo( |
|
|
|
|
file("src/commonMain/composeResources/drawable-rUS") |
|
|
|
|
) |
|
|
|
|
gradle("generateComposeResClass").checks { |
|
|
|
|
check.logContains(""" |
|
|
|
@ -56,8 +56,8 @@ class ResourcesTest : GradlePluginTestBase() {
|
|
|
|
|
""".trimIndent()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
file("src/commonMain/resources/composeResources/drawable-rUS").renameTo( |
|
|
|
|
file("src/commonMain/resources/composeResources/drawable-en-fr") |
|
|
|
|
file("src/commonMain/composeResources/drawable-rUS").renameTo( |
|
|
|
|
file("src/commonMain/composeResources/drawable-en-fr") |
|
|
|
|
) |
|
|
|
|
gradle("generateComposeResClass").checks { |
|
|
|
|
check.logContains(""" |
|
|
|
@ -65,8 +65,8 @@ class ResourcesTest : GradlePluginTestBase() {
|
|
|
|
|
""".trimIndent()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
file("src/commonMain/resources/composeResources/drawable-en-fr").renameTo( |
|
|
|
|
file("src/commonMain/resources/composeResources/image") |
|
|
|
|
file("src/commonMain/composeResources/drawable-en-fr").renameTo( |
|
|
|
|
file("src/commonMain/composeResources/image") |
|
|
|
|
) |
|
|
|
|
gradle("generateComposeResClass").checks { |
|
|
|
|
check.logContains(""" |
|
|
|
@ -74,8 +74,8 @@ class ResourcesTest : GradlePluginTestBase() {
|
|
|
|
|
""".trimIndent()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
file("src/commonMain/resources/composeResources/image").renameTo( |
|
|
|
|
file("src/commonMain/resources/composeResources/files-de") |
|
|
|
|
file("src/commonMain/composeResources/image").renameTo( |
|
|
|
|
file("src/commonMain/composeResources/files-de") |
|
|
|
|
) |
|
|
|
|
gradle("generateComposeResClass").checks { |
|
|
|
|
check.logContains(""" |
|
|
|
@ -83,8 +83,8 @@ class ResourcesTest : GradlePluginTestBase() {
|
|
|
|
|
""".trimIndent()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
file("src/commonMain/resources/composeResources/files-de").renameTo( |
|
|
|
|
file("src/commonMain/resources/composeResources/strings") |
|
|
|
|
file("src/commonMain/composeResources/files-de").renameTo( |
|
|
|
|
file("src/commonMain/composeResources/strings") |
|
|
|
|
) |
|
|
|
|
gradle("generateComposeResClass").checks { |
|
|
|
|
check.logContains(""" |
|
|
|
@ -92,8 +92,8 @@ class ResourcesTest : GradlePluginTestBase() {
|
|
|
|
|
""".trimIndent()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
file("src/commonMain/resources/composeResources/strings").renameTo( |
|
|
|
|
file("src/commonMain/resources/composeResources/string-us") |
|
|
|
|
file("src/commonMain/composeResources/strings").renameTo( |
|
|
|
|
file("src/commonMain/composeResources/string-us") |
|
|
|
|
) |
|
|
|
|
gradle("generateComposeResClass").checks { |
|
|
|
|
check.logContains(""" |
|
|
|
@ -102,11 +102,11 @@ class ResourcesTest : GradlePluginTestBase() {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//restore defaults |
|
|
|
|
file("src/commonMain/resources/composeResources/string-us").renameTo( |
|
|
|
|
file("src/commonMain/resources/composeResources/drawable-en") |
|
|
|
|
file("src/commonMain/composeResources/string-us").renameTo( |
|
|
|
|
file("src/commonMain/composeResources/drawable-en") |
|
|
|
|
) |
|
|
|
|
file("src/commonMain/resources/composeResources/drawable/vector_3.xml").renameTo( |
|
|
|
|
file("src/commonMain/resources/composeResources/drawable/vector_2.xml") |
|
|
|
|
file("src/commonMain/composeResources/drawable/vector_3.xml").renameTo( |
|
|
|
|
file("src/commonMain/composeResources/drawable/vector_2.xml") |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
//TODO: check a real build after a release a new version of the resources library |
|
|
|
|