[KPM] Ensure local stdlib is resolvable in gradle functionalTest
KT-51386
This commit is contained in:
committed by
Space
parent
1a5fc84080
commit
555db121fa
@@ -10,6 +10,7 @@ project.extensions.getByType<KotlinJvmProjectExtension>().target.compilations {
|
||||
testClassesDirs = output.classesDirs
|
||||
classpath = sourceSets["functionalTest"].runtimeClasspath
|
||||
workingDir = projectDir
|
||||
dependsOnKotlinGradlePluginInstall()
|
||||
}
|
||||
tasks.named("check") {
|
||||
dependsOn(functionalTest)
|
||||
|
||||
+4
-1
@@ -8,6 +8,7 @@
|
||||
package org.jetbrains.kotlin.gradle.kpm.idea
|
||||
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.artifacts.dsl.RepositoryHandler
|
||||
import org.gradle.api.artifacts.verification.DependencyVerificationMode
|
||||
import org.gradle.api.internal.project.ProjectInternal
|
||||
import org.gradle.testfixtures.ProjectBuilder
|
||||
@@ -22,9 +23,11 @@ abstract class AbstractLightweightIdeaDependencyResolutionTest {
|
||||
project.gradle.startParameter.dependencyVerificationMode = DependencyVerificationMode.OFF
|
||||
project.enableDefaultStdlibDependency(false)
|
||||
project.repositories.mavenLocal()
|
||||
project.repositories.maven { it.setUrl("https://cache-redirector.jetbrains.com/maven-central") }
|
||||
project.repositories.mavenCentralCacheRedirector()
|
||||
} as ProjectInternal
|
||||
}
|
||||
|
||||
val Project.konanDistribution get() = KonanDistribution(project.konanHome)
|
||||
}
|
||||
|
||||
fun RepositoryHandler.mavenCentralCacheRedirector() = maven { it.setUrl("https://cache-redirector.jetbrains.com/maven-central") }
|
||||
|
||||
+3
@@ -29,11 +29,14 @@ class IdeaKotlinProjectModelSerializableTest : AbstractKpmExtensionTest() {
|
||||
@Test
|
||||
fun `test - serialize and deserialize - empty project`() {
|
||||
project.evaluate()
|
||||
project.repositories.mavenLocal()
|
||||
assertSerializeAndDeserializeEquals(kotlin.buildIdeaKotlinProjectModel())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test - serialize and deserialize - project with variants and fragments`() {
|
||||
project.evaluate()
|
||||
project.repositories.mavenLocal()
|
||||
kotlin.mainAndTest {
|
||||
val native = fragments.create("native")
|
||||
val apple = fragments.create("apple")
|
||||
|
||||
Reference in New Issue
Block a user