diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/ResourcesGenerator.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/ResourcesGenerator.kt index 4fa93afdd3..801c8af054 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/ResourcesGenerator.kt +++ b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/ResourcesGenerator.kt @@ -171,7 +171,7 @@ internal abstract class CopyAndroidFontsToAssetsTask : DefaultTask() { fileSystem.copy { it.includeEmptyDirs = false it.from(from) - it.exclude("**/font*/*") + it.include("**/font*/*") it.into(outputDirectory) } } diff --git a/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/ResourcesTest.kt b/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/ResourcesTest.kt index 619cf7fba0..a215a18e8d 100644 --- a/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/ResourcesTest.kt +++ b/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/ResourcesTest.kt @@ -5,6 +5,8 @@ import org.jetbrains.compose.test.utils.assertEqualTextFiles import org.jetbrains.compose.test.utils.assertNotEqualTextFiles import org.jetbrains.compose.test.utils.checks import org.junit.jupiter.api.Test +import java.util.zip.ZipEntry +import java.util.zip.ZipFile import kotlin.io.path.Path class ResourcesTest : GradlePluginTestBase() { @@ -115,6 +117,18 @@ class ResourcesTest : GradlePluginTestBase() { gradle("build").checks { check.taskSuccessful(":copyDebugFontsToAndroidAssets") check.taskSuccessful(":copyReleaseFontsToAndroidAssets") + + val debugApk = file("build/outputs/apk/debug/resources_test-debug.apk") + assert(debugApk.exists()) + val debugZip = ZipFile(debugApk) + assert(debugZip.getEntry("font/emptyFont.otf") != null) + assert(debugZip.getEntry("assets/font/emptyFont.otf") != null) + + val releaseApk = file("build/outputs/apk/release/resources_test-release-unsigned.apk") + assert(releaseApk.exists()) + val releaseZip = ZipFile(releaseApk) + assert(releaseZip.getEntry("font/emptyFont.otf") != null) + assert(releaseZip.getEntry("assets/font/emptyFont.otf") != null) } }