Fix MPP Gradle tests
* Use `maven { setUrl(...) }` in Groovy DSL
* Configure compilation tasks beforehand
in testMppBuildWithCompilerPlugins
* Prevent `gradleSettingsScript()` from failing
when no settings script is found
This commit is contained in:
+5
-3
@@ -621,9 +621,11 @@ Finished executing task ':$taskName'|
|
|||||||
}.single()
|
}.single()
|
||||||
|
|
||||||
fun Project.gradleSettingsScript(): File =
|
fun Project.gradleSettingsScript(): File =
|
||||||
listOf("settings.gradle", "settings.gradle.kts").mapNotNull {
|
listOf("settings.gradle", "settings.gradle.kts").map {
|
||||||
File(projectDir, it).takeIf(File::exists)
|
File(projectDir, it)
|
||||||
}.single()
|
}.run {
|
||||||
|
singleOrNull { it.exists() } ?: first()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param assertionFileName path to xml with expected test results, relative to test resources root
|
* @param assertionFileName path to xml with expected test results, relative to test resources root
|
||||||
|
|||||||
+3
@@ -1836,6 +1836,9 @@ class NewMultiplatformIT : BaseGradleIT() {
|
|||||||
noArg { annotation 'com.example.Annotation' }
|
noArg { annotation 'com.example.Annotation' }
|
||||||
|
|
||||||
task $printOptionsTaskName {
|
task $printOptionsTaskName {
|
||||||
|
// if the tasks are not configured during evaluation phase, configuring them during execution
|
||||||
|
// leads to new dependencies unsuccessfully added to the resolved compilerPluginsClasspath configuration
|
||||||
|
kotlin.targets.all { compilations.all { /*force to configure the*/ compileKotlinTask } }
|
||||||
doFirst {
|
doFirst {
|
||||||
kotlin.sourceSets.each { sourceSet ->
|
kotlin.sourceSets.each { sourceSet ->
|
||||||
def args = sourceSet.languageSettings.compilerPluginArguments
|
def args = sourceSet.languageSettings.compilerPluginArguments
|
||||||
|
|||||||
Reference in New Issue
Block a user