[Gradle, K/N] Add separate tasks for native-specific Gradle tests
Native-specific tests are removed from default test tasks.
This commit is contained in:
committed by
Alexander.Likhachev
parent
d971817c32
commit
174e390d2c
@@ -66,6 +66,16 @@ fun Test.includeMppAndAndroid(include: Boolean) {
|
||||
}
|
||||
}
|
||||
|
||||
fun Test.includeNative(include: Boolean) {
|
||||
if (isTeamcityBuild) {
|
||||
val filter = if (include)
|
||||
filter.includePatterns
|
||||
else
|
||||
filter.excludePatterns
|
||||
filter.add("org.jetbrains.kotlin.gradle.native.*")
|
||||
}
|
||||
}
|
||||
|
||||
fun Test.advanceGradleVersion() {
|
||||
val gradleVersionForTests = "6.3"
|
||||
systemProperty("kotlin.gradle.version.for.tests", gradleVersionForTests)
|
||||
@@ -74,15 +84,25 @@ fun Test.advanceGradleVersion() {
|
||||
// additional configuration in tasks.withType<Test> below
|
||||
projectTest("test", shortenTempRootName = shortenTempRootName) {
|
||||
includeMppAndAndroid(false)
|
||||
includeNative(false)
|
||||
}
|
||||
|
||||
projectTest("testAdvanceGradleVersion", shortenTempRootName = shortenTempRootName) {
|
||||
advanceGradleVersion()
|
||||
includeMppAndAndroid(false)
|
||||
includeNative(false)
|
||||
}
|
||||
|
||||
|
||||
if (isTeamcityBuild) {
|
||||
projectTest("testNative", shortenTempRootName = shortenTempRootName) {
|
||||
includeNative(true)
|
||||
}
|
||||
|
||||
projectTest("testAdvanceGradleVersionNative", shortenTempRootName = shortenTempRootName) {
|
||||
advanceGradleVersion()
|
||||
includeNative(true)
|
||||
}
|
||||
|
||||
projectTest("testMppAndAndroid", shortenTempRootName = shortenTempRootName) {
|
||||
includeMppAndAndroid(true)
|
||||
}
|
||||
@@ -98,6 +118,8 @@ tasks.named<Task>("check") {
|
||||
if (isTeamcityBuild) {
|
||||
dependsOn("testAdvanceGradleVersionMppAndAndroid")
|
||||
dependsOn("testMppAndAndroid")
|
||||
dependsOn("testNative")
|
||||
dependsOn("testAdvanceGradleVersionNative")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
package org.jetbrains.kotlin.gradle
|
||||
|
||||
import org.jetbrains.kotlin.gradle.native.configure
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinJsCompilerType
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinJsCompilerType.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.ProjectLocalConfigurations
|
||||
|
||||
+6
-3
@@ -1,10 +1,12 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle
|
||||
package org.jetbrains.kotlin.gradle.native
|
||||
|
||||
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
||||
import org.jetbrains.kotlin.gradle.GradleVersionRequired
|
||||
import org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin
|
||||
import org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin.Companion.DUMMY_FRAMEWORK_TASK_NAME
|
||||
import org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin.Companion.POD_BUILD_TASK_NAME
|
||||
@@ -14,6 +16,7 @@ import org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin.Compan
|
||||
import org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin.Companion.POD_INSTALL_TASK_NAME
|
||||
import org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin.Companion.POD_SETUP_BUILD_TASK_NAME
|
||||
import org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin.Companion.POD_SPEC_TASK_NAME
|
||||
import org.jetbrains.kotlin.gradle.transformProjectWithPluginsDsl
|
||||
import org.jetbrains.kotlin.gradle.util.modify
|
||||
import org.jetbrains.kotlin.konan.target.HostManager
|
||||
import org.junit.Assume.assumeTrue
|
||||
@@ -1035,7 +1038,7 @@ class CocoaPodsIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun BaseGradleIT.Project.useCustomFrameworkName(subproject: String, frameworkName: String, iosAppLocation: String? = null) {
|
||||
private fun Project.useCustomFrameworkName(subproject: String, frameworkName: String, iosAppLocation: String? = null) {
|
||||
// Change the name at the Gradle side.
|
||||
gradleBuildScript(subproject).appendText(
|
||||
"""
|
||||
+5
-2
@@ -1,10 +1,13 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle
|
||||
package org.jetbrains.kotlin.gradle.native
|
||||
|
||||
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
||||
import org.jetbrains.kotlin.gradle.GradleVersionRequired
|
||||
import org.jetbrains.kotlin.gradle.transformProjectWithPluginsDsl
|
||||
import org.jetbrains.kotlin.konan.target.HostManager
|
||||
import org.junit.Assume
|
||||
import org.junit.Test
|
||||
+5
-2
@@ -1,10 +1,13 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle
|
||||
package org.jetbrains.kotlin.gradle.native
|
||||
|
||||
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
||||
import org.jetbrains.kotlin.gradle.GradleVersionRequired
|
||||
import org.jetbrains.kotlin.gradle.transformProjectWithPluginsDsl
|
||||
import org.jetbrains.kotlin.gradle.util.checkedReplace
|
||||
import org.jetbrains.kotlin.gradle.util.modify
|
||||
import org.jetbrains.kotlin.gradle.util.runProcess
|
||||
+4
-1
@@ -3,14 +3,17 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle
|
||||
package org.jetbrains.kotlin.gradle.native
|
||||
|
||||
import org.jdom.input.SAXBuilder
|
||||
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
||||
import org.jetbrains.kotlin.gradle.GradleVersionRequired
|
||||
import org.jetbrains.kotlin.gradle.internals.DISABLED_NATIVE_TARGETS_REPORTER_DISABLE_WARNING_PROPERTY_NAME
|
||||
import org.jetbrains.kotlin.gradle.internals.DISABLED_NATIVE_TARGETS_REPORTER_WARNING_PREFIX
|
||||
import org.jetbrains.kotlin.gradle.internals.NO_NATIVE_STDLIB_PROPERTY_WARNING
|
||||
import org.jetbrains.kotlin.gradle.internals.NO_NATIVE_STDLIB_WARNING
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeOutputKind
|
||||
import org.jetbrains.kotlin.gradle.transformProjectWithPluginsDsl
|
||||
import org.jetbrains.kotlin.gradle.util.checkedReplace
|
||||
import org.jetbrains.kotlin.gradle.util.isWindows
|
||||
import org.jetbrains.kotlin.gradle.util.modify
|
||||
+5
-2
@@ -3,8 +3,11 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle
|
||||
package org.jetbrains.kotlin.gradle.native
|
||||
|
||||
import org.jetbrains.kotlin.gradle.*
|
||||
import org.jetbrains.kotlin.gradle.embedProject
|
||||
import org.jetbrains.kotlin.gradle.transformProjectWithPluginsDsl
|
||||
import org.jetbrains.kotlin.gradle.util.modify
|
||||
import org.jetbrains.kotlin.gradle.utils.NativeCompilerDownloader
|
||||
import org.jetbrains.kotlin.konan.target.HostManager
|
||||
@@ -54,7 +57,7 @@ class NativePlatformLibsIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun BaseGradleIT.Project.buildWithLightDist(vararg tasks: String, check: CompiledProject.() -> Unit) =
|
||||
private fun Project.buildWithLightDist(vararg tasks: String, check: CompiledProject.() -> Unit) =
|
||||
build(*tasks, "-Pkotlin.native.distribution.type=light", check = check)
|
||||
|
||||
@Test
|
||||
Reference in New Issue
Block a user