migrated NativeIrLinkerIssuesIT to junit 5 and gradle TestKit
#KT-51553 In Progress Merge-request: KT-MR-9921 Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
cbcd68cd85
commit
af4ef048be
+101
-85
@@ -1,48 +1,51 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2023 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.native
|
||||
|
||||
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
||||
import org.jetbrains.kotlin.gradle.GradleVersionRequired
|
||||
import org.jetbrains.kotlin.gradle.native.GeneralNativeIT.Companion.getOutputForTask
|
||||
import org.jetbrains.kotlin.gradle.testbase.DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX
|
||||
import org.jetbrains.kotlin.gradle.testbase.findParameterInOutput
|
||||
import org.gradle.api.logging.LogLevel
|
||||
import org.gradle.util.GradleVersion
|
||||
import org.jetbrains.kotlin.gradle.dsl.NativeCacheKind
|
||||
import org.jetbrains.kotlin.gradle.testbase.*
|
||||
import org.jetbrains.kotlin.konan.library.KONAN_PLATFORM_LIBS_NAME_PREFIX
|
||||
import org.jetbrains.kotlin.konan.target.HostManager
|
||||
import org.jetbrains.kotlin.konan.target.KonanTarget
|
||||
import org.junit.Assume.assumeFalse
|
||||
import org.junit.Assume.assumeTrue
|
||||
import org.junit.Ignore
|
||||
import org.junit.Test
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
import org.junit.jupiter.api.Disabled
|
||||
import org.junit.jupiter.api.DisplayName
|
||||
import org.junit.jupiter.api.condition.DisabledOnOs
|
||||
import org.junit.jupiter.api.condition.OS
|
||||
import org.junit.jupiter.api.io.TempDir
|
||||
import java.nio.file.Path
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertNotNull
|
||||
|
||||
class NativeIrLinkerIssuesIT : BaseGradleIT() {
|
||||
override val defaultGradleVersion: GradleVersionRequired
|
||||
get() = GradleVersionRequired.FOR_MPP_SUPPORT
|
||||
@DisplayName("Tests for K/N builds with ir linker issues")
|
||||
@NativeGradlePluginTests
|
||||
internal class NativeIrLinkerIssuesIT : KGPBaseTest() {
|
||||
|
||||
@Test
|
||||
@Ignore(
|
||||
@DisplayName("KT-46697: ktor 1_5_4 and coroutines 1_5_0-RC-native-mt")
|
||||
@GradleTest
|
||||
@Disabled(
|
||||
"This sample fails in a way that was not expected because kotlin/Experimental annotation that is still used in ktor 1.5.4" +
|
||||
" was removed in stdlib in 1.8. We need to find another appropriate sample to replace this one."
|
||||
)
|
||||
fun `ktor 1_5_4 and coroutines 1_5_0-RC-native-mt (KT-46697)`() {
|
||||
// Run this test only on macOS x64,
|
||||
// arm64 requires newer ktor (>=1.6.5) and coroutines (>=1.5.2-native-mt)
|
||||
// that compatible to each other and don't fail this way.
|
||||
// TODO: consider finding a newer versions that support arm64 and reproduce this issue
|
||||
assumeTrue(HostManager.host == KonanTarget.MACOS_X64)
|
||||
// TODO: consider finding a newer versions that support arm64 and reproduce this issue
|
||||
@DisabledOnOs(
|
||||
OS.MAC,
|
||||
architectures = ["aarch64"],
|
||||
disabledReason =
|
||||
"Run this test only on macOS x64," +
|
||||
" arm64 requires newer ktor (>=1.6.5) and coroutines (>=1.5.2-native-mt) " +
|
||||
"that compatible to each other and don't fail this way."
|
||||
)
|
||||
fun shouldBuildKtorAndCoroutines(gradleVersion: GradleVersion) {
|
||||
|
||||
buildApplicationAndFail(
|
||||
directoryPrefix = null,
|
||||
projectName = "native-ir-linker-issues-ktor-and-coroutines",
|
||||
localRepo = null,
|
||||
useCache = true
|
||||
nativeCacheKind = NativeCacheKind.STATIC,
|
||||
gradleVersion = gradleVersion
|
||||
) { kotlinNativeCompilerVersion ->
|
||||
"""
|
||||
|e: The symbol of unexpected type encountered during IR deserialization: IrTypeAliasPublicSymbolImpl, kotlinx.coroutines/CancellationException|null[0]. IrClassifierSymbol is expected.
|
||||
@@ -117,14 +120,19 @@ class NativeIrLinkerIssuesIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `declaration that is gone (KT-41378) - with cache`() {
|
||||
// Don't run it on Windows. Caches are not supported there yet.
|
||||
assumeFalse(HostManager.hostIsMingw)
|
||||
@DisplayName("KT-41378: declaration that is gone - with cache")
|
||||
@GradleTest
|
||||
@DisabledOnOs(OS.WINDOWS, disabledReason = "Don't run it on Windows. Caches are not supported there yet.")
|
||||
fun shouldBuildIrLinkerWithCache(
|
||||
gradleVersion: GradleVersion,
|
||||
@TempDir tempDir: Path,
|
||||
) {
|
||||
|
||||
buildConflictingLibrariesAndApplication(
|
||||
directoryPrefix = "native-ir-linker-issues-gone-declaration",
|
||||
useCache = true
|
||||
nativeCacheKind = NativeCacheKind.STATIC,
|
||||
gradleVersion = gradleVersion,
|
||||
localRepo = tempDir
|
||||
) { kotlinNativeCompilerVersion ->
|
||||
"""
|
||||
|e: Module "org.sample:libb (org.sample:libb-native)" has a reference to symbol sample.liba/C|null[0]. Neither the module itself nor its dependencies contain such declaration.
|
||||
@@ -147,11 +155,17 @@ class NativeIrLinkerIssuesIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `declaration that is gone (KT-41378) - without cache`() {
|
||||
@DisplayName("KT-41378: declaration that is gone - without cache")
|
||||
@GradleTest
|
||||
fun shouldBuildIrLinkerWithoutCache(
|
||||
gradleVersion: GradleVersion,
|
||||
@TempDir tempDir: Path,
|
||||
) {
|
||||
buildConflictingLibrariesAndApplication(
|
||||
directoryPrefix = "native-ir-linker-issues-gone-declaration",
|
||||
useCache = false
|
||||
nativeCacheKind = NativeCacheKind.NONE,
|
||||
gradleVersion = gradleVersion,
|
||||
localRepo = tempDir
|
||||
) { kotlinNativeCompilerVersion ->
|
||||
"""
|
||||
|e: Module "org.sample:libb (org.sample:libb-native)" has a reference to symbol sample.liba/C|null[0]. Neither the module itself nor its dependencies contain such declaration.
|
||||
@@ -176,14 +190,17 @@ class NativeIrLinkerIssuesIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `symbol type mismatch (KT-47285) - with cache`() {
|
||||
// Don't run it on Windows. Caches are not supported there yet.
|
||||
assumeFalse(HostManager.hostIsMingw)
|
||||
|
||||
@DisplayName("KT-47285: symbol type mismatch - with cache")
|
||||
@GradleTest
|
||||
fun shouldBuildIrLinkerSymbolTypeMismatchWithCache(
|
||||
gradleVersion: GradleVersion,
|
||||
@TempDir tempDir: Path,
|
||||
) {
|
||||
buildConflictingLibrariesAndApplication(
|
||||
directoryPrefix = "native-ir-linker-issues-symbol-mismatch",
|
||||
useCache = true
|
||||
nativeCacheKind = NativeCacheKind.STATIC,
|
||||
gradleVersion = gradleVersion,
|
||||
localRepo = tempDir
|
||||
) { kotlinNativeCompilerVersion ->
|
||||
"""
|
||||
|e: The symbol of unexpected type encountered during IR deserialization: IrTypeAliasPublicSymbolImpl, sample.liba/B|null[0]. IrClassifierSymbol is expected.
|
||||
@@ -207,11 +224,17 @@ class NativeIrLinkerIssuesIT : BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `symbol type mismatch (KT-47285) - without cache`() {
|
||||
@DisplayName("KT-47285: symbol type mismatch - without cache")
|
||||
@GradleTest
|
||||
fun shouldBuildIrLinkerSymbolTypeMismatchWithoutCache(
|
||||
gradleVersion: GradleVersion,
|
||||
@TempDir tempDir: Path,
|
||||
) {
|
||||
buildConflictingLibrariesAndApplication(
|
||||
directoryPrefix = "native-ir-linker-issues-symbol-mismatch",
|
||||
useCache = false
|
||||
nativeCacheKind = NativeCacheKind.NONE,
|
||||
gradleVersion = gradleVersion,
|
||||
localRepo = tempDir
|
||||
) { kotlinNativeCompilerVersion ->
|
||||
"""
|
||||
|e: The symbol of unexpected type encountered during IR deserialization: IrTypeAliasPublicSymbolImpl, sample.liba/B|null[0]. IrClassifierSymbol is expected.
|
||||
@@ -239,20 +262,21 @@ class NativeIrLinkerIssuesIT : BaseGradleIT() {
|
||||
|
||||
private fun buildConflictingLibrariesAndApplication(
|
||||
directoryPrefix: String,
|
||||
useCache: Boolean,
|
||||
expectedErrorMessage: (compilerVersion: String) -> String
|
||||
nativeCacheKind: NativeCacheKind,
|
||||
gradleVersion: GradleVersion,
|
||||
localRepo: Path,
|
||||
expectedErrorMessage: (compilerVersion: String) -> String,
|
||||
) {
|
||||
val repo = setupLocalRepo()
|
||||
|
||||
buildAndPublishLibrary(directoryPrefix = directoryPrefix, projectName = "liba-v1.0", localRepo = repo)
|
||||
buildAndPublishLibrary(directoryPrefix = directoryPrefix, projectName = "liba-v2.0", localRepo = repo)
|
||||
buildAndPublishLibrary(directoryPrefix = directoryPrefix, projectName = "libb", localRepo = repo)
|
||||
buildAndPublishLibrary(directoryPrefix = directoryPrefix, projectName = "liba-v1.0", localRepo = localRepo, gradleVersion)
|
||||
buildAndPublishLibrary(directoryPrefix = directoryPrefix, projectName = "liba-v2.0", localRepo = localRepo, gradleVersion)
|
||||
buildAndPublishLibrary(directoryPrefix = directoryPrefix, projectName = "libb", localRepo = localRepo, gradleVersion)
|
||||
|
||||
buildApplicationAndFail(
|
||||
directoryPrefix = directoryPrefix,
|
||||
projectName = "app",
|
||||
localRepo = repo,
|
||||
useCache = useCache,
|
||||
localRepo = localRepo,
|
||||
nativeCacheKind = nativeCacheKind,
|
||||
gradleVersion = gradleVersion,
|
||||
expectedErrorMessage = expectedErrorMessage
|
||||
)
|
||||
}
|
||||
@@ -260,22 +284,20 @@ class NativeIrLinkerIssuesIT : BaseGradleIT() {
|
||||
private fun buildApplicationAndFail(
|
||||
directoryPrefix: String?,
|
||||
projectName: String,
|
||||
localRepo: File?,
|
||||
useCache: Boolean,
|
||||
expectedErrorMessage: (compilerVersion: String) -> String
|
||||
localRepo: Path?,
|
||||
nativeCacheKind: NativeCacheKind,
|
||||
gradleVersion: GradleVersion,
|
||||
expectedErrorMessage: (compilerVersion: String) -> String,
|
||||
) {
|
||||
prepareProject(directoryPrefix, projectName, localRepo, useCache) {
|
||||
build("linkDebugExecutableNative") {
|
||||
assertFailed()
|
||||
|
||||
prepareProject(directoryPrefix, projectName, localRepo, nativeCacheKind, gradleVersion) {
|
||||
buildAndFail("linkDebugExecutableNative", buildOptions = this.buildOptions.copy(logLevel = LogLevel.DEBUG)) {
|
||||
|
||||
val kotlinNativeCompilerVersion = findKotlinNativeCompilerVersion(output)
|
||||
assertNotNull(kotlinNativeCompilerVersion)
|
||||
|
||||
val errorMessage = ERROR_LINE_REGEX.findAll(getOutputForTask(":linkDebugExecutableNative"))
|
||||
.map { matchResult -> matchResult.groupValues[1] }
|
||||
.filterNot { it.startsWith("w:") || it.startsWith("v:") || it.startsWith("i:") }
|
||||
.map { line ->
|
||||
.filterNot { it.startsWith("w:") || it.startsWith("v:") || it.startsWith("i:") }.map { line ->
|
||||
line.replace(COMPRESSED_PLATFORM_LIBS_REGEX) { result ->
|
||||
val rangeWithPlatformLibrariesCount = result.groups[1]!!.range
|
||||
buildString {
|
||||
@@ -284,39 +306,35 @@ class NativeIrLinkerIssuesIT : BaseGradleIT() {
|
||||
append(line.substring(rangeWithPlatformLibrariesCount.last + 1))
|
||||
}
|
||||
}
|
||||
}
|
||||
.joinToString("\n")
|
||||
}.joinToString("\n")
|
||||
|
||||
assertEquals(expectedErrorMessage(kotlinNativeCompilerVersion), errorMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun buildAndPublishLibrary(directoryPrefix: String, projectName: String, localRepo: File) {
|
||||
prepareProject(directoryPrefix, projectName, localRepo, useCache = true) {
|
||||
build("publish") {
|
||||
assertSuccessful()
|
||||
}
|
||||
private fun buildAndPublishLibrary(
|
||||
directoryPrefix: String, projectName: String, localRepo: Path, gradleVersion: GradleVersion,
|
||||
) {
|
||||
prepareProject(directoryPrefix, projectName, localRepo, nativeCacheKind = NativeCacheKind.STATIC, gradleVersion) {
|
||||
build("publish")
|
||||
}
|
||||
}
|
||||
|
||||
private fun prepareProject(
|
||||
directoryPrefix: String?,
|
||||
projectName: String,
|
||||
localRepo: File?,
|
||||
useCache: Boolean,
|
||||
block: Project.() -> Unit
|
||||
localRepo: Path?,
|
||||
nativeCacheKind: NativeCacheKind,
|
||||
gradleVersion: GradleVersion,
|
||||
block: TestProject.() -> Unit,
|
||||
) {
|
||||
with(transformNativeTestProjectWithPluginDsl(directoryPrefix = directoryPrefix, projectName = projectName)) {
|
||||
if (localRepo != null) {
|
||||
val localRepoUri = localRepo.absoluteFile.toURI().toString()
|
||||
gradleBuildScript().apply {
|
||||
writeText(readText().replace("<LocalRepo>", localRepoUri))
|
||||
}
|
||||
}
|
||||
|
||||
gradleProperties().appendText("\nkotlin.native.cacheKind=${if (useCache) "static" else "none"}\n")
|
||||
|
||||
nativeProject(
|
||||
directoryPrefix + "/" + projectName,
|
||||
gradleVersion = gradleVersion,
|
||||
buildOptions = defaultBuildOptions.copy(nativeCacheKind = nativeCacheKind),
|
||||
localRepoDir = localRepo
|
||||
) {
|
||||
block()
|
||||
}
|
||||
}
|
||||
@@ -326,11 +344,9 @@ class NativeIrLinkerIssuesIT : BaseGradleIT() {
|
||||
private val COMPRESSED_PLATFORM_LIBS_REGEX =
|
||||
".*${KONAN_PLATFORM_LIBS_NAME_PREFIX.replace(".", "\\.")}\\* \\((\\d+) libraries\\).*".toRegex()
|
||||
|
||||
private fun setupLocalRepo(): File = Files.createTempDirectory("localRepo").toAbsolutePath().toFile()
|
||||
|
||||
fun findKotlinNativeCompilerVersion(output: String): String? = findParameterInOutput(
|
||||
private fun findKotlinNativeCompilerVersion(output: String): String? = findParameterInOutput(
|
||||
"for_test_kotlin_native_compiler_version",
|
||||
output
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
@@ -10,6 +10,7 @@ import org.gradle.api.logging.configuration.WarningMode
|
||||
import org.gradle.util.GradleVersion
|
||||
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties.COMPILE_INCREMENTAL_WITH_ARTIFACT_TRANSFORM
|
||||
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
||||
import org.jetbrains.kotlin.gradle.dsl.NativeCacheKind
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinJsCompilerType
|
||||
import org.jetbrains.kotlin.gradle.report.BuildReportType
|
||||
import org.junit.jupiter.api.condition.OS
|
||||
@@ -43,6 +44,7 @@ data class BuildOptions(
|
||||
val keepIncrementalCompilationCachesInMemory: Boolean? = null,
|
||||
val useDaemonFallbackStrategy: Boolean = false,
|
||||
val verboseDiagnostics: Boolean = true,
|
||||
val nativeCacheKind: NativeCacheKind = NativeCacheKind.NONE
|
||||
) {
|
||||
val safeAndroidVersion: String
|
||||
get() = androidVersion ?: error("AGP version is expected to be set")
|
||||
@@ -170,6 +172,8 @@ data class BuildOptions(
|
||||
arguments.add("-Pkotlin.internal.verboseDiagnostics=$verboseDiagnostics")
|
||||
}
|
||||
|
||||
arguments.add("-Pkotlin.native.cacheKind=${nativeCacheKind.name.lowercase()}")
|
||||
|
||||
arguments.addAll(freeArgs)
|
||||
|
||||
return arguments.toList()
|
||||
|
||||
+19
-23
@@ -13,7 +13,6 @@ import org.gradle.util.GradleVersion
|
||||
import org.jetbrains.kotlin.gradle.BaseGradleIT.Companion.acceptAndroidSdkLicenses
|
||||
import org.jetbrains.kotlin.gradle.model.ModelContainer
|
||||
import org.jetbrains.kotlin.gradle.model.ModelFetcherBuildAction
|
||||
import org.jetbrains.kotlin.gradle.native.disableKotlinNativeCaches
|
||||
import org.jetbrains.kotlin.gradle.report.BuildReportType
|
||||
import org.jetbrains.kotlin.gradle.util.modify
|
||||
import org.jetbrains.kotlin.konan.target.HostManager
|
||||
@@ -45,7 +44,7 @@ fun KGPBaseTest.project(
|
||||
projectPathAdditionalSuffix: String = "",
|
||||
buildJdk: File? = null,
|
||||
localRepoDir: Path? = null,
|
||||
test: TestProject.() -> Unit = {}
|
||||
test: TestProject.() -> Unit = {},
|
||||
): TestProject {
|
||||
val projectPath = setupProjectFromTestResources(
|
||||
projectName,
|
||||
@@ -105,7 +104,7 @@ fun KGPBaseTest.nativeProject(
|
||||
projectPathAdditionalSuffix: String = "",
|
||||
buildJdk: File? = null,
|
||||
localRepoDir: Path? = null,
|
||||
test: TestProject.() -> Unit = {}
|
||||
test: TestProject.() -> Unit = {},
|
||||
): TestProject {
|
||||
val project = project(
|
||||
projectName = projectName,
|
||||
@@ -120,7 +119,6 @@ fun KGPBaseTest.nativeProject(
|
||||
localRepoDir = localRepoDir,
|
||||
)
|
||||
project.configureSingleNativeTarget()
|
||||
project.disableKotlinNativeCaches()
|
||||
project.test()
|
||||
return project
|
||||
}
|
||||
@@ -136,7 +134,7 @@ fun TestProject.build(
|
||||
enableBuildCacheDebug: Boolean = false,
|
||||
enableBuildScan: Boolean = this.enableBuildScan,
|
||||
buildOptions: BuildOptions = this.buildOptions,
|
||||
assertions: BuildResult.() -> Unit = {}
|
||||
assertions: BuildResult.() -> Unit = {},
|
||||
) {
|
||||
if (enableBuildScan) agreeToBuildScanService()
|
||||
|
||||
@@ -171,7 +169,7 @@ fun TestProject.buildAndFail(
|
||||
enableBuildCacheDebug: Boolean = false,
|
||||
enableBuildScan: Boolean = this.enableBuildScan,
|
||||
buildOptions: BuildOptions = this.buildOptions,
|
||||
assertions: BuildResult.() -> Unit = {}
|
||||
assertions: BuildResult.() -> Unit = {},
|
||||
) {
|
||||
if (enableBuildScan) agreeToBuildScanService()
|
||||
|
||||
@@ -203,7 +201,7 @@ private fun BuildResult.additionalAssertions(buildOptions: BuildOptions) {
|
||||
}
|
||||
|
||||
internal inline fun <reified T> TestProject.getModels(
|
||||
crossinline assertions: ModelContainer<T>.() -> Unit
|
||||
crossinline assertions: ModelContainer<T>.() -> Unit,
|
||||
) {
|
||||
|
||||
val allBuildArguments = commonBuildSetup(
|
||||
@@ -231,7 +229,7 @@ internal inline fun <reified T> TestProject.getModels(
|
||||
}
|
||||
|
||||
fun TestProject.enableLocalBuildCache(
|
||||
buildCacheLocation: Path
|
||||
buildCacheLocation: Path,
|
||||
) {
|
||||
// language=Groovy
|
||||
settingsGradle.append(
|
||||
@@ -247,7 +245,7 @@ fun TestProject.enableLocalBuildCache(
|
||||
|
||||
fun TestProject.enableStatisticReports(
|
||||
type: BuildReportType,
|
||||
url: String?
|
||||
url: String?,
|
||||
) {
|
||||
gradleProperties.append(
|
||||
"\nkotlin.build.report.output=${type.name}\n"
|
||||
@@ -262,7 +260,7 @@ fun TestProject.enableStatisticReports(
|
||||
|
||||
open class GradleProject(
|
||||
val projectName: String,
|
||||
val projectPath: Path
|
||||
val projectPath: Path,
|
||||
) {
|
||||
val buildGradle: Path get() = projectPath.resolve("build.gradle")
|
||||
val buildGradleKts: Path get() = projectPath.resolve("build.gradle.kts")
|
||||
@@ -273,27 +271,27 @@ open class GradleProject(
|
||||
|
||||
fun classesDir(
|
||||
sourceSet: String = "main",
|
||||
language: String = "kotlin"
|
||||
language: String = "kotlin",
|
||||
): Path = projectPath.resolve("build/classes/$language/$sourceSet/")
|
||||
|
||||
fun kotlinClassesDir(
|
||||
sourceSet: String = "main"
|
||||
sourceSet: String = "main",
|
||||
): Path = classesDir(sourceSet, language = "kotlin")
|
||||
|
||||
fun javaClassesDir(
|
||||
sourceSet: String = "main"
|
||||
sourceSet: String = "main",
|
||||
): Path = classesDir(sourceSet, language = "java")
|
||||
|
||||
fun kotlinSourcesDir(
|
||||
sourceSet: String = "main"
|
||||
sourceSet: String = "main",
|
||||
): Path = projectPath.resolve("src/$sourceSet/kotlin")
|
||||
|
||||
fun javaSourcesDir(
|
||||
sourceSet: String = "main"
|
||||
sourceSet: String = "main",
|
||||
): Path = projectPath.resolve("src/$sourceSet/java")
|
||||
|
||||
fun relativeToProject(
|
||||
files: List<Path>
|
||||
files: List<Path>,
|
||||
): List<Path> = files.map { projectPath.relativize(it) }
|
||||
}
|
||||
|
||||
@@ -314,7 +312,7 @@ class TestProject(
|
||||
* A port to debug the Kotlin daemon at.
|
||||
* Note that we'll need to let the debugger start listening at this port first *before* the Kotlin daemon is launched.
|
||||
*/
|
||||
val kotlinDaemonDebugPort: Int? = null
|
||||
val kotlinDaemonDebugPort: Int? = null,
|
||||
) : GradleProject(projectName, projectPath) {
|
||||
fun subProject(name: String) = GradleProject(name, projectPath.resolve(name))
|
||||
|
||||
@@ -350,7 +348,7 @@ class TestProject(
|
||||
otherProjectName: String,
|
||||
pathPrefix: String,
|
||||
newSubmoduleName: String = otherProjectName,
|
||||
isKts: Boolean = false
|
||||
isKts: Boolean = false,
|
||||
) {
|
||||
val otherProjectPath = "$pathPrefix/$otherProjectName".testProjectPath
|
||||
otherProjectPath.copyRecursively(projectPath.resolve(newSubmoduleName))
|
||||
@@ -367,7 +365,7 @@ class TestProject(
|
||||
|
||||
fun includeOtherProjectAsIncludedBuild(
|
||||
otherProjectName: String,
|
||||
pathPrefix: String
|
||||
pathPrefix: String,
|
||||
) {
|
||||
val otherProjectPath = "$pathPrefix/$otherProjectName".testProjectPath
|
||||
otherProjectPath.copyRecursively(projectPath.resolve(otherProjectName))
|
||||
@@ -389,7 +387,7 @@ private fun commonBuildSetup(
|
||||
enableBuildCacheDebug: Boolean,
|
||||
enableBuildScan: Boolean,
|
||||
gradleVersion: GradleVersion,
|
||||
kotlinDaemonDebugPort: Int? = null
|
||||
kotlinDaemonDebugPort: Int? = null,
|
||||
): List<String> {
|
||||
return buildOptions.toArguments(gradleVersion) + buildArguments + listOfNotNull(
|
||||
"--full-stacktrace",
|
||||
@@ -406,7 +404,7 @@ private fun commonBuildSetup(
|
||||
|
||||
private fun TestProject.withBuildSummary(
|
||||
buildArguments: List<String>,
|
||||
run: () -> Unit
|
||||
run: () -> Unit,
|
||||
) {
|
||||
try {
|
||||
run()
|
||||
@@ -624,8 +622,6 @@ private fun TestProject.configureLocalRepository(localRepoDir: Path) {
|
||||
}
|
||||
}
|
||||
|
||||
internal fun TestProject.disableKotlinNativeCaches() = gradleProperties.toFile().disableKotlinNativeCaches()
|
||||
|
||||
internal fun TestProject.enableStableConfigurationCachePreview() {
|
||||
val settingsFile = if (settingsGradleKts.exists()) {
|
||||
settingsGradleKts
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
plugins {
|
||||
id("org.jetbrains.kotlin.multiplatform").version("<pluginMarkerVersion>")
|
||||
id("org.jetbrains.kotlin.multiplatform")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven("<LocalRepo>")
|
||||
maven("<localRepo>")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("org.jetbrains.kotlin.multiplatform").version("<pluginMarkerVersion>")
|
||||
id("org.jetbrains.kotlin.multiplatform")
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ kotlin {
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("<LocalRepo>")
|
||||
url = uri("<localRepo>")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("org.jetbrains.kotlin.multiplatform").version("<pluginMarkerVersion>")
|
||||
id("org.jetbrains.kotlin.multiplatform")
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ kotlin {
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("<LocalRepo>")
|
||||
url = uri("<localRepo>")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("org.jetbrains.kotlin.multiplatform").version("<pluginMarkerVersion>")
|
||||
id("org.jetbrains.kotlin.multiplatform")
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ version = "1.0"
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven("<LocalRepo>")
|
||||
maven("<localRepo>")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
@@ -23,7 +23,7 @@ kotlin {
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("<LocalRepo>")
|
||||
url = uri("<localRepo>")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("org.jetbrains.kotlin.multiplatform").version("<pluginMarkerVersion>")
|
||||
id("org.jetbrains.kotlin.multiplatform")
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
plugins {
|
||||
id("org.jetbrains.kotlin.multiplatform").version("<pluginMarkerVersion>")
|
||||
id("org.jetbrains.kotlin.multiplatform")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven("<LocalRepo>")
|
||||
maven("<localRepo>")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("org.jetbrains.kotlin.multiplatform").version("<pluginMarkerVersion>")
|
||||
id("org.jetbrains.kotlin.multiplatform")
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ kotlin {
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("<LocalRepo>")
|
||||
url = uri("<localRepo>")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("org.jetbrains.kotlin.multiplatform").version("<pluginMarkerVersion>")
|
||||
id("org.jetbrains.kotlin.multiplatform")
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ kotlin {
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("<LocalRepo>")
|
||||
url = uri("<localRepo>")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("org.jetbrains.kotlin.multiplatform").version("<pluginMarkerVersion>")
|
||||
id("org.jetbrains.kotlin.multiplatform")
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ version = "1.0"
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven("<LocalRepo>")
|
||||
maven("<localRepo>")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
@@ -23,7 +23,7 @@ kotlin {
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("<LocalRepo>")
|
||||
url = uri("<localRepo>")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user