[Gradle] Added dependencyManagement as to Integration Tests
Also fixed found problems with k/n toolchain feature ^KT-64903 Fixed
This commit is contained in:
committed by
Space Team
parent
4b1bbefe05
commit
d4a4696baf
-1
@@ -274,7 +274,6 @@ abstract class BaseGradleIT {
|
|||||||
val showDiagnosticsStacktrace: Boolean? = false, // false by default to not clutter the testdata + stacktraces change often
|
val showDiagnosticsStacktrace: Boolean? = false, // false by default to not clutter the testdata + stacktraces change often
|
||||||
val stacktraceMode: String? = StacktraceOption.FULL_STACKTRACE_LONG_OPTION,
|
val stacktraceMode: String? = StacktraceOption.FULL_STACKTRACE_LONG_OPTION,
|
||||||
val konanDataDir: Path = konanDir,
|
val konanDataDir: Path = konanDir,
|
||||||
// TODO(Dmitrii Krasnov): we can remove this, when downloading konan from maven local will be possible KT-63198
|
|
||||||
val distributionDownloadFromMaven: Boolean? = false,
|
val distributionDownloadFromMaven: Boolean? = false,
|
||||||
) {
|
) {
|
||||||
val safeAndroidGradlePluginVersion: AGPVersion
|
val safeAndroidGradlePluginVersion: AGPVersion
|
||||||
|
|||||||
+15
-11
@@ -121,7 +121,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
|
|||||||
fun testRelocationAndroidProject(
|
fun testRelocationAndroidProject(
|
||||||
gradleVersion: GradleVersion,
|
gradleVersion: GradleVersion,
|
||||||
agpVersion: String,
|
agpVersion: String,
|
||||||
jdkProvider: JdkVersions.ProvidedJdk
|
jdkProvider: JdkVersions.ProvidedJdk,
|
||||||
) {
|
) {
|
||||||
val (firstProject, secondProject) = prepareTestProjects(
|
val (firstProject, secondProject) = prepareTestProjects(
|
||||||
"AndroidProject",
|
"AndroidProject",
|
||||||
@@ -150,7 +150,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
|
|||||||
fun testRelocationAndroidDagger(
|
fun testRelocationAndroidDagger(
|
||||||
gradleVersion: GradleVersion,
|
gradleVersion: GradleVersion,
|
||||||
agpVersion: String,
|
agpVersion: String,
|
||||||
jdkProvider: JdkVersions.ProvidedJdk
|
jdkProvider: JdkVersions.ProvidedJdk,
|
||||||
) {
|
) {
|
||||||
val (firstProject, secondProject) = prepareTestProjects(
|
val (firstProject, secondProject) = prepareTestProjects(
|
||||||
"kapt2/android-dagger",
|
"kapt2/android-dagger",
|
||||||
@@ -179,7 +179,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
|
|||||||
fun kaptIgnoreEmptyAndroidVariant(
|
fun kaptIgnoreEmptyAndroidVariant(
|
||||||
gradleVersion: GradleVersion,
|
gradleVersion: GradleVersion,
|
||||||
agpVersion: String,
|
agpVersion: String,
|
||||||
jdkProvider: JdkVersions.ProvidedJdk
|
jdkProvider: JdkVersions.ProvidedJdk,
|
||||||
) {
|
) {
|
||||||
val (firstProject, secondProject) = prepareTestProjects(
|
val (firstProject, secondProject) = prepareTestProjects(
|
||||||
"kapt2/android-dagger",
|
"kapt2/android-dagger",
|
||||||
@@ -209,6 +209,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
|
|||||||
@DisplayName("with native project")
|
@DisplayName("with native project")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testRelocationNative(gradleVersion: GradleVersion) {
|
fun testRelocationNative(gradleVersion: GradleVersion) {
|
||||||
|
val localRepoDir = defaultLocalRepo(gradleVersion)
|
||||||
val buildOptionsBeforeCaching = defaultBuildOptions.copy(
|
val buildOptionsBeforeCaching = defaultBuildOptions.copy(
|
||||||
nativeOptions = super.defaultBuildOptions.nativeOptions.copy(
|
nativeOptions = super.defaultBuildOptions.nativeOptions.copy(
|
||||||
version = TestVersions.Kotlin.STABLE_RELEASE,
|
version = TestVersions.Kotlin.STABLE_RELEASE,
|
||||||
@@ -218,15 +219,15 @@ class BuildCacheRelocationIT : KGPBaseTest() {
|
|||||||
val (firstProject, secondProject) = prepareTestProjects(
|
val (firstProject, secondProject) = prepareTestProjects(
|
||||||
"native-build-cache",
|
"native-build-cache",
|
||||||
gradleVersion,
|
gradleVersion,
|
||||||
buildOptions = buildOptionsBeforeCaching
|
buildOptions = buildOptionsBeforeCaching,
|
||||||
|
localRepoDir = localRepoDir
|
||||||
) {
|
) {
|
||||||
val localRepoUri = it.projectPath.resolve("repo").toUri()
|
|
||||||
it.subProject("build-cache-app").buildGradleKts.append(
|
it.subProject("build-cache-app").buildGradleKts.append(
|
||||||
"""
|
"""
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
setUrl("$localRepoUri")
|
setUrl("$localRepoDir")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
@@ -286,14 +287,15 @@ class BuildCacheRelocationIT : KGPBaseTest() {
|
|||||||
gradleVersion: GradleVersion,
|
gradleVersion: GradleVersion,
|
||||||
buildOptions: BuildOptions = defaultBuildOptions,
|
buildOptions: BuildOptions = defaultBuildOptions,
|
||||||
buildJdk: File? = null,
|
buildJdk: File? = null,
|
||||||
additionalConfiguration: (TestProject) -> Unit = {}
|
localRepoDir: Path? = null,
|
||||||
|
additionalConfiguration: (TestProject) -> Unit = {},
|
||||||
): Pair<TestProject, TestProject> {
|
): Pair<TestProject, TestProject> {
|
||||||
val firstProject = project(projectName, gradleVersion, buildOptions, buildJdk = buildJdk, forceOutput = true) {
|
val firstProject = project(projectName, gradleVersion, buildOptions, buildJdk = buildJdk, localRepoDir = localRepoDir) {
|
||||||
enableLocalBuildCache(localBuildCacheDir)
|
enableLocalBuildCache(localBuildCacheDir)
|
||||||
additionalConfiguration(this)
|
additionalConfiguration(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
val secondProject = project(projectName, gradleVersion, buildOptions, buildJdk = buildJdk, forceOutput = true) {
|
val secondProject = project(projectName, gradleVersion, buildOptions, buildJdk = buildJdk, localRepoDir = localRepoDir) {
|
||||||
enableLocalBuildCache(localBuildCacheDir)
|
enableLocalBuildCache(localBuildCacheDir)
|
||||||
additionalConfiguration(this)
|
additionalConfiguration(this)
|
||||||
}
|
}
|
||||||
@@ -323,7 +325,7 @@ class BuildCacheRelocationIT : KGPBaseTest() {
|
|||||||
|
|
||||||
private fun checkKaptCachingIncrementalBuild(
|
private fun checkKaptCachingIncrementalBuild(
|
||||||
firstProject: TestProject,
|
firstProject: TestProject,
|
||||||
secondProject: TestProject
|
secondProject: TestProject,
|
||||||
) {
|
) {
|
||||||
val options = defaultBuildOptions.copy(
|
val options = defaultBuildOptions.copy(
|
||||||
kaptOptions = BuildOptions.KaptOptions(
|
kaptOptions = BuildOptions.KaptOptions(
|
||||||
@@ -408,7 +410,9 @@ class BuildCacheRelocationIT : KGPBaseTest() {
|
|||||||
configureProject: (TestProject) -> Unit = {},
|
configureProject: (TestProject) -> Unit = {},
|
||||||
) {
|
) {
|
||||||
val (firstProject, secondProject) =
|
val (firstProject, secondProject) =
|
||||||
prepareTestProjects("buildCacheSimple", gradleVersion, buildOptions, buildJdk = null, configureProject)
|
prepareTestProjects("buildCacheSimple", gradleVersion, buildOptions, buildJdk = null) {
|
||||||
|
configureProject(it)
|
||||||
|
}
|
||||||
|
|
||||||
// Build the first project -- It should be a cache miss
|
// Build the first project -- It should be a cache miss
|
||||||
firstProject.build(":compileKotlin") {
|
firstProject.build(":compileKotlin") {
|
||||||
|
|||||||
+6
-3
@@ -28,6 +28,9 @@ class BuildToolsApiJvmCompilationIT : KGPBaseTest() {
|
|||||||
"simpleProject", gradleVersion, buildOptions = defaultBuildOptions.copy(
|
"simpleProject", gradleVersion, buildOptions = defaultBuildOptions.copy(
|
||||||
runViaBuildToolsApi = false,
|
runViaBuildToolsApi = false,
|
||||||
incremental = false,
|
incremental = false,
|
||||||
|
),
|
||||||
|
dependencyManagement = DependencyManagement.DefaultDependencyManagement(
|
||||||
|
setOf("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap")
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
build("assemble") {
|
build("assemble") {
|
||||||
@@ -48,6 +51,9 @@ class BuildToolsApiJvmCompilationIT : KGPBaseTest() {
|
|||||||
project(
|
project(
|
||||||
"simpleProject", gradleVersion, buildOptions = defaultBuildOptions.copy(
|
"simpleProject", gradleVersion, buildOptions = defaultBuildOptions.copy(
|
||||||
incremental = false,
|
incremental = false,
|
||||||
|
),
|
||||||
|
dependencyManagement = DependencyManagement.DefaultDependencyManagement(
|
||||||
|
setOf("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap")
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
enableOtherVersionBuildToolsImpl()
|
enableOtherVersionBuildToolsImpl()
|
||||||
@@ -152,9 +158,6 @@ private const val OTHER_KOTLIN_VERSION = "1.9.30-dev-460"
|
|||||||
private fun TestProject.enableOtherVersionBuildToolsImpl() {
|
private fun TestProject.enableOtherVersionBuildToolsImpl() {
|
||||||
buildGradle.append(
|
buildGradle.append(
|
||||||
"""
|
"""
|
||||||
repositories {
|
|
||||||
maven { setUrl("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") }
|
|
||||||
}
|
|
||||||
kotlin {
|
kotlin {
|
||||||
useCompilerVersion("$OTHER_KOTLIN_VERSION")
|
useCompilerVersion("$OTHER_KOTLIN_VERSION")
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-1
@@ -535,7 +535,11 @@ open class CommonizerIT : KGPBaseTest() {
|
|||||||
@DisplayName("KT-57796 commonization with two cinterop commonizer groups`")
|
@DisplayName("KT-57796 commonization with two cinterop commonizer groups`")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testCommonizationWithLibraryContainingTwoRoots(gradleVersion: GradleVersion) {
|
fun testCommonizationWithLibraryContainingTwoRoots(gradleVersion: GradleVersion) {
|
||||||
project("commonize-kt-56729-consume-library-with-two-roots", gradleVersion) {
|
project(
|
||||||
|
"commonize-kt-56729-consume-library-with-two-roots",
|
||||||
|
gradleVersion,
|
||||||
|
localRepoDir = defaultLocalRepo(gradleVersion)
|
||||||
|
) {
|
||||||
build("publish")
|
build("publish")
|
||||||
|
|
||||||
build(":consumer:assemble") {
|
build(":consumer:assemble") {
|
||||||
|
|||||||
+22
-11
@@ -17,14 +17,16 @@ import org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSet
|
|||||||
import org.jetbrains.kotlin.gradle.testbase.*
|
import org.jetbrains.kotlin.gradle.testbase.*
|
||||||
import org.jetbrains.kotlin.gradle.util.checkedReplace
|
import org.jetbrains.kotlin.gradle.util.checkedReplace
|
||||||
import org.jetbrains.kotlin.gradle.util.modify
|
import org.jetbrains.kotlin.gradle.util.modify
|
||||||
import org.junit.jupiter.api.Disabled
|
|
||||||
import org.junit.jupiter.api.DisplayName
|
import org.junit.jupiter.api.DisplayName
|
||||||
import org.junit.jupiter.api.condition.OS
|
import org.junit.jupiter.api.condition.OS
|
||||||
import org.junit.jupiter.api.io.TempDir
|
import org.junit.jupiter.api.io.TempDir
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
import java.util.zip.ZipFile
|
import java.util.zip.ZipFile
|
||||||
import kotlin.io.path.*
|
import kotlin.io.path.appendText
|
||||||
|
import kotlin.io.path.exists
|
||||||
|
import kotlin.io.path.readText
|
||||||
|
import kotlin.io.path.writeText
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
import kotlin.test.assertNotNull
|
import kotlin.test.assertNotNull
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
@@ -737,22 +739,23 @@ open class HierarchicalMppIT : KGPBaseTest() {
|
|||||||
build(":my-lib-foo:compileJvmAndJsMainKotlinMetadata")
|
build(":my-lib-foo:compileJvmAndJsMainKotlinMetadata")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_0)
|
||||||
@GradleTest
|
@GradleTest
|
||||||
@DisplayName("HMPP dependencies in js tests")
|
@DisplayName("HMPP dependencies in js tests")
|
||||||
fun testHmppDependenciesInJsTests(gradleVersion: GradleVersion, @TempDir tempDir: Path) {
|
fun testHmppDependenciesInJsTests(gradleVersion: GradleVersion, @TempDir tempDir: Path) {
|
||||||
// For some reason Gradle 6.* fails with message about using deprecated API which will fail in 7.0
|
|
||||||
// But for Gradle 7.* everything works, so seems false positive
|
|
||||||
if (gradleVersion.baseVersion.version.substringBefore(".").toInt() < 7) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
publishThirdPartyLib(
|
publishThirdPartyLib(
|
||||||
withGranularMetadata = true,
|
withGranularMetadata = true,
|
||||||
gradleVersion = gradleVersion,
|
gradleVersion = gradleVersion,
|
||||||
localRepoDir = tempDir
|
localRepoDir = tempDir
|
||||||
)
|
)
|
||||||
with(project("hierarchical-mpp-js-test", gradleVersion)) {
|
project(
|
||||||
|
"hierarchical-mpp-js-test",
|
||||||
|
gradleVersion,
|
||||||
|
localRepoDir = tempDir
|
||||||
|
) {
|
||||||
val taskToExecute = ":jsNodeTest"
|
val taskToExecute = ":jsNodeTest"
|
||||||
build(taskToExecute, "-PthirdPartyRepo=${tempDir.absolutePathString()}") {
|
build(taskToExecute) {
|
||||||
assertTasksExecuted(taskToExecute)
|
assertTasksExecuted(taskToExecute)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1068,7 +1071,11 @@ open class HierarchicalMppIT : KGPBaseTest() {
|
|||||||
@GradleTest
|
@GradleTest
|
||||||
@DisplayName("KT-52216: [TYPE_MISMATCH] Caused by unexpected metadata dependencies of leaf source sets")
|
@DisplayName("KT-52216: [TYPE_MISMATCH] Caused by unexpected metadata dependencies of leaf source sets")
|
||||||
fun `test default platform compilation source set has no metadata dependencies`(gradleVersion: GradleVersion) {
|
fun `test default platform compilation source set has no metadata dependencies`(gradleVersion: GradleVersion) {
|
||||||
with(project("kt-52216", gradleVersion = gradleVersion)) {
|
project(
|
||||||
|
"kt-52216",
|
||||||
|
gradleVersion = gradleVersion,
|
||||||
|
localRepoDir = defaultLocalRepo(gradleVersion)
|
||||||
|
) {
|
||||||
build(":lib:publish")
|
build(":lib:publish")
|
||||||
testDependencyTransformations("p1") { reports ->
|
testDependencyTransformations("p1") { reports ->
|
||||||
for (leafSourceSetName in listOf("jvmMain", "jsMain", "linuxX64Main")) {
|
for (leafSourceSetName in listOf("jvmMain", "jsMain", "linuxX64Main")) {
|
||||||
@@ -1138,7 +1145,11 @@ open class HierarchicalMppIT : KGPBaseTest() {
|
|||||||
@GradleTest
|
@GradleTest
|
||||||
@DisplayName("KT-55071: Shared Native Compilations: Use default parameters declared in dependsOn source set")
|
@DisplayName("KT-55071: Shared Native Compilations: Use default parameters declared in dependsOn source set")
|
||||||
fun `test shared native compilation with default parameters declared in dependsOn source set`(gradleVersion: GradleVersion) {
|
fun `test shared native compilation with default parameters declared in dependsOn source set`(gradleVersion: GradleVersion) {
|
||||||
with(project("kt-55071-compileSharedNative-withDefaultParameters", gradleVersion = gradleVersion)) {
|
project(
|
||||||
|
"kt-55071-compileSharedNative-withDefaultParameters",
|
||||||
|
gradleVersion = gradleVersion,
|
||||||
|
localRepoDir = defaultLocalRepo(gradleVersion)
|
||||||
|
) {
|
||||||
build(":producer:publish") {
|
build(":producer:publish") {
|
||||||
assertTasksExecuted(":producer:compileCommonMainKotlinMetadata")
|
assertTasksExecuted(":producer:compileCommonMainKotlinMetadata")
|
||||||
assertTasksExecuted(":producer:compileSecondCommonMainKotlinMetadata")
|
assertTasksExecuted(":producer:compileSecondCommonMainKotlinMetadata")
|
||||||
|
|||||||
+30
-10
@@ -81,6 +81,7 @@ abstract class Kapt3BaseIT : KGPBaseTest() {
|
|||||||
buildJdk: File? = null,
|
buildJdk: File? = null,
|
||||||
localRepoDir: Path? = null,
|
localRepoDir: Path? = null,
|
||||||
environmentVariables: EnvironmentalVariables = EnvironmentalVariables(),
|
environmentVariables: EnvironmentalVariables = EnvironmentalVariables(),
|
||||||
|
dependencyManagement: DependencyManagement = DependencyManagement.DefaultDependencyManagement(),
|
||||||
test: TestProject.() -> Unit = {},
|
test: TestProject.() -> Unit = {},
|
||||||
): TestProject = testBaseProject(
|
): TestProject = testBaseProject(
|
||||||
projectName = projectName,
|
projectName = projectName,
|
||||||
@@ -88,6 +89,7 @@ abstract class Kapt3BaseIT : KGPBaseTest() {
|
|||||||
buildOptions = buildOptions,
|
buildOptions = buildOptions,
|
||||||
forceOutput = forceOutput,
|
forceOutput = forceOutput,
|
||||||
enableBuildScan = enableBuildScan,
|
enableBuildScan = enableBuildScan,
|
||||||
|
dependencyManagement = dependencyManagement,
|
||||||
addHeapDumpOptions = addHeapDumpOptions,
|
addHeapDumpOptions = addHeapDumpOptions,
|
||||||
enableGradleDebug = enableGradleDebug,
|
enableGradleDebug = enableGradleDebug,
|
||||||
enableKotlinDaemonMemoryLimitInMb = enableKotlinDaemonMemoryLimitInMb,
|
enableKotlinDaemonMemoryLimitInMb = enableKotlinDaemonMemoryLimitInMb,
|
||||||
@@ -225,7 +227,7 @@ open class Kapt3IT : Kapt3BaseIT() {
|
|||||||
@GradleWithJdkTest
|
@GradleWithJdkTest
|
||||||
fun doTestSimpleWithCustomJdk(
|
fun doTestSimpleWithCustomJdk(
|
||||||
gradleVersion: GradleVersion,
|
gradleVersion: GradleVersion,
|
||||||
jdk: JdkVersions.ProvidedJdk
|
jdk: JdkVersions.ProvidedJdk,
|
||||||
) {
|
) {
|
||||||
project(
|
project(
|
||||||
"simple".withPrefix,
|
"simple".withPrefix,
|
||||||
@@ -254,7 +256,7 @@ open class Kapt3IT : Kapt3BaseIT() {
|
|||||||
@GradleWithJdkTest
|
@GradleWithJdkTest
|
||||||
fun kaptClasspathJreToolchain(
|
fun kaptClasspathJreToolchain(
|
||||||
gradleVersion: GradleVersion,
|
gradleVersion: GradleVersion,
|
||||||
jdk: JdkVersions.ProvidedJdk
|
jdk: JdkVersions.ProvidedJdk,
|
||||||
) {
|
) {
|
||||||
project(
|
project(
|
||||||
"simple".withPrefix,
|
"simple".withPrefix,
|
||||||
@@ -382,7 +384,7 @@ open class Kapt3IT : Kapt3BaseIT() {
|
|||||||
|
|
||||||
@DisplayName("Kapt is working with incremental compilation")
|
@DisplayName("Kapt is working with incremental compilation")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
open fun testSimpleWithIC(gradleVersion: GradleVersion) {
|
open fun testSimpleWithIC(gradleVersion: GradleVersion) {
|
||||||
doTestSimpleWithIC(gradleVersion)
|
doTestSimpleWithIC(gradleVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -567,7 +569,7 @@ open class Kapt3IT : Kapt3BaseIT() {
|
|||||||
// tests all output directories are cleared when IC rebuilds
|
// tests all output directories are cleared when IC rebuilds
|
||||||
private fun testICRebuild(
|
private fun testICRebuild(
|
||||||
gradleVersion: GradleVersion,
|
gradleVersion: GradleVersion,
|
||||||
performChange: (TestProject) -> Unit
|
performChange: (TestProject) -> Unit,
|
||||||
) {
|
) {
|
||||||
project(
|
project(
|
||||||
"incrementalRebuild".withPrefix,
|
"incrementalRebuild".withPrefix,
|
||||||
@@ -735,7 +737,11 @@ open class Kapt3IT : Kapt3BaseIT() {
|
|||||||
@DisplayName("Should re-run kapt on changes in local annotation processor")
|
@DisplayName("Should re-run kapt on changes in local annotation processor")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
open fun testChangesInLocalAnnotationProcessor(gradleVersion: GradleVersion) {
|
open fun testChangesInLocalAnnotationProcessor(gradleVersion: GradleVersion) {
|
||||||
project("localAnnotationProcessor".withPrefix, gradleVersion) {
|
project(
|
||||||
|
"localAnnotationProcessor".withPrefix,
|
||||||
|
gradleVersion,
|
||||||
|
dependencyManagement = DependencyManagement.DefaultDependencyManagement(setOf("https://jitpack.io"))
|
||||||
|
) {
|
||||||
build("build")
|
build("build")
|
||||||
|
|
||||||
val testAnnotationProcessor = subProject("annotation-processor").javaSourcesDir().resolve("TestAnnotationProcessor.kt")
|
val testAnnotationProcessor = subProject("annotation-processor").javaSourcesDir().resolve("TestAnnotationProcessor.kt")
|
||||||
@@ -973,7 +979,15 @@ open class Kapt3IT : Kapt3BaseIT() {
|
|||||||
@DisplayName("Dependency on kapt module should not resolve all configurations")
|
@DisplayName("Dependency on kapt module should not resolve all configurations")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testDependencyOnKaptModule(gradleVersion: GradleVersion) {
|
fun testDependencyOnKaptModule(gradleVersion: GradleVersion) {
|
||||||
project("simpleProject", gradleVersion) {
|
project(
|
||||||
|
"simpleProject",
|
||||||
|
gradleVersion,
|
||||||
|
buildOptions = defaultBuildOptions.copy(
|
||||||
|
nativeOptions = defaultBuildOptions.nativeOptions.copy(
|
||||||
|
distributionDownloadFromMaven = false // TODO(Dmitrii Krasnov): this flag is off, because we try to find configuration which is not in maven yet. Could be set to true after KTI-1569 is done
|
||||||
|
)
|
||||||
|
)
|
||||||
|
) {
|
||||||
includeOtherProjectAsSubmodule("simple", "kapt2")
|
includeOtherProjectAsSubmodule("simple", "kapt2")
|
||||||
buildGradle.append("\ndependencies { implementation project(':simple') }")
|
buildGradle.append("\ndependencies { implementation project(':simple') }")
|
||||||
|
|
||||||
@@ -1076,7 +1090,7 @@ open class Kapt3IT : Kapt3BaseIT() {
|
|||||||
|
|
||||||
@DisplayName("Works with JPMS on JDK 9+")
|
@DisplayName("Works with JPMS on JDK 9+")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testJpmsModule(gradleVersion: GradleVersion, ) {
|
fun testJpmsModule(gradleVersion: GradleVersion) {
|
||||||
project(
|
project(
|
||||||
"jpms-module".withPrefix,
|
"jpms-module".withPrefix,
|
||||||
gradleVersion,
|
gradleVersion,
|
||||||
@@ -1128,7 +1142,11 @@ open class Kapt3IT : Kapt3BaseIT() {
|
|||||||
@DisplayName("KT-47347: kapt processors should not be an input files for stub generation")
|
@DisplayName("KT-47347: kapt processors should not be an input files for stub generation")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
open fun testChangesToKaptConfigurationDoNotTriggerStubGeneration(gradleVersion: GradleVersion) {
|
open fun testChangesToKaptConfigurationDoNotTriggerStubGeneration(gradleVersion: GradleVersion) {
|
||||||
project("localAnnotationProcessor".withPrefix, gradleVersion) {
|
project(
|
||||||
|
"localAnnotationProcessor".withPrefix,
|
||||||
|
gradleVersion,
|
||||||
|
dependencyManagement = DependencyManagement.DefaultDependencyManagement(setOf("https://jitpack.io"))
|
||||||
|
) {
|
||||||
build("assemble")
|
build("assemble")
|
||||||
|
|
||||||
ZipOutputStream(projectPath.resolve("fake_processor.jar").outputStream()).close()
|
ZipOutputStream(projectPath.resolve("fake_processor.jar").outputStream()).close()
|
||||||
@@ -1337,9 +1355,11 @@ open class Kapt3IT : Kapt3BaseIT() {
|
|||||||
fun testSerializationPlugin(gradleVersion: GradleVersion) {
|
fun testSerializationPlugin(gradleVersion: GradleVersion) {
|
||||||
project("serialization".withPrefix, gradleVersion) {
|
project("serialization".withPrefix, gradleVersion) {
|
||||||
build(":kaptGenerateStubsKotlin") {
|
build(":kaptGenerateStubsKotlin") {
|
||||||
assertFileInProjectContains("build/tmp/kapt3/stubs/main/foo/Data.java",
|
assertFileInProjectContains(
|
||||||
|
"build/tmp/kapt3/stubs/main/foo/Data.java",
|
||||||
"public static final class Companion",
|
"public static final class Companion",
|
||||||
"public static final class \$serializer implements kotlinx.serialization.internal.GeneratedSerializer<foo.Data>")
|
"public static final class \$serializer implements kotlinx.serialization.internal.GeneratedSerializer<foo.Data>"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-3
@@ -19,7 +19,11 @@ class KotlinWasmGradlePluginIT : KGPBaseTest() {
|
|||||||
@DisplayName("Check wasi target")
|
@DisplayName("Check wasi target")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun wasiTarget(gradleVersion: GradleVersion) {
|
fun wasiTarget(gradleVersion: GradleVersion) {
|
||||||
project("new-mpp-wasm-wasi-test", gradleVersion) {
|
project(
|
||||||
|
"new-mpp-wasm-wasi-test",
|
||||||
|
gradleVersion,
|
||||||
|
dependencyManagement = DependencyManagement.DisabledDependencyManagement // requires custom d8 repository during build
|
||||||
|
) {
|
||||||
buildGradleKts.modify(::transformBuildScriptWithPluginsDsl)
|
buildGradleKts.modify(::transformBuildScriptWithPluginsDsl)
|
||||||
|
|
||||||
build(":wasmWasiTest") {
|
build(":wasmWasiTest") {
|
||||||
@@ -53,7 +57,11 @@ class KotlinWasmGradlePluginIT : KGPBaseTest() {
|
|||||||
@DisplayName("Check js target")
|
@DisplayName("Check js target")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun jsTarget(gradleVersion: GradleVersion) {
|
fun jsTarget(gradleVersion: GradleVersion) {
|
||||||
project("new-mpp-wasm-test", gradleVersion) {
|
project(
|
||||||
|
"new-mpp-wasm-test",
|
||||||
|
gradleVersion,
|
||||||
|
dependencyManagement = DependencyManagement.DisabledDependencyManagement // requires custom repository for :kotlinNodeJsSetup during build
|
||||||
|
) {
|
||||||
buildGradleKts.modify {
|
buildGradleKts.modify {
|
||||||
transformBuildScriptWithPluginsDsl(it)
|
transformBuildScriptWithPluginsDsl(it)
|
||||||
.replace("<JsEngine>", "nodejs")
|
.replace("<JsEngine>", "nodejs")
|
||||||
@@ -93,7 +101,10 @@ class KotlinWasmGradlePluginIT : KGPBaseTest() {
|
|||||||
@DisplayName("Check wasi target run")
|
@DisplayName("Check wasi target run")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun wasiRun(gradleVersion: GradleVersion) {
|
fun wasiRun(gradleVersion: GradleVersion) {
|
||||||
project("new-mpp-wasm-wasi-test", gradleVersion) {
|
project(
|
||||||
|
"new-mpp-wasm-wasi-test", gradleVersion,
|
||||||
|
dependencyManagement = DependencyManagement.DisabledDependencyManagement // requires d8 custom repository during build
|
||||||
|
) {
|
||||||
buildGradleKts.modify(::transformBuildScriptWithPluginsDsl)
|
buildGradleKts.modify(::transformBuildScriptWithPluginsDsl)
|
||||||
|
|
||||||
build(":wasmWasiNodeRun") {
|
build(":wasmWasiNodeRun") {
|
||||||
|
|||||||
+15
-3
@@ -90,7 +90,11 @@ class MppIdeDependencyResolutionIT : KGPBaseTest() {
|
|||||||
|
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testCinterops(gradleVersion: GradleVersion) {
|
fun testCinterops(gradleVersion: GradleVersion) {
|
||||||
project(projectName = "cinteropImport", gradleVersion = gradleVersion) {
|
project(
|
||||||
|
projectName = "cinteropImport",
|
||||||
|
gradleVersion = gradleVersion,
|
||||||
|
localRepoDir = defaultLocalRepo(gradleVersion)
|
||||||
|
) {
|
||||||
build(":dep-with-cinterop:publishAllPublicationsToBuildRepository")
|
build(":dep-with-cinterop:publishAllPublicationsToBuildRepository")
|
||||||
|
|
||||||
resolveIdeDependencies("dep-with-cinterop") { dependencies ->
|
resolveIdeDependencies("dep-with-cinterop") { dependencies ->
|
||||||
@@ -328,7 +332,11 @@ class MppIdeDependencyResolutionIT : KGPBaseTest() {
|
|||||||
@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_6)
|
@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_6)
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun `test dependency on java testFixtures and feature source sets`(gradleVersion: GradleVersion) {
|
fun `test dependency on java testFixtures and feature source sets`(gradleVersion: GradleVersion) {
|
||||||
project("kt-60053-dependencyOn-testFixtures", gradleVersion) {
|
project(
|
||||||
|
"kt-60053-dependencyOn-testFixtures",
|
||||||
|
gradleVersion,
|
||||||
|
localRepoDir = defaultLocalRepo(gradleVersion)
|
||||||
|
) {
|
||||||
build("publish")
|
build("publish")
|
||||||
|
|
||||||
resolveIdeDependencies(":consumer") { dependencies ->
|
resolveIdeDependencies(":consumer") { dependencies ->
|
||||||
@@ -395,7 +403,11 @@ class MppIdeDependencyResolutionIT : KGPBaseTest() {
|
|||||||
@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_2)
|
@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_2)
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun `test resolve sources for dependency with multiple capabilities`(gradleVersion: GradleVersion) {
|
fun `test resolve sources for dependency with multiple capabilities`(gradleVersion: GradleVersion) {
|
||||||
project("kt-63226-multiple-capabilities", gradleVersion) {
|
project(
|
||||||
|
"kt-63226-multiple-capabilities",
|
||||||
|
gradleVersion,
|
||||||
|
localRepoDir = workingDir.resolve(gradleVersion.version),
|
||||||
|
) {
|
||||||
build(":producer:publish")
|
build(":producer:publish")
|
||||||
|
|
||||||
resolveIdeDependencies(":consumer") { dependencies ->
|
resolveIdeDependencies(":consumer") { dependencies ->
|
||||||
|
|||||||
+1
-1
@@ -149,7 +149,7 @@ class ResourcesIT : KGPBaseTest() {
|
|||||||
xResFile.parentFile.mkdirs()
|
xResFile.parentFile.mkdirs()
|
||||||
xResFile.writeText("some resource")
|
xResFile.writeText("some resource")
|
||||||
|
|
||||||
build("processXResources", enableGradleDebug = true) {
|
build("processXResources") {
|
||||||
assertTasksExecuted(":customResGenerator1")
|
assertTasksExecuted(":customResGenerator1")
|
||||||
assertFileInProjectExists("build/custom-res-1/myres.txt")
|
assertFileInProjectExists("build/custom-res-1/myres.txt")
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-1
@@ -32,7 +32,11 @@ class WasmConfigurationCacheIT : KGPBaseTest() {
|
|||||||
@GradleTest
|
@GradleTest
|
||||||
@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_6)
|
@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_6)
|
||||||
fun testD8Run(gradleVersion: GradleVersion) {
|
fun testD8Run(gradleVersion: GradleVersion) {
|
||||||
project("wasm-d8-simple-project", gradleVersion) {
|
project(
|
||||||
|
"wasm-d8-simple-project",
|
||||||
|
gradleVersion,
|
||||||
|
dependencyManagement = DependencyManagement.DisabledDependencyManagement // :d8Download adds custom ivy repository during build
|
||||||
|
) {
|
||||||
build("wasmJsD8Run", buildOptions = buildOptions) {
|
build("wasmJsD8Run", buildOptions = buildOptions) {
|
||||||
assertTasksExecuted(":wasmJsD8Run")
|
assertTasksExecuted(":wasmJsD8Run")
|
||||||
assertOutputContains(
|
assertOutputContains(
|
||||||
|
|||||||
+4
-1
@@ -90,7 +90,10 @@ open class Kapt3AndroidExternalIT : Kapt3BaseIT() {
|
|||||||
"android-dbflow".withPrefix,
|
"android-dbflow".withPrefix,
|
||||||
gradleVersion,
|
gradleVersion,
|
||||||
buildOptions = defaultBuildOptions.copy(androidVersion = agpVersion),
|
buildOptions = defaultBuildOptions.copy(androidVersion = agpVersion),
|
||||||
buildJdk = jdkVersion.location
|
buildJdk = jdkVersion.location,
|
||||||
|
dependencyManagement = DependencyManagement.DefaultDependencyManagement(
|
||||||
|
setOf("https://jitpack.io")
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
build("assembleDebug") {
|
build("assembleDebug") {
|
||||||
assertKaptSuccessful()
|
assertKaptSuccessful()
|
||||||
|
|||||||
+6
-2
@@ -95,7 +95,10 @@ class KotlinAndroidIT : KGPBaseTest() {
|
|||||||
"AndroidIcepickProject",
|
"AndroidIcepickProject",
|
||||||
gradleVersion,
|
gradleVersion,
|
||||||
buildOptions = defaultBuildOptions.copy(androidVersion = agpVersion),
|
buildOptions = defaultBuildOptions.copy(androidVersion = agpVersion),
|
||||||
buildJdk = jdkVersion.location
|
buildJdk = jdkVersion.location,
|
||||||
|
dependencyManagement = DependencyManagement.DefaultDependencyManagement(
|
||||||
|
setOf("https://clojars.org/repo/")
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
build("assembleDebug")
|
build("assembleDebug")
|
||||||
}
|
}
|
||||||
@@ -274,7 +277,8 @@ class KotlinAndroidIT : KGPBaseTest() {
|
|||||||
|
|
||||||
build(":Lib:assembleFlavor1Debug", ":Lib:publish") {
|
build(":Lib:assembleFlavor1Debug", ":Lib:publish") {
|
||||||
assertTasksExecuted(":Lib:compileFlavor1DebugKotlin", ":Lib:publishFlavorDebugPublicationToMavenRepository")
|
assertTasksExecuted(":Lib:compileFlavor1DebugKotlin", ":Lib:publishFlavorDebugPublicationToMavenRepository")
|
||||||
val pomLines = subProject("Lib").projectPath.resolve("build/repo/com/example/flavor1Debug/1.0/flavor1Debug-1.0.pom").readLines()
|
val pomLines =
|
||||||
|
subProject("Lib").projectPath.resolve("build/repo/com/example/flavor1Debug/1.0/flavor1Debug-1.0.pom").readLines()
|
||||||
val stdlibVersionLineNumber = pomLines.indexOfFirst { "<artifactId>kotlin-stdlib</artifactId>" in it } + 1
|
val stdlibVersionLineNumber = pomLines.indexOfFirst { "<artifactId>kotlin-stdlib</artifactId>" in it } + 1
|
||||||
val versionLine = pomLines[stdlibVersionLineNumber]
|
val versionLine = pomLines[stdlibVersionLineNumber]
|
||||||
assertContains(versionLine, "<version>${buildOptions.kotlinVersion}</version>")
|
assertContains(versionLine, "<version>${buildOptions.kotlinVersion}</version>")
|
||||||
|
|||||||
+7
-4
@@ -141,7 +141,7 @@ class MppCompositeBuildIT : KGPBaseTest() {
|
|||||||
@GradleTest
|
@GradleTest
|
||||||
fun `test - sample1 - ide dependencies`(gradleVersion: GradleVersion) {
|
fun `test - sample1 - ide dependencies`(gradleVersion: GradleVersion) {
|
||||||
project("mpp-composite-build/sample1", gradleVersion) {
|
project("mpp-composite-build/sample1", gradleVersion) {
|
||||||
projectPath.resolve("included-build").addDefaultBuildFiles()
|
projectPath.resolve("included-build").addDefaultSettingsToSettingsGradle()
|
||||||
buildGradleKts.replaceText("<kgp_version>", KOTLIN_VERSION)
|
buildGradleKts.replaceText("<kgp_version>", KOTLIN_VERSION)
|
||||||
projectPath.resolve("included-build/build.gradle.kts").replaceText("<kgp_version>", KOTLIN_VERSION)
|
projectPath.resolve("included-build/build.gradle.kts").replaceText("<kgp_version>", KOTLIN_VERSION)
|
||||||
|
|
||||||
@@ -167,8 +167,11 @@ class MppCompositeBuildIT : KGPBaseTest() {
|
|||||||
|
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun `test - sample1 - assemble and execute`(gradleVersion: GradleVersion) {
|
fun `test - sample1 - assemble and execute`(gradleVersion: GradleVersion) {
|
||||||
project("mpp-composite-build/sample1", gradleVersion) {
|
project(
|
||||||
projectPath.resolve("included-build").addDefaultBuildFiles()
|
"mpp-composite-build/sample1",
|
||||||
|
gradleVersion,
|
||||||
|
) {
|
||||||
|
projectPath.resolve("included-build").addDefaultSettingsToSettingsGradle()
|
||||||
buildGradleKts.replaceText("<kgp_version>", KOTLIN_VERSION)
|
buildGradleKts.replaceText("<kgp_version>", KOTLIN_VERSION)
|
||||||
projectPath.resolve("included-build/build.gradle.kts").replaceText("<kgp_version>", KOTLIN_VERSION)
|
projectPath.resolve("included-build/build.gradle.kts").replaceText("<kgp_version>", KOTLIN_VERSION)
|
||||||
|
|
||||||
@@ -200,7 +203,7 @@ class MppCompositeBuildIT : KGPBaseTest() {
|
|||||||
reason = "KGP 1.7.21 produces deprecation warnings with Gradle 8.4"
|
reason = "KGP 1.7.21 produces deprecation warnings with Gradle 8.4"
|
||||||
) { gradleVersion >= GradleVersion.version(TestVersions.Gradle.G_8_4) }
|
) { gradleVersion >= GradleVersion.version(TestVersions.Gradle.G_8_4) }
|
||||||
) {
|
) {
|
||||||
projectPath.resolve("included-build").addDefaultBuildFiles()
|
projectPath.resolve("included-build").addDefaultSettingsToSettingsGradle()
|
||||||
buildGradleKts.replaceText("<kgp_version>", KOTLIN_VERSION)
|
buildGradleKts.replaceText("<kgp_version>", KOTLIN_VERSION)
|
||||||
projectPath.resolve("included-build/build.gradle.kts").replaceText("<kgp_version>", "1.7.21")
|
projectPath.resolve("included-build/build.gradle.kts").replaceText("<kgp_version>", "1.7.21")
|
||||||
|
|
||||||
|
|||||||
+10
-2
@@ -82,9 +82,17 @@ class PreHmppDependenciesDeprecationIT : KGPBaseTest() {
|
|||||||
tempDir: Path? = null,
|
tempDir: Path? = null,
|
||||||
projectPathToCheck: String = "", // empty means rootProject
|
projectPathToCheck: String = "", // empty means rootProject
|
||||||
expectReportForDependency: String? = null,
|
expectReportForDependency: String? = null,
|
||||||
preBuildAction: TestProject.() -> Unit = {}
|
preBuildAction: TestProject.() -> Unit = {},
|
||||||
) {
|
) {
|
||||||
project("preHmppDependenciesDeprecation/$projectName", gradleVersion, localRepoDir = tempDir?.resolve("repo")) {
|
project(
|
||||||
|
"preHmppDependenciesDeprecation/$projectName", gradleVersion,
|
||||||
|
localRepoDir = tempDir?.resolve("repo"),
|
||||||
|
buildOptions = defaultBuildOptions.copy(
|
||||||
|
nativeOptions = defaultBuildOptions.nativeOptions.copy(
|
||||||
|
distributionDownloadFromMaven = false // TODO(Dmitrii Krasnov): this flag is off, because we try to find configuration which is not in maven yet. Could be set to true after KTI-1569 is done
|
||||||
|
)
|
||||||
|
)
|
||||||
|
) {
|
||||||
preBuildAction()
|
preBuildAction()
|
||||||
suppressDependencySourcesConfigurations()
|
suppressDependencySourcesConfigurations()
|
||||||
build("$projectPathToCheck:dependencies") {
|
build("$projectPathToCheck:dependencies") {
|
||||||
|
|||||||
+22
-4
@@ -407,7 +407,11 @@ class GeneralNativeIT : KGPBaseTest() {
|
|||||||
@DisplayName("Transitive export is not required for exporting variant")
|
@DisplayName("Transitive export is not required for exporting variant")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testTransitiveExportIsNotRequiredForExportingVariant(gradleVersion: GradleVersion) {
|
fun testTransitiveExportIsNotRequiredForExportingVariant(gradleVersion: GradleVersion) {
|
||||||
project("native-binaries/export-published-lib", gradleVersion) {
|
project(
|
||||||
|
"native-binaries/export-published-lib",
|
||||||
|
gradleVersion,
|
||||||
|
localRepoDir = defaultLocalRepo(gradleVersion)
|
||||||
|
) {
|
||||||
val headerPath = "shared/build/bin/linuxX64/debugStatic/libshared_api.h"
|
val headerPath = "shared/build/bin/linuxX64/debugStatic/libshared_api.h"
|
||||||
|
|
||||||
build(":lib:publish")
|
build(":lib:publish")
|
||||||
@@ -802,7 +806,11 @@ class GeneralNativeIT : KGPBaseTest() {
|
|||||||
@DisplayName("Checks builds with cinterop tool")
|
@DisplayName("Checks builds with cinterop tool")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testCinterop(gradleVersion: GradleVersion) {
|
fun testCinterop(gradleVersion: GradleVersion) {
|
||||||
nativeProject("native-cinterop", gradleVersion, configureSubProjects = true) {
|
nativeProject(
|
||||||
|
"native-cinterop",
|
||||||
|
gradleVersion, configureSubProjects = true,
|
||||||
|
localRepoDir = defaultLocalRepo(gradleVersion)
|
||||||
|
) {
|
||||||
fun libraryFiles(projectName: String, cinteropName: String) = listOf(
|
fun libraryFiles(projectName: String, cinteropName: String) = listOf(
|
||||||
projectPath.resolve("$projectName/build/classes/kotlin/host/main/cinterop/${projectName}-cinterop-$cinteropName.klib"),
|
projectPath.resolve("$projectName/build/classes/kotlin/host/main/cinterop/${projectName}-cinterop-$cinteropName.klib"),
|
||||||
projectPath.resolve("$projectName/build/classes/kotlin/host/main/klib/${projectName}.klib"),
|
projectPath.resolve("$projectName/build/classes/kotlin/host/main/klib/${projectName}.klib"),
|
||||||
@@ -969,7 +977,11 @@ class GeneralNativeIT : KGPBaseTest() {
|
|||||||
@DisplayName("Checks citerop configuration variant aware resolution")
|
@DisplayName("Checks citerop configuration variant aware resolution")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testCinteropConfigurationsVariantAwareResolution(gradleVersion: GradleVersion) {
|
fun testCinteropConfigurationsVariantAwareResolution(gradleVersion: GradleVersion) {
|
||||||
nativeProject("native-cinterop", gradleVersion, configureSubProjects = true) {
|
nativeProject(
|
||||||
|
"native-cinterop",
|
||||||
|
gradleVersion, configureSubProjects = true,
|
||||||
|
localRepoDir = defaultLocalRepo(gradleVersion)
|
||||||
|
) {
|
||||||
build(":publishedLibrary:publish")
|
build(":publishedLibrary:publish")
|
||||||
|
|
||||||
build(":dependencyInsight", "--configuration", "hostTestCInterop", "--dependency", "org.example:publishedLibrary") {
|
build(":dependencyInsight", "--configuration", "hostTestCInterop", "--dependency", "org.example:publishedLibrary") {
|
||||||
@@ -998,7 +1010,10 @@ class GeneralNativeIT : KGPBaseTest() {
|
|||||||
@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_0)
|
@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_0)
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun shouldAllowToOverrideDownloadUrl(gradleVersion: GradleVersion, @TempDir customKonanDir: Path) {
|
fun shouldAllowToOverrideDownloadUrl(gradleVersion: GradleVersion, @TempDir customKonanDir: Path) {
|
||||||
nativeProject("native-parallel", gradleVersion) {
|
nativeProject(
|
||||||
|
"native-parallel", gradleVersion,
|
||||||
|
dependencyManagement = DependencyManagement.DisabledDependencyManagement
|
||||||
|
) {
|
||||||
gradleProperties.appendText(
|
gradleProperties.appendText(
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -1011,6 +1026,9 @@ class GeneralNativeIT : KGPBaseTest() {
|
|||||||
buildAndFail(
|
buildAndFail(
|
||||||
"build",
|
"build",
|
||||||
buildOptions = defaultBuildOptions.copy(
|
buildOptions = defaultBuildOptions.copy(
|
||||||
|
nativeOptions = defaultBuildOptions.nativeOptions.copy(
|
||||||
|
distributionDownloadFromMaven = false // please remove this test, when this flag will be removed
|
||||||
|
),
|
||||||
konanDataDir = customKonanDir.toAbsolutePath()
|
konanDataDir = customKonanDir.toAbsolutePath()
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
|||||||
+5
-2
@@ -38,8 +38,11 @@ class NativeDownloadAndPlatformLibsNonParallelIT : KGPDaemonsBaseTest() {
|
|||||||
|
|
||||||
val userHomeDir = System.getProperty("user.home")
|
val userHomeDir = System.getProperty("user.home")
|
||||||
platformLibrariesProject("linuxX64", gradleVersion = gradleVersion) {
|
platformLibrariesProject("linuxX64", gradleVersion = gradleVersion) {
|
||||||
build("assemble", buildOptions = defaultBuildOptions.copy(konanDataDir = null)) {
|
build(
|
||||||
assertOutputContains("Kotlin/Native distribution: .*kotlin-native-prebuilt-$platformName".toRegex())
|
"assemble",
|
||||||
|
buildOptions = defaultBuildOptions.copy(konanDataDir = null) // we need to download konan bundle to default dir
|
||||||
|
) {
|
||||||
|
assertOutputContains("Moved Kotlin/Native bundle from .* to $userHomeDir/.konan/kotlin-native-prebuilt-$platformName-$currentCompilerVersion".toRegex())
|
||||||
assertOutputDoesNotContain("Generate platform libraries for ")
|
assertOutputDoesNotContain("Generate platform libraries for ")
|
||||||
|
|
||||||
// checking that konan was downloaded and native dependencies were not downloaded into ~/.konan dir
|
// checking that konan was downloaded and native dependencies were not downloaded into ~/.konan dir
|
||||||
|
|||||||
+9
-2
@@ -23,10 +23,17 @@ class NativeWithConfigurationCacheIT : KGPBaseTest() {
|
|||||||
@GradleTest
|
@GradleTest
|
||||||
fun testConfigurationCacheReusedSecondTime(gradleVersion: GradleVersion) {
|
fun testConfigurationCacheReusedSecondTime(gradleVersion: GradleVersion) {
|
||||||
nativeProject(
|
nativeProject(
|
||||||
"native-with-configuration-cache", gradleVersion, buildOptions = defaultBuildOptions.withBundledKotlinNative().copy(
|
"native-with-configuration-cache",
|
||||||
|
gradleVersion,
|
||||||
|
dependencyManagement = DependencyManagement.DisabledDependencyManagement,
|
||||||
|
buildOptions = defaultBuildOptions.copy(
|
||||||
// We need to download compiler on the first build, that is why we are setting custom konan home dir without any compiler inside
|
// We need to download compiler on the first build, that is why we are setting custom konan home dir without any compiler inside
|
||||||
konanDataDir = workingDir.resolve(".konan"),
|
konanDataDir = workingDir.resolve(".konan"),
|
||||||
)
|
nativeOptions = defaultBuildOptions.nativeOptions.copy(
|
||||||
|
version = null,
|
||||||
|
distributionDownloadFromMaven = false, // please, remove the whole test, when this flag will be removed
|
||||||
|
),
|
||||||
|
),
|
||||||
) {
|
) {
|
||||||
build(
|
build(
|
||||||
"help"
|
"help"
|
||||||
|
|||||||
+2
-4
@@ -55,7 +55,7 @@ data class BuildOptions(
|
|||||||
val runViaBuildToolsApi: Boolean? = null,
|
val runViaBuildToolsApi: Boolean? = null,
|
||||||
val konanDataDir: Path? = konanDir, // null can be used only if you are using custom 'kotlin.native.home' or 'org.jetbrains.kotlin.native.home' property instead of konanDir
|
val konanDataDir: Path? = konanDir, // null can be used only if you are using custom 'kotlin.native.home' or 'org.jetbrains.kotlin.native.home' property instead of konanDir
|
||||||
val kotlinUserHome: Path? = testKitDir.resolve(".kotlin"),
|
val kotlinUserHome: Path? = testKitDir.resolve(".kotlin"),
|
||||||
val compilerArgumentsLogLevel: String? = "info"
|
val compilerArgumentsLogLevel: String? = "info",
|
||||||
) {
|
) {
|
||||||
val isK2ByDefault
|
val isK2ByDefault
|
||||||
get() = KotlinVersion.DEFAULT >= KotlinVersion.KOTLIN_2_0
|
get() = KotlinVersion.DEFAULT >= KotlinVersion.KOTLIN_2_0
|
||||||
@@ -90,8 +90,7 @@ data class BuildOptions(
|
|||||||
val cocoapodsConfiguration: String? = null,
|
val cocoapodsConfiguration: String? = null,
|
||||||
val cocoapodsArchs: String? = null,
|
val cocoapodsArchs: String? = null,
|
||||||
val distributionType: String? = null,
|
val distributionType: String? = null,
|
||||||
// TODO(Dmitrii Krasnov): we can change false on null, when downloading konan from maven local will be possible KT-63198
|
val distributionDownloadFromMaven: Boolean? = true,
|
||||||
val distributionDownloadFromMaven: Boolean? = false,
|
|
||||||
val reinstall: Boolean? = null,
|
val reinstall: Boolean? = null,
|
||||||
val restrictedDistribution: Boolean? = null,
|
val restrictedDistribution: Boolean? = null,
|
||||||
val useXcodeMessageStyle: Boolean? = null,
|
val useXcodeMessageStyle: Boolean? = null,
|
||||||
@@ -286,7 +285,6 @@ data class BuildOptions(
|
|||||||
nativeOptions.incremental?.let {
|
nativeOptions.incremental?.let {
|
||||||
arguments.add("-Pkotlin.incremental.native=${it}")
|
arguments.add("-Pkotlin.incremental.native=${it}")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+127
@@ -5,7 +5,10 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.testbase
|
package org.jetbrains.kotlin.gradle.testbase
|
||||||
|
|
||||||
|
import org.gradle.api.initialization.resolve.RepositoriesMode
|
||||||
import org.intellij.lang.annotations.Language
|
import org.intellij.lang.annotations.Language
|
||||||
|
import java.nio.file.Path
|
||||||
|
import kotlin.io.path.absolutePathString
|
||||||
|
|
||||||
@Language("Groovy")
|
@Language("Groovy")
|
||||||
internal val DEFAULT_GROOVY_SETTINGS_FILE =
|
internal val DEFAULT_GROOVY_SETTINGS_FILE =
|
||||||
@@ -64,6 +67,64 @@ internal val DEFAULT_GROOVY_SETTINGS_FILE =
|
|||||||
}
|
}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
|
|
||||||
|
internal fun getGroovyDependencyManagementBlock(
|
||||||
|
gradleRepositoriesMode: RepositoriesMode,
|
||||||
|
additionalDependencyRepositories: Set<String>,
|
||||||
|
localRepo: Path? = null,
|
||||||
|
): String =
|
||||||
|
//language=Groovy
|
||||||
|
"""
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
google()
|
||||||
|
ivy {
|
||||||
|
url = "https://download.jetbrains.com/kotlin/native/builds/dev"
|
||||||
|
patternLayout {
|
||||||
|
artifact("[revision]/[classifier]/[artifact]-[classifier]-[revision].[ext]")
|
||||||
|
}
|
||||||
|
metadataSources {
|
||||||
|
artifact()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
url "https://packages.jetbrains.team/maven/p/ij/intellij-dependencies/"
|
||||||
|
}
|
||||||
|
ivy {
|
||||||
|
url = "https://github.com/yarnpkg/yarn/releases/download"
|
||||||
|
|
||||||
|
patternLayout {
|
||||||
|
artifact("v[revision]/[artifact](-v[revision]).[ext]")
|
||||||
|
}
|
||||||
|
metadataSources {
|
||||||
|
artifact()
|
||||||
|
}
|
||||||
|
content {
|
||||||
|
includeModule("com.yarnpkg", "yarn")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ivy {
|
||||||
|
url = "https://nodejs.org/dist"
|
||||||
|
|
||||||
|
patternLayout {
|
||||||
|
artifact("v[revision]/[artifact](-v[revision]-[classifier]).[ext]")
|
||||||
|
}
|
||||||
|
metadataSources {
|
||||||
|
artifact()
|
||||||
|
}
|
||||||
|
content {
|
||||||
|
includeModule("org.nodejs", "node")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
${additionalDependencyRepositories.map { repo -> "maven{ url = \"$repo\" }" }.joinToString("\n")}
|
||||||
|
${localRepo?.absolutePathString()?.let { repo -> "maven{ url = \"${repo.replace("\\", "\\\\")}\" }" } ?: ""}
|
||||||
|
}
|
||||||
|
repositoriesMode.set(${mapRepositoryModeToString(gradleRepositoriesMode)})
|
||||||
|
}
|
||||||
|
""".trimIndent()
|
||||||
|
|
||||||
@Language("kts")
|
@Language("kts")
|
||||||
internal val DEFAULT_KOTLIN_SETTINGS_FILE =
|
internal val DEFAULT_KOTLIN_SETTINGS_FILE =
|
||||||
"""
|
"""
|
||||||
@@ -123,3 +184,69 @@ internal val DEFAULT_KOTLIN_SETTINGS_FILE =
|
|||||||
id("org.jetbrains.kotlin.test.gradle-warnings-detector")
|
id("org.jetbrains.kotlin.test.gradle-warnings-detector")
|
||||||
}
|
}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
|
internal fun getKotlinDependencyManagementBlock(
|
||||||
|
gradleRepositoriesMode: RepositoriesMode,
|
||||||
|
additionalDependencyRepositories: Set<String>,
|
||||||
|
localRepo: Path? = null,
|
||||||
|
): String =
|
||||||
|
//language=kotlin
|
||||||
|
"""
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
google()
|
||||||
|
ivy {
|
||||||
|
url = uri("https://download.jetbrains.com/kotlin/native/builds/dev")
|
||||||
|
patternLayout {
|
||||||
|
artifact("[revision]/[classifier]/[artifact]-[classifier]-[revision].[ext]")
|
||||||
|
}
|
||||||
|
metadataSources {
|
||||||
|
artifact()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ivy {
|
||||||
|
url = uri("https://github.com/yarnpkg/yarn/releases/download")
|
||||||
|
|
||||||
|
patternLayout {
|
||||||
|
artifact("v[revision]/[artifact](-v[revision]).[ext]")
|
||||||
|
}
|
||||||
|
metadataSources {
|
||||||
|
artifact()
|
||||||
|
}
|
||||||
|
content {
|
||||||
|
includeModule("com.yarnpkg", "yarn")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ivy {
|
||||||
|
url = uri("https://nodejs.org/dist")
|
||||||
|
|
||||||
|
patternLayout {
|
||||||
|
artifact("v[revision]/[artifact](-v[revision]-[classifier]).[ext]")
|
||||||
|
}
|
||||||
|
metadataSources {
|
||||||
|
artifact()
|
||||||
|
}
|
||||||
|
content {
|
||||||
|
includeModule("org.nodejs", "node")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
url = uri("https://packages.jetbrains.team/maven/p/ij/intellij-dependencies/")
|
||||||
|
}
|
||||||
|
${additionalDependencyRepositories.map { repo -> "maven{ url = uri(\"$repo\") }" }.joinToString("\n")}
|
||||||
|
${localRepo?.absolutePathString()?.let { repo -> "maven{ url = uri(\"${repo.replace("\\", "\\\\")}\") }" } ?: ""}
|
||||||
|
}
|
||||||
|
repositoriesMode.set(${mapRepositoryModeToString(gradleRepositoriesMode)})
|
||||||
|
}
|
||||||
|
""".trimIndent()
|
||||||
|
|
||||||
|
|
||||||
|
private fun mapRepositoryModeToString(gradleRepositoriesMode: RepositoriesMode): String {
|
||||||
|
return when (gradleRepositoriesMode) {
|
||||||
|
RepositoriesMode.PREFER_PROJECT -> "RepositoriesMode.PREFER_PROJECT"
|
||||||
|
RepositoriesMode.PREFER_SETTINGS -> "RepositoriesMode.PREFER_SETTINGS"
|
||||||
|
RepositoriesMode.FAIL_ON_PROJECT_REPOS -> "RepositoriesMode.FAIL_ON_PROJECT_REPOS"
|
||||||
|
}
|
||||||
|
}
|
||||||
+114
-6
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.testbase
|
package org.jetbrains.kotlin.gradle.testbase
|
||||||
|
|
||||||
|
import org.gradle.api.initialization.resolve.RepositoriesMode
|
||||||
import org.gradle.api.logging.configuration.WarningMode
|
import org.gradle.api.logging.configuration.WarningMode
|
||||||
import org.gradle.testkit.runner.BuildResult
|
import org.gradle.testkit.runner.BuildResult
|
||||||
import org.gradle.testkit.runner.GradleRunner
|
import org.gradle.testkit.runner.GradleRunner
|
||||||
@@ -50,6 +51,7 @@ fun KGPBaseTest.project(
|
|||||||
buildJdk: File? = null,
|
buildJdk: File? = null,
|
||||||
localRepoDir: Path? = null,
|
localRepoDir: Path? = null,
|
||||||
environmentVariables: EnvironmentalVariables = EnvironmentalVariables(),
|
environmentVariables: EnvironmentalVariables = EnvironmentalVariables(),
|
||||||
|
dependencyManagement: DependencyManagement = DependencyManagement.DefaultDependencyManagement(),
|
||||||
test: TestProject.() -> Unit = {},
|
test: TestProject.() -> Unit = {},
|
||||||
): TestProject {
|
): TestProject {
|
||||||
val projectPath = setupProjectFromTestResources(
|
val projectPath = setupProjectFromTestResources(
|
||||||
@@ -58,7 +60,7 @@ fun KGPBaseTest.project(
|
|||||||
workingDir,
|
workingDir,
|
||||||
projectPathAdditionalSuffix,
|
projectPathAdditionalSuffix,
|
||||||
)
|
)
|
||||||
projectPath.addDefaultBuildFiles()
|
projectPath.addDefaultSettingsToSettingsGradle(dependencyManagement, localRepoDir)
|
||||||
projectPath.enableCacheRedirector()
|
projectPath.enableCacheRedirector()
|
||||||
projectPath.enableAndroidSdk()
|
projectPath.enableAndroidSdk()
|
||||||
if (buildOptions.languageVersion != null || buildOptions.languageApiVersion != null) {
|
if (buildOptions.languageVersion != null || buildOptions.languageApiVersion != null) {
|
||||||
@@ -121,6 +123,7 @@ fun KGPBaseTest.nativeProject(
|
|||||||
localRepoDir: Path? = null,
|
localRepoDir: Path? = null,
|
||||||
environmentVariables: EnvironmentalVariables = EnvironmentalVariables(),
|
environmentVariables: EnvironmentalVariables = EnvironmentalVariables(),
|
||||||
configureSubProjects: Boolean = false,
|
configureSubProjects: Boolean = false,
|
||||||
|
dependencyManagement: DependencyManagement = DependencyManagement.DefaultDependencyManagement(),
|
||||||
test: TestProject.() -> Unit = {},
|
test: TestProject.() -> Unit = {},
|
||||||
): TestProject {
|
): TestProject {
|
||||||
val project = project(
|
val project = project(
|
||||||
@@ -129,6 +132,7 @@ fun KGPBaseTest.nativeProject(
|
|||||||
buildOptions = buildOptions,
|
buildOptions = buildOptions,
|
||||||
forceOutput = forceOutput,
|
forceOutput = forceOutput,
|
||||||
enableBuildScan = enableBuildScan,
|
enableBuildScan = enableBuildScan,
|
||||||
|
dependencyManagement = dependencyManagement,
|
||||||
addHeapDumpOptions = addHeapDumpOptions,
|
addHeapDumpOptions = addHeapDumpOptions,
|
||||||
enableGradleDebug = enableGradleDebug,
|
enableGradleDebug = enableGradleDebug,
|
||||||
enableKotlinDaemonMemoryLimitInMb = enableKotlinDaemonMemoryLimitInMb,
|
enableKotlinDaemonMemoryLimitInMb = enableKotlinDaemonMemoryLimitInMb,
|
||||||
@@ -323,12 +327,12 @@ open class GradleProject(
|
|||||||
fun classesDir(
|
fun classesDir(
|
||||||
sourceSet: String = "main",
|
sourceSet: String = "main",
|
||||||
targetName: String? = null,
|
targetName: String? = null,
|
||||||
language: String = "kotlin"
|
language: String = "kotlin",
|
||||||
): Path = projectPath.resolve("build/classes/$language/${targetName.orEmpty()}/$sourceSet/")
|
): Path = projectPath.resolve("build/classes/$language/${targetName.orEmpty()}/$sourceSet/")
|
||||||
|
|
||||||
fun kotlinClassesDir(
|
fun kotlinClassesDir(
|
||||||
sourceSet: String = "main",
|
sourceSet: String = "main",
|
||||||
targetName: String? = null
|
targetName: String? = null,
|
||||||
): Path = classesDir(sourceSet, targetName, language = "kotlin")
|
): Path = classesDir(sourceSet, targetName, language = "kotlin")
|
||||||
|
|
||||||
fun javaClassesDir(
|
fun javaClassesDir(
|
||||||
@@ -353,7 +357,8 @@ open class GradleProject(
|
|||||||
*/
|
*/
|
||||||
@JvmInline
|
@JvmInline
|
||||||
value class EnvironmentalVariables @EnvironmentalVariablesOverride constructor(val environmentalVariables: Map<String, String> = emptyMap()) {
|
value class EnvironmentalVariables @EnvironmentalVariablesOverride constructor(val environmentalVariables: Map<String, String> = emptyMap()) {
|
||||||
@EnvironmentalVariablesOverride constructor(vararg environmentVariables: Pair<String, String>) : this(mapOf(*environmentVariables))
|
@EnvironmentalVariablesOverride
|
||||||
|
constructor(vararg environmentVariables: Pair<String, String>) : this(mapOf(*environmentVariables))
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresOptIn("Environmental variables override may lead to interference of parallel builds and breaks Gradle tests debugging")
|
@RequiresOptIn("Environmental variables override may lead to interference of parallel builds and breaks Gradle tests debugging")
|
||||||
@@ -416,7 +421,7 @@ class TestProject(
|
|||||||
val otherProjectPath = "$pathPrefix/$otherProjectName".testProjectPath
|
val otherProjectPath = "$pathPrefix/$otherProjectName".testProjectPath
|
||||||
otherProjectPath.copyRecursively(projectPath.resolve(otherProjectName))
|
otherProjectPath.copyRecursively(projectPath.resolve(otherProjectName))
|
||||||
|
|
||||||
projectPath.resolve(otherProjectName).addDefaultBuildFiles()
|
projectPath.resolve(otherProjectName).addDefaultSettingsToSettingsGradle()
|
||||||
|
|
||||||
settingsGradle.append(
|
settingsGradle.append(
|
||||||
"""
|
"""
|
||||||
@@ -523,12 +528,29 @@ private fun setupProjectFromTestResources(
|
|||||||
|
|
||||||
private val String.testProjectPath: Path get() = Paths.get("src", "test", "resources", "testProject", this)
|
private val String.testProjectPath: Path get() = Paths.get("src", "test", "resources", "testProject", this)
|
||||||
|
|
||||||
internal fun Path.addDefaultBuildFiles() {
|
internal fun Path.addDefaultSettingsToSettingsGradle(
|
||||||
|
dependencyManagement: DependencyManagement = DependencyManagement.DefaultDependencyManagement(),
|
||||||
|
localRepo: Path? = null,
|
||||||
|
) {
|
||||||
addPluginManagementToSettings()
|
addPluginManagementToSettings()
|
||||||
|
when (dependencyManagement) {
|
||||||
|
is DependencyManagement.DefaultDependencyManagement -> addDependencyManagementToSettings(
|
||||||
|
additionalDependencyRepositories = dependencyManagement.additionalRepos,
|
||||||
|
localRepo = localRepo
|
||||||
|
)
|
||||||
|
is DependencyManagement.DisabledDependencyManagement -> {}
|
||||||
|
}
|
||||||
|
|
||||||
val buildSrc = resolve("buildSrc")
|
val buildSrc = resolve("buildSrc")
|
||||||
if (Files.exists(buildSrc)) {
|
if (Files.exists(buildSrc)) {
|
||||||
buildSrc.addPluginManagementToSettings()
|
buildSrc.addPluginManagementToSettings()
|
||||||
|
when (dependencyManagement) {
|
||||||
|
is DependencyManagement.DefaultDependencyManagement -> buildSrc.addDependencyManagementToSettings(
|
||||||
|
additionalDependencyRepositories = dependencyManagement.additionalRepos,
|
||||||
|
localRepo = localRepo
|
||||||
|
)
|
||||||
|
is DependencyManagement.DisabledDependencyManagement -> {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -574,6 +596,79 @@ internal fun Path.addPluginManagementToSettings() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
internal fun Path.addDependencyManagementToSettings(
|
||||||
|
gradleRepositoriesMode: RepositoriesMode = RepositoriesMode.PREFER_SETTINGS,
|
||||||
|
additionalDependencyRepositories: Set<String>,
|
||||||
|
localRepo: Path? = null,
|
||||||
|
) {
|
||||||
|
val buildGradle = resolve("build.gradle")
|
||||||
|
val buildGradleKts = resolve("build.gradle.kts")
|
||||||
|
val settingsGradle = resolve("settings.gradle")
|
||||||
|
val settingsGradleKts = resolve("settings.gradle.kts")
|
||||||
|
when {
|
||||||
|
Files.exists(settingsGradle) -> settingsGradle.modify {
|
||||||
|
if (!it.contains("dependencyManagement {")) {
|
||||||
|
"""
|
||||||
|
|$it
|
||||||
|
|
|
||||||
|
|${
|
||||||
|
getGroovyDependencyManagementBlock(
|
||||||
|
gradleRepositoriesMode,
|
||||||
|
additionalDependencyRepositories,
|
||||||
|
localRepo
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|""".trimMargin()
|
||||||
|
} else {
|
||||||
|
it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Files.exists(settingsGradleKts) -> settingsGradleKts.modify {
|
||||||
|
if (!it.contains("dependencyManagement {")) {
|
||||||
|
"""
|
||||||
|
|$it
|
||||||
|
|
|
||||||
|
|${
|
||||||
|
getKotlinDependencyManagementBlock(
|
||||||
|
gradleRepositoriesMode,
|
||||||
|
additionalDependencyRepositories,
|
||||||
|
localRepo
|
||||||
|
)
|
||||||
|
}
|
||||||
|
""".trimMargin()
|
||||||
|
} else {
|
||||||
|
it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Files.exists(buildGradle) -> settingsGradle.toFile()
|
||||||
|
.writeText(
|
||||||
|
getGroovyDependencyManagementBlock(
|
||||||
|
gradleRepositoriesMode,
|
||||||
|
additionalDependencyRepositories,
|
||||||
|
localRepo
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
Files.exists(buildGradleKts) -> settingsGradleKts.toFile()
|
||||||
|
.writeText(
|
||||||
|
getKotlinDependencyManagementBlock(
|
||||||
|
gradleRepositoriesMode,
|
||||||
|
additionalDependencyRepositories,
|
||||||
|
localRepo
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
else -> error("No build-file or settings file found")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Files.exists(resolve("buildSrc"))) {
|
||||||
|
resolve("buildSrc").addDependencyManagementToSettings(gradleRepositoriesMode, additionalDependencyRepositories, localRepo)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun TestProject.agreeToBuildScanService() {
|
private fun TestProject.agreeToBuildScanService() {
|
||||||
val settingsFile = if (Files.exists(settingsGradle)) settingsGradle else settingsGradleKts
|
val settingsFile = if (Files.exists(settingsGradle)) settingsGradle else settingsGradleKts
|
||||||
settingsFile.append(
|
settingsFile.append(
|
||||||
@@ -774,3 +869,16 @@ internal fun TestProject.suppressDependencySourcesConfigurations() {
|
|||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents different types of dependency management provided to tests.
|
||||||
|
*/
|
||||||
|
sealed interface DependencyManagement {
|
||||||
|
class DefaultDependencyManagement(val additionalRepos: Set<String> = emptySet()) : DependencyManagement
|
||||||
|
data object DisabledDependencyManagement : DependencyManagement
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves the temporary local repository path for the test with specified Gradle version.
|
||||||
|
*/
|
||||||
|
fun KGPBaseTest.defaultLocalRepo(gradleVersion: GradleVersion) = workingDir.resolve(gradleVersion.version).resolve("repo")
|
||||||
-7
@@ -36,10 +36,3 @@ android {
|
|||||||
main.java.srcDirs += 'src/main/kotlin'
|
main.java.srcDirs += 'src/main/kotlin'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
maven { url 'https://maven.google.com' }
|
|
||||||
mavenCentral()
|
|
||||||
maven { url "https://clojars.org/repo/" }
|
|
||||||
}
|
|
||||||
-9
@@ -1,13 +1,4 @@
|
|||||||
allprojects {
|
allprojects {
|
||||||
group = "a"
|
group = "a"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
maven {
|
|
||||||
name = "build"
|
|
||||||
url = rootProject.buildDir.resolve("repo").toURI()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ publishing {
|
|||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
name = "build"
|
name = "build"
|
||||||
url = rootProject.buildDir.resolve("repo").toURI()
|
url = uri("<localRepo>")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-6
@@ -6,12 +6,6 @@ plugins {
|
|||||||
kotlin("multiplatform")
|
kotlin("multiplatform")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
maven(project(":producer").layout.buildDirectory.dir("repo"))
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
linuxArm64()
|
linuxArm64()
|
||||||
linuxX64()
|
linuxX64()
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ group = "org.jetbrains.sample"
|
|||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
repositories {
|
repositories {
|
||||||
maven(buildDir.resolve("repo"))
|
maven("<localRepo>")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-7
@@ -5,13 +5,6 @@ plugins {
|
|||||||
kotlin("multiplatform")
|
kotlin("multiplatform")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
val thirdPartyRepo: String by project
|
|
||||||
maven(thirdPartyRepo)
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
val commonMain by getting {
|
val commonMain by getting {
|
||||||
|
|||||||
-8
@@ -1,11 +1,3 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform").apply(false)
|
kotlin("multiplatform").apply(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
maven("<localRepo>")
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-5
@@ -2,11 +2,6 @@ plugins {
|
|||||||
kotlin("multiplatform")
|
kotlin("multiplatform")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "com.example.app"
|
group = "com.example.app"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
|
|||||||
-5
@@ -3,11 +3,6 @@ plugins {
|
|||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "com.example.bar"
|
group = "com.example.bar"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
|
|||||||
-5
@@ -3,11 +3,6 @@ plugins {
|
|||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "com.example.foo"
|
group = "com.example.foo"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
|
|||||||
-5
@@ -3,11 +3,6 @@ plugins {
|
|||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "com.example.thirdparty"
|
group = "com.example.thirdparty"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
|
|||||||
-6
@@ -2,12 +2,6 @@ plugins {
|
|||||||
kotlin("multiplatform")
|
kotlin("multiplatform")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
maven("<localRepo>")
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "com.example.app"
|
group = "com.example.app"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
|
|||||||
-6
@@ -3,12 +3,6 @@ plugins {
|
|||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
maven("<localRepo>")
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "com.example.bar"
|
group = "com.example.bar"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
|
|||||||
-6
@@ -3,12 +3,6 @@ plugins {
|
|||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
maven("<localRepo>")
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "com.example.foo"
|
group = "com.example.foo"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
|
|||||||
-6
@@ -3,12 +3,6 @@ plugins {
|
|||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
maven("<localRepo>")
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "com.example.foo"
|
group = "com.example.foo"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
|
|||||||
-9
@@ -9,12 +9,3 @@ buildscript {
|
|||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
google()
|
|
||||||
mavenCentral()
|
|
||||||
maven { url "https://jitpack.io" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-7
@@ -1,7 +1 @@
|
|||||||
allprojects {
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
maven { url 'https://jitpack.io' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
-6
@@ -8,12 +8,6 @@ plugins {
|
|||||||
application
|
application
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
maven("<localRepo>")
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "com.example.serialization_app"
|
group = "com.example.serialization_app"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -20,6 +20,6 @@ kotlin {
|
|||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
repositories {
|
repositories {
|
||||||
maven("$rootDir/../repo")
|
maven("<localRepo>")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-6
@@ -5,12 +5,6 @@ plugins {
|
|||||||
group = "me.user"
|
group = "me.user"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
repositories {
|
|
||||||
maven("$rootDir/../repo")
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
val targets = listOf(
|
val targets = listOf(
|
||||||
jvm(),
|
jvm(),
|
||||||
|
|||||||
-6
@@ -5,12 +5,6 @@ plugins {
|
|||||||
group = "me.user"
|
group = "me.user"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
repositories {
|
|
||||||
maven("$rootDir/../repo")
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
val targets = listOf(
|
val targets = listOf(
|
||||||
jvm(),
|
jvm(),
|
||||||
|
|||||||
-6
@@ -1,6 +0,0 @@
|
|||||||
allprojects {
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
-6
@@ -4,12 +4,6 @@ plugins {
|
|||||||
kotlin("multiplatform")
|
kotlin("multiplatform")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
maven(project(":producer").buildDir.resolve("repository"))
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvm()
|
jvm()
|
||||||
js().browser()
|
js().browser()
|
||||||
|
|||||||
+1
-8
@@ -5,11 +5,6 @@ plugins {
|
|||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvm()
|
jvm()
|
||||||
js().browser()
|
js().browser()
|
||||||
@@ -52,8 +47,6 @@ version = "1.0.0"
|
|||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
repositories {
|
repositories {
|
||||||
maven(buildDir.resolve("repository")) {
|
maven("<localRepo>")
|
||||||
name = "build"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -15,7 +15,7 @@ publishing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven(rootDir.resolve("repo"))
|
maven("<localRepo>")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-6
@@ -2,12 +2,6 @@ plugins {
|
|||||||
kotlin("multiplatform")
|
kotlin("multiplatform")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
maven(rootDir.resolve("repo"))
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvm()
|
jvm()
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ publishing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven(rootDir.resolve("repo"))
|
maven("<localRepo>")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-6
@@ -1,10 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("org.jetbrains.kotlin.multiplatform").version("<kgp_version>")
|
id("org.jetbrains.kotlin.multiplatform")
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
-5
@@ -6,11 +6,6 @@ plugins {
|
|||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
maven("<localRepo>")
|
|
||||||
}
|
|
||||||
|
|
||||||
val disambiguationAttribute = Attribute.of("disambiguationAttribute", String::class.java)
|
val disambiguationAttribute = Attribute.of("disambiguationAttribute", String::class.java)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
-5
@@ -3,11 +3,6 @@ plugins {
|
|||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "test"
|
group = "test"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
|
|||||||
-5
@@ -2,11 +2,6 @@ plugins {
|
|||||||
kotlin("multiplatform")
|
kotlin("multiplatform")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
maven("<localRepo>")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
applyDefaultHierarchyTemplate()
|
applyDefaultHierarchyTemplate()
|
||||||
|
|
||||||
|
|||||||
-7
@@ -1,10 +1,3 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform") apply false
|
kotlin("multiplatform") apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-4
@@ -6,10 +6,6 @@ plugins {
|
|||||||
group = "test"
|
group = "test"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
repositories {
|
|
||||||
maven("<localRepo>")
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
applyDefaultHierarchyTemplate()
|
applyDefaultHierarchyTemplate()
|
||||||
|
|
||||||
|
|||||||
+1
-7
@@ -3,12 +3,6 @@ plugins {
|
|||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
maven("../repo")
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "com.example"
|
group = "com.example"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
@@ -19,6 +13,6 @@ kotlin {
|
|||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
repositories {
|
repositories {
|
||||||
maven("../repo")
|
maven("<localRepo>")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-6
@@ -2,12 +2,6 @@ plugins {
|
|||||||
kotlin("multiplatform")
|
kotlin("multiplatform")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
maven("../repo")
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvm()
|
jvm()
|
||||||
linuxX64 {
|
linuxX64 {
|
||||||
|
|||||||
+1
-1
@@ -17,6 +17,6 @@ kotlin {
|
|||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
repositories {
|
repositories {
|
||||||
maven(url = "file://${projectDir.absolutePath.replace('\\', '/')}/../repo")
|
maven("<localRepo>")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-6
@@ -2,12 +2,6 @@ plugins {
|
|||||||
id("org.jetbrains.kotlin.multiplatform")
|
id("org.jetbrains.kotlin.multiplatform")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
maven { url 'repo' }
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
hostMain {
|
hostMain {
|
||||||
|
|||||||
-5
@@ -3,11 +3,6 @@ plugins {
|
|||||||
id("maven-publish")
|
id("maven-publish")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
<SingleNativeTarget>("host") {
|
<SingleNativeTarget>("host") {
|
||||||
compilations.main.cinterops {
|
compilations.main.cinterops {
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ kotlin {
|
|||||||
publishing {
|
publishing {
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
url = '../repo'
|
url = "<localRepo>"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
-6
@@ -2,12 +2,6 @@ plugins {
|
|||||||
id("org.jetbrains.kotlin.multiplatform")
|
id("org.jetbrains.kotlin.multiplatform")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
mavenLocal()
|
|
||||||
maven("<localRepo>")
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
<SingleNativeTarget>("native") {
|
<SingleNativeTarget>("native") {
|
||||||
binaries {
|
binaries {
|
||||||
|
|||||||
-5
@@ -6,11 +6,6 @@ plugins {
|
|||||||
group = "org.sample"
|
group = "org.sample"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
<SingleNativeTarget>("native")
|
<SingleNativeTarget>("native")
|
||||||
}
|
}
|
||||||
|
|||||||
-6
@@ -6,12 +6,6 @@ plugins {
|
|||||||
group = "org.sample"
|
group = "org.sample"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
maven("<localRepo>")
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
<SingleNativeTarget>("native")
|
<SingleNativeTarget>("native")
|
||||||
|
|
||||||
|
|||||||
-5
@@ -2,11 +2,6 @@ plugins {
|
|||||||
id("org.jetbrains.kotlin.multiplatform")
|
id("org.jetbrains.kotlin.multiplatform")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
<SingleNativeTarget>("native") {
|
<SingleNativeTarget>("native") {
|
||||||
binaries {
|
binaries {
|
||||||
|
|||||||
-6
@@ -2,12 +2,6 @@ plugins {
|
|||||||
id("org.jetbrains.kotlin.multiplatform")
|
id("org.jetbrains.kotlin.multiplatform")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
mavenLocal()
|
|
||||||
maven("<localRepo>")
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
<SingleNativeTarget>("native") {
|
<SingleNativeTarget>("native") {
|
||||||
binaries {
|
binaries {
|
||||||
|
|||||||
-5
@@ -6,11 +6,6 @@ plugins {
|
|||||||
group = "org.sample"
|
group = "org.sample"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
<SingleNativeTarget>("native")
|
<SingleNativeTarget>("native")
|
||||||
}
|
}
|
||||||
|
|||||||
-5
@@ -6,11 +6,6 @@ plugins {
|
|||||||
group = "org.sample"
|
group = "org.sample"
|
||||||
version = "2.0"
|
version = "2.0"
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
<SingleNativeTarget>("native")
|
<SingleNativeTarget>("native")
|
||||||
}
|
}
|
||||||
|
|||||||
-5
@@ -6,11 +6,6 @@ plugins {
|
|||||||
group = "org.sample"
|
group = "org.sample"
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
maven("<localRepo>")
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
<SingleNativeTarget>("native")
|
<SingleNativeTarget>("native")
|
||||||
|
|||||||
-6
@@ -2,12 +2,6 @@ plugins {
|
|||||||
kotlin("multiplatform")
|
kotlin("multiplatform")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
mavenLocal()
|
|
||||||
maven("<localRepo>")
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvm()
|
jvm()
|
||||||
linuxX64()
|
linuxX64()
|
||||||
|
|||||||
+7
-2
@@ -25,6 +25,8 @@ import org.jetbrains.kotlin.gradle.utils.property
|
|||||||
import org.jetbrains.kotlin.konan.target.KonanTarget
|
import org.jetbrains.kotlin.konan.target.KonanTarget
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
|
private const val KONAN_DIRECTORY_NAME_TO_CHECK_EXISTENCE = "konan"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a nested provider for all native tasks
|
* This is a nested provider for all native tasks
|
||||||
*/
|
*/
|
||||||
@@ -57,8 +59,11 @@ internal class KotlinNativeProvider(project: Project, konanTarget: KonanTarget)
|
|||||||
kotlinNativeVersion
|
kotlinNativeVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Gradle tries to evaluate this val during configuration cache,
|
||||||
|
// which lead to resolving configuration, even if k/n bundle is in konan home directory.
|
||||||
|
@Transient
|
||||||
private val kotlinNativeCompilerConfiguration: ConfigurableFileCollection = project.filesProvider {
|
private val kotlinNativeCompilerConfiguration: ConfigurableFileCollection = project.filesProvider {
|
||||||
// without enabled there is no configuration with this name, so we should return empty provider to support configuraiton cache
|
// without enabled there is no configuration with this name, so we should return empty provider to support configuration cache
|
||||||
if (project.kotlinNativeToolchainEnabled) {
|
if (project.kotlinNativeToolchainEnabled) {
|
||||||
project.configurations.named(
|
project.configurations.named(
|
||||||
KOTLIN_NATIVE_BUNDLE_CONFIGURATION_NAME
|
KOTLIN_NATIVE_BUNDLE_CONFIGURATION_NAME
|
||||||
@@ -79,7 +84,7 @@ internal class KotlinNativeProvider(project: Project, konanTarget: KonanTarget)
|
|||||||
bundleDir.deleteRecursively()
|
bundleDir.deleteRecursively()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bundleDir.resolve("bin").exists()) {
|
if (!bundleDir.resolve(KONAN_DIRECTORY_NAME_TO_CHECK_EXISTENCE).exists()) {
|
||||||
val gradleCachesKotlinNativeDir =
|
val gradleCachesKotlinNativeDir =
|
||||||
kotlinNativeCompilerConfiguration
|
kotlinNativeCompilerConfiguration
|
||||||
.singleOrNull()
|
.singleOrNull()
|
||||||
|
|||||||
Reference in New Issue
Block a user