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:
Sergey Igushkin
2020-01-29 18:00:59 +03:00
parent 77f60d6d6c
commit cd32cef2b6
2 changed files with 8 additions and 3 deletions
@@ -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
@@ -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