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