[Gradle] Adjust Kotlin2JsCompileArgumentsTest and KotlinCompileArgumentsTest

... after ensuring DependencyClasspath is not resolved
by CompilerArgumentAware

^KTIJ-24724 Verification Pending
This commit is contained in:
Sebastian Sellmair
2023-04-26 18:28:44 +02:00
committed by Space Team
parent 502c3c29cc
commit 9f17f6621b
2 changed files with 20 additions and 2 deletions
@@ -9,6 +9,10 @@ package org.jetbrains.kotlin.gradle.unitTests.compilerArgumetns
import org.jetbrains.kotlin.compilerRunner.ArgumentUtils
import org.jetbrains.kotlin.gradle.dsl.multiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.CreateCompilerArgumentsContext
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerArgumentsProducer
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerArgumentsProducer.ArgumentType.PluginClasspath
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerArgumentsProducer.ArgumentType.Primitive
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerArgumentsProducer.CreateCompilerArgumentsContext.Companion.default
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerArgumentsProducer.CreateCompilerArgumentsContext.Companion.lenient
import org.jetbrains.kotlin.gradle.plugin.KotlinJsCompilerType
@@ -31,7 +35,12 @@ class Kotlin2JsCompileArgumentsTest {
project.evaluate()
val jsMainCompileTask = jsMainCompilation.compileTaskProvider.get()
val argumentsFromCompilerArgumentsProducer = jsMainCompileTask.createCompilerArguments(lenient)
val argumentsFromCompilerArgumentsProducer = jsMainCompileTask.createCompilerArguments(
CreateCompilerArgumentsContext(
includeArgumentTypes = setOf(Primitive, PluginClasspath),
isLenient = true
)
)
@Suppress("DEPRECATION_ERROR")
assertEquals(
@@ -18,6 +18,10 @@ import org.jetbrains.kotlin.gradle.dependencyResolutionTests.mavenCentralCacheRe
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.dsl.kotlinJvmExtension
import org.jetbrains.kotlin.gradle.dsl.multiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.CreateCompilerArgumentsContext
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerArgumentsProducer
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerArgumentsProducer.ArgumentType.PluginClasspath
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerArgumentsProducer.ArgumentType.Primitive
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerArgumentsProducer.CreateCompilerArgumentsContext.Companion.lenient
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.util.assertNotNull
@@ -43,7 +47,12 @@ class KotlinCompileArgumentsTest {
val mainCompilation = kotlin.target.compilations.getByName("main")
val mainCompilationTask = mainCompilation.compileTaskProvider.get() as KotlinCompile
val argumentsFromKotlinCompilerArgumentsAware = mainCompilationTask.createCompilerArguments(lenient)
val argumentsFromKotlinCompilerArgumentsAware = mainCompilationTask.createCompilerArguments(
CreateCompilerArgumentsContext(
includeArgumentTypes = setOf(Primitive, PluginClasspath),
isLenient = true
)
)
@Suppress("DEPRECATION_ERROR")
assertEquals(