From 6a10d4c167dcc7972c384d32c3996b8b21b5ba8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Sat, 31 Aug 2024 22:06:12 +0200 Subject: [PATCH] Ensure plugin is compatible with gradle isolated projects --- .../plugin/EasyLauncherPluginTest.kt | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/easylauncher/src/test/kotlin/com/project/starter/easylauncher/plugin/EasyLauncherPluginTest.kt b/easylauncher/src/test/kotlin/com/project/starter/easylauncher/plugin/EasyLauncherPluginTest.kt index e6c54e9a..d6639d71 100644 --- a/easylauncher/src/test/kotlin/com/project/starter/easylauncher/plugin/EasyLauncherPluginTest.kt +++ b/easylauncher/src/test/kotlin/com/project/starter/easylauncher/plugin/EasyLauncherPluginTest.kt @@ -241,6 +241,42 @@ internal class EasyLauncherPluginTest : WithGradleProjectTest() { assertThat(secondRun.output).contains("Configuration cache entry reused") } + @Test + fun `plugin is compatible with isolated projects`() { + moduleRoot.resolve("build.gradle").buildScript( + androidBlock = { "" }, + easylauncherBlock = { + """ + productFlavors { + debug { + filters( + grayRibbonFilter(), + greenRibbonFilter(), + orangeRibbonFilter(), + yellowRibbonFilter(), + redRibbonFilter(), + blueRibbonFilter(), + customRibbon(label: "second", ribbonColor: "#6600CC", labelColor: "#FFFFFF", position: "bottom"), + chromeLike(), + chromeLike( + label: "JP2", + ribbonColor: "#723D46", + labelColor: "#EEFFFEE", + labelPadding: 25, + overlayHeight: 0.6, + textSizeRatio: 0.15 + ), + ) + } + } + """.trimIndent() + }, + ) + + val result = runTask("assembleDebug", "-Dorg.gradle.unsafe.isolated-projects=true", skipJacoco = true) + assertThat(result.task(":app:easylauncherDebug")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + } + @Test fun `generates proper tasks`() { moduleRoot.resolve("build.gradle").buildScript(