Add target crossDist dependency for crosstarget testing.
Fix dependencies for framework tests
This commit is contained in:
committed by
Pavel Punegov
parent
c10a437ef7
commit
633db41d70
@@ -2683,7 +2683,6 @@ if (isMac() && project.testTarget != 'wasm32') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
swiftSources = ['framework/values/values.swift']
|
swiftSources = ['framework/values/values.swift']
|
||||||
dependsOn "compileKonan${frameworkName}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task testStdlibFramework(type: FrameworkTest) {
|
task testStdlibFramework(type: FrameworkTest) {
|
||||||
@@ -2699,7 +2698,6 @@ if (isMac() && project.testTarget != 'wasm32') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
swiftSources = ['framework/stdlib/stdlib.swift']
|
swiftSources = ['framework/stdlib/stdlib.swift']
|
||||||
dependsOn "compileKonan${frameworkName}"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ abstract class KonanTest extends JavaExec {
|
|||||||
if (project.testTarget) {
|
if (project.testTarget) {
|
||||||
// if a test_target property is set then tests should depend on a crossDist
|
// if a test_target property is set then tests should depend on a crossDist
|
||||||
// otherwise runtime components would not be build for a target
|
// otherwise runtime components would not be build for a target
|
||||||
dependsOn(project.rootProject.tasks['crossDist'])
|
dependsOn(project.rootProject.tasks["${target}CrossDist"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -327,6 +327,10 @@ class BuildKonanTest extends ExtKonanTest {
|
|||||||
public List<String> compileList
|
public List<String> compileList
|
||||||
public List<String> excludeList
|
public List<String> excludeList
|
||||||
|
|
||||||
|
BuildKonanTest() {
|
||||||
|
super()
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
List<String> buildCompileList() {
|
List<String> buildCompileList() {
|
||||||
assert compileList != null
|
assert compileList != null
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
package org.jetbrains.kotlin
|
package org.jetbrains.kotlin
|
||||||
|
|
||||||
|
import groovy.lang.Closure
|
||||||
|
import org.gradle.api.Action
|
||||||
import org.gradle.api.DefaultTask
|
import org.gradle.api.DefaultTask
|
||||||
|
import org.gradle.api.Project
|
||||||
|
import org.gradle.api.Task
|
||||||
import org.gradle.api.tasks.Input
|
import org.gradle.api.tasks.Input
|
||||||
import org.gradle.api.tasks.SourceSet
|
import org.gradle.api.tasks.SourceSet
|
||||||
import org.gradle.api.tasks.SourceSetContainer
|
import org.gradle.api.tasks.SourceSetContainer
|
||||||
@@ -33,6 +37,21 @@ open class FrameworkTest : DefaultTask() {
|
|||||||
?: throw RuntimeException("Empty sourceSet")
|
?: throw RuntimeException("Empty sourceSet")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun configure(config: Closure<*>): Task {
|
||||||
|
super.configure(config)
|
||||||
|
val target = project.testTarget().name
|
||||||
|
|
||||||
|
// set crossdist build dependency if custom konan.home wasn't set
|
||||||
|
if (!(project.property("useCustomDist") as Boolean)) {
|
||||||
|
setRootDependency("${target}CrossDist", "${target}CrossDistRuntime", "commonDistRuntime", "distCompiler")
|
||||||
|
}
|
||||||
|
check(::frameworkName.isInitialized, { "Framework name should be set" })
|
||||||
|
dependsOn(project.tasks.getByName("compileKonan$frameworkName"))
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setRootDependency(vararg s: String) = s.forEach { dependsOn(project.rootProject.tasks.getByName(it)) }
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
fun run() {
|
fun run() {
|
||||||
val frameworkPath = "$testOutput/$frameworkName/${project.testTarget().name}"
|
val frameworkPath = "$testOutput/$frameworkName/${project.testTarget().name}"
|
||||||
|
|||||||
Reference in New Issue
Block a user