[MPP, KPM]: Add test runner for KPM Model Mapping
Add new testKpmModelMapping task that will inject `kotlin.kpm.experimentalModelMapping=true` property for all testSuites that implements `BaseGradleIT`.
This commit is contained in:
@@ -124,6 +124,17 @@ projectTest(
|
||||
if (isTeamcityBuild) finalizedBy(cleanTestKitCacheTask)
|
||||
}
|
||||
|
||||
projectTest(
|
||||
"testKpmModelMapping",
|
||||
shortenTempRootName = shortenTempRootName,
|
||||
jUnitMode = JUnitMode.JUnit5
|
||||
) {
|
||||
systemProperty("kotlin.gradle.kpm.enableModelMapping", "true")
|
||||
includeMppAndAndroid(false)
|
||||
includeNative(false)
|
||||
if (isTeamcityBuild) finalizedBy(cleanTestKitCacheTask)
|
||||
}
|
||||
|
||||
if (isTeamcityBuild) {
|
||||
projectTest(
|
||||
"testNative",
|
||||
|
||||
+17
-1
@@ -39,13 +39,24 @@ abstract class BaseGradleIT {
|
||||
|
||||
protected var workingDir = File(".")
|
||||
|
||||
internal open fun defaultBuildOptions(): BuildOptions = BuildOptions(withDaemon = true)
|
||||
internal open fun defaultBuildOptions(): BuildOptions = BuildOptions(
|
||||
withDaemon = true,
|
||||
enableKpmModelMapping = isKpmModelMappingEnabled
|
||||
)
|
||||
|
||||
open val defaultGradleVersion: GradleVersionRequired
|
||||
get() = GradleVersionRequired.None
|
||||
|
||||
val isTeamCityRun = System.getenv("TEAMCITY_VERSION") != null
|
||||
|
||||
/**
|
||||
* `var` makes it configurable per test
|
||||
* `open` makes it configurable per test suite
|
||||
*/
|
||||
protected open var isKpmModelMappingEnabled = System
|
||||
.getProperty("kotlin.gradle.kpm.enableModelMapping")
|
||||
.toBoolean()
|
||||
|
||||
@Before
|
||||
open fun setUp() {
|
||||
// Aapt2 from Android Gradle Plugin 3.2 and below does not handle long paths on Windows.
|
||||
@@ -264,6 +275,7 @@ abstract class BaseGradleIT {
|
||||
val hierarchicalMPPStructureSupport: Boolean? = null,
|
||||
val enableCompatibilityMetadataVariant: Boolean? = null,
|
||||
val withReports: List<BuildReportType> = emptyList(),
|
||||
val enableKpmModelMapping: Boolean? = null,
|
||||
)
|
||||
|
||||
enum class ConfigurationCacheProblems {
|
||||
@@ -932,6 +944,10 @@ Finished executing task ':$taskName'|
|
||||
add("-Pkotlin.build.report.output=${options.withReports.joinToString { it.name }}")
|
||||
}
|
||||
|
||||
if (options.enableKpmModelMapping != null) {
|
||||
add("-Pkotlin.kpm.experimentalModelMapping=${options.enableKpmModelMapping}")
|
||||
}
|
||||
|
||||
add("-Dorg.gradle.unsafe.configuration-cache=${options.configurationCache}")
|
||||
add("-Dorg.gradle.unsafe.configuration-cache-problems=${options.configurationCacheProblems.name.toLowerCase()}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user