From bea381629224647381df162b0a6bfa40092caa95 Mon Sep 17 00:00:00 2001 From: Vyacheslav Gerasimov Date: Fri, 3 Apr 2020 19:20:24 +0300 Subject: [PATCH] Add JPS Generate All Tests with correct line separators as file There is no way to pass \n programmatically with idea ext plugin --- gradle/jps.gradle.kts | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/gradle/jps.gradle.kts b/gradle/jps.gradle.kts index 07e2080fa2e..376c7249df0 100644 --- a/gradle/jps.gradle.kts +++ b/gradle/jps.gradle.kts @@ -41,6 +41,24 @@ fun JUnit.configureForKotlin(xmx: String = "1600m") { workingDirectory = rootDir.toString() } +// Needed because of idea.ext plugin can't pass \n symbol +fun setupGenerateAllTestsRunConfiguration() { + rootDir.resolve(".idea/runConfigurations/JPS__Generate_All_Tests.xml").writeText( + """ + | + | + | + | + """.trimMargin()) +} + // Needed because of idea.ext plugin doesn't allow to set TEST_SEARCH_SCOPE = moduleWithDependencies fun setupFirRunConfiguration() { @@ -107,6 +125,7 @@ if (kotlinBuildProperties.isInJpsBuildIdeaSync) { rootProject.afterEvaluate { setupFirRunConfiguration() + setupGenerateAllTestsRunConfiguration() rootProject.allprojects { idea { @@ -196,12 +215,6 @@ if (kotlinBuildProperties.isInJpsBuildIdeaSync) { idea("[JPS] IDEA Ultimate", ideaUltimateSandboxDir, ideaPluginDir) } - application("[JPS] Generate All Tests") { - moduleName = "kotlin.pill.generate-all-tests.test" - workingDirectory = rootDir.toString() - mainClass = "org.jetbrains.kotlin.pill.generateAllTests.Main" - } - defaults { configureForKotlin() }