[Gradle] Deprecate HasCompilerOptions
This DSL is not consistent with other DSL to configuring compiler options. ^KT-65568 In Progress
This commit is contained in:
committed by
Space Team
parent
42cba927e6
commit
5df05d5797
+15
@@ -8,13 +8,28 @@ package org.jetbrains.kotlin.gradle.plugin
|
||||
import org.gradle.api.Action
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions
|
||||
|
||||
/**
|
||||
* @suppress
|
||||
*/
|
||||
@Deprecated(
|
||||
message = "Not consistent with other DSL to configure compiler options."
|
||||
)
|
||||
interface HasCompilerOptions<out CO : KotlinCommonCompilerOptions> {
|
||||
/**
|
||||
* @suppress
|
||||
*/
|
||||
val options: CO
|
||||
|
||||
/**
|
||||
* @suppress
|
||||
*/
|
||||
fun configure(configuration: CO.() -> Unit) {
|
||||
configuration(options)
|
||||
}
|
||||
|
||||
/**
|
||||
* @suppress
|
||||
*/
|
||||
fun configure(configuration: Action<@UnsafeVariance CO>) {
|
||||
configuration.execute(options)
|
||||
}
|
||||
|
||||
+1
@@ -59,6 +59,7 @@ interface KotlinCompilation<out T : KotlinCommonOptionsDeprecated> : Named,
|
||||
|
||||
val compileKotlinTaskName: String
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
val compilerOptions: HasCompilerOptions<*>
|
||||
|
||||
@Deprecated(
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION", "OVERRIDE_DEPRECATION")
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package org.jetbrains.kotlin.gradle.android
|
||||
|
||||
|
||||
+2
-2
@@ -31,14 +31,14 @@ internal open class Kotlin2JsPlugin(
|
||||
Kotlin2JsSourceSetProcessor(tasksProvider, KotlinCompilationInfo(compilation))
|
||||
|
||||
override fun apply(project: Project) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
@Suppress("UNCHECKED_CAST", "TYPEALIAS_EXPANSION_DEPRECATION")
|
||||
val target = project.objects.newInstance(
|
||||
KotlinWithJavaTarget::class.java,
|
||||
project,
|
||||
KotlinPlatformType.js,
|
||||
targetName,
|
||||
{
|
||||
object : HasCompilerOptions<KotlinJsCompilerOptions> {
|
||||
object : DeprecatedHasCompilerOptions<KotlinJsCompilerOptions> {
|
||||
override val options: KotlinJsCompilerOptions = project.objects
|
||||
.newInstance(KotlinJsCompilerOptionsDefault::class.java)
|
||||
.configureExperimentalTryNext(project)
|
||||
|
||||
+2
-2
@@ -27,14 +27,14 @@ internal open class KotlinCommonPlugin(
|
||||
KotlinCommonSourceSetProcessor(KotlinCompilationInfo(compilation), tasksProvider)
|
||||
|
||||
override fun apply(project: Project) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
@Suppress("UNCHECKED_CAST", "TYPEALIAS_EXPANSION_DEPRECATION")
|
||||
val target = project.objects.newInstance(
|
||||
KotlinWithJavaTarget::class.java,
|
||||
project,
|
||||
KotlinPlatformType.common,
|
||||
targetName,
|
||||
{
|
||||
object : HasCompilerOptions<KotlinMultiplatformCommonCompilerOptions> {
|
||||
object : DeprecatedHasCompilerOptions<KotlinMultiplatformCommonCompilerOptions> {
|
||||
override val options: KotlinMultiplatformCommonCompilerOptions = project.objects
|
||||
.newInstance(KotlinMultiplatformCommonCompilerOptionsDefault::class.java)
|
||||
.configureExperimentalTryNext(project)
|
||||
|
||||
+4
-2
@@ -25,7 +25,8 @@ internal sealed class KotlinCompilationInfo {
|
||||
abstract val targetDisambiguationClassifier: String?
|
||||
abstract val compilationName: String
|
||||
abstract val moduleName: String
|
||||
abstract val compilerOptions: HasCompilerOptions<*>
|
||||
@Suppress("TYPEALIAS_EXPANSION_DEPRECATION")
|
||||
abstract val compilerOptions: DeprecatedHasCompilerOptions<*>
|
||||
abstract val compileKotlinTaskName: String
|
||||
abstract val compileAllTaskName: String
|
||||
abstract val languageSettings: LanguageSettings
|
||||
@@ -56,7 +57,8 @@ internal sealed class KotlinCompilationInfo {
|
||||
override val moduleName: String
|
||||
get() = origin.moduleNameForCompilation().get()
|
||||
|
||||
override val compilerOptions: HasCompilerOptions<*>
|
||||
@Suppress("TYPEALIAS_EXPANSION_DEPRECATION")
|
||||
override val compilerOptions: DeprecatedHasCompilerOptions<*>
|
||||
get() = origin.compilerOptions
|
||||
|
||||
override val compileKotlinTaskName: String
|
||||
|
||||
+2
-2
@@ -47,14 +47,14 @@ internal open class KotlinJvmPlugin(
|
||||
Kotlin2JvmSourceSetProcessor(tasksProvider, KotlinCompilationInfo(compilation))
|
||||
|
||||
override fun apply(project: Project) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
@Suppress("UNCHECKED_CAST", "TYPEALIAS_EXPANSION_DEPRECATION")
|
||||
val target = (project.objects.newInstance(
|
||||
KotlinWithJavaTarget::class.java,
|
||||
project,
|
||||
KotlinPlatformType.jvm,
|
||||
targetName,
|
||||
{
|
||||
object : HasCompilerOptions<KotlinJvmCompilerOptions> {
|
||||
object : DeprecatedHasCompilerOptions<KotlinJvmCompilerOptions> {
|
||||
override val options: KotlinJvmCompilerOptions =
|
||||
project.objects
|
||||
.newInstance(KotlinJvmCompilerOptionsDefault::class.java)
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright 2010-2024 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.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package org.jetbrains.kotlin.gradle.plugin
|
||||
|
||||
typealias DeprecatedHasCompilerOptions<T> = HasCompilerOptions<T>
|
||||
+3
-2
@@ -41,7 +41,7 @@ internal class KotlinCompilationImpl constructor(
|
||||
val compilationTaskNames: KotlinCompilationTaskNamesContainer,
|
||||
val processResourcesTaskName: String?,
|
||||
val output: KotlinCompilationOutput,
|
||||
val compilerOptions: HasCompilerOptions<*>,
|
||||
@Suppress("TYPEALIAS_EXPANSION_DEPRECATION") val compilerOptions: DeprecatedHasCompilerOptions<*>,
|
||||
val kotlinOptions: KotlinCommonOptions,
|
||||
val compilationAssociator: KotlinCompilationAssociator,
|
||||
val compilationFriendPathsResolver: KotlinCompilationFriendPathsResolver,
|
||||
@@ -172,7 +172,8 @@ internal class KotlinCompilationImpl constructor(
|
||||
override val kotlinOptions: KotlinCommonOptions
|
||||
get() = params.kotlinOptions
|
||||
|
||||
override val compilerOptions: HasCompilerOptions<*>
|
||||
@Suppress("TYPEALIAS_EXPANSION_DEPRECATION")
|
||||
override val compilerOptions: DeprecatedHasCompilerOptions<*>
|
||||
get() = params.compilerOptions
|
||||
|
||||
//endregion
|
||||
|
||||
+5
-4
@@ -6,9 +6,7 @@
|
||||
package org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.factory
|
||||
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.HasCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilationOutput
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
|
||||
import org.jetbrains.kotlin.gradle.plugin.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.DecoratedKotlinCompilation
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.decoratedInstance
|
||||
@@ -69,7 +67,10 @@ internal class KotlinCompilationImplFactory(
|
||||
}
|
||||
|
||||
fun interface KotlinCompilerOptionsFactory {
|
||||
data class Options(val compilerOptions: HasCompilerOptions<*>, val kotlinOptions: KotlinCommonOptions)
|
||||
data class Options(
|
||||
@Suppress("TYPEALIAS_EXPANSION_DEPRECATION") val compilerOptions: DeprecatedHasCompilerOptions<*>,
|
||||
val kotlinOptions: KotlinCommonOptions
|
||||
)
|
||||
|
||||
fun create(target: KotlinTarget, compilationName: String): Options
|
||||
}
|
||||
|
||||
+7
-5
@@ -6,8 +6,7 @@
|
||||
package org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.factory
|
||||
|
||||
import org.jetbrains.kotlin.gradle.dsl.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.HasCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
|
||||
import org.jetbrains.kotlin.gradle.plugin.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.baseModuleName
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.moduleNameForCompilation
|
||||
import org.jetbrains.kotlin.gradle.targets.native.NativeCompilerOptions
|
||||
@@ -16,7 +15,8 @@ import org.jetbrains.kotlin.gradle.utils.klibModuleName
|
||||
|
||||
internal object KotlinMultiplatformCommonCompilerOptionsFactory : KotlinCompilationImplFactory.KotlinCompilerOptionsFactory {
|
||||
override fun create(target: KotlinTarget, compilationName: String): KotlinCompilationImplFactory.KotlinCompilerOptionsFactory.Options {
|
||||
val compilerOptions = object : HasCompilerOptions<KotlinMultiplatformCommonCompilerOptions> {
|
||||
@Suppress("TYPEALIAS_EXPANSION_DEPRECATION")
|
||||
val compilerOptions = object : DeprecatedHasCompilerOptions<KotlinMultiplatformCommonCompilerOptions> {
|
||||
override val options: KotlinMultiplatformCommonCompilerOptions = target.project.objects
|
||||
.newInstance(KotlinMultiplatformCommonCompilerOptionsDefault::class.java)
|
||||
.configureExperimentalTryNext(target.project)
|
||||
@@ -55,7 +55,8 @@ internal object KotlinNativeCompilerOptionsFactory : KotlinCompilationImplFactor
|
||||
|
||||
internal object KotlinJsCompilerOptionsFactory : KotlinCompilationImplFactory.KotlinCompilerOptionsFactory {
|
||||
override fun create(target: KotlinTarget, compilationName: String): KotlinCompilationImplFactory.KotlinCompilerOptionsFactory.Options {
|
||||
val compilerOptions = object : HasCompilerOptions<KotlinJsCompilerOptions> {
|
||||
@Suppress("TYPEALIAS_EXPANSION_DEPRECATION")
|
||||
val compilerOptions = object : DeprecatedHasCompilerOptions<KotlinJsCompilerOptions> {
|
||||
override val options: KotlinJsCompilerOptions = target.project.objects
|
||||
.newInstance(KotlinJsCompilerOptionsDefault::class.java)
|
||||
.configureExperimentalTryNext(target.project)
|
||||
@@ -72,7 +73,8 @@ internal object KotlinJsCompilerOptionsFactory : KotlinCompilationImplFactory.Ko
|
||||
|
||||
internal object KotlinJvmCompilerOptionsFactory : KotlinCompilationImplFactory.KotlinCompilerOptionsFactory {
|
||||
override fun create(target: KotlinTarget, compilationName: String): KotlinCompilationImplFactory.KotlinCompilerOptionsFactory.Options {
|
||||
val compilerOptions = object : HasCompilerOptions<KotlinJvmCompilerOptions> {
|
||||
@Suppress("TYPEALIAS_EXPANSION_DEPRECATION")
|
||||
val compilerOptions = object : DeprecatedHasCompilerOptions<KotlinJvmCompilerOptions> {
|
||||
override val options: KotlinJvmCompilerOptions = target.project.objects
|
||||
.newInstance(KotlinJvmCompilerOptionsDefault::class.java)
|
||||
.configureExperimentalTryNext(target.project)
|
||||
|
||||
+4
-4
@@ -11,8 +11,7 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions
|
||||
import org.jetbrains.kotlin.gradle.internal.KAPT_GENERATE_STUBS_PREFIX
|
||||
import org.jetbrains.kotlin.gradle.internal.getKaptTaskName
|
||||
import org.jetbrains.kotlin.gradle.plugin.HasCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
|
||||
import org.jetbrains.kotlin.gradle.plugin.*
|
||||
import org.jetbrains.kotlin.gradle.utils.archivesName
|
||||
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
|
||||
import org.jetbrains.kotlin.gradle.utils.fileExtensionCasePermutations
|
||||
@@ -107,8 +106,9 @@ internal inline fun <reified T : KotlinCommonOptions> InternalKotlinCompilation<
|
||||
return this as InternalKotlinCompilation<T>
|
||||
}
|
||||
|
||||
internal inline fun <reified T : KotlinCommonCompilerOptions> HasCompilerOptions<*>.castCompilerOptionsType(): HasCompilerOptions<T> {
|
||||
@Suppress("TYPEALIAS_EXPANSION_DEPRECATION")
|
||||
internal inline fun <reified T : KotlinCommonCompilerOptions> DeprecatedHasCompilerOptions<*>.castCompilerOptionsType(): DeprecatedHasCompilerOptions<T> {
|
||||
this.options as T
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return this as HasCompilerOptions<T>
|
||||
return this as DeprecatedHasCompilerOptions<T>
|
||||
}
|
||||
|
||||
+3
-4
@@ -16,8 +16,7 @@ import org.gradle.api.tasks.TaskProvider
|
||||
import org.jetbrains.kotlin.gradle.dsl.JsModuleKind
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinJsCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinJsOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.HasCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||
import org.jetbrains.kotlin.gradle.plugin.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImpl
|
||||
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsSubTargetContainerDsl
|
||||
import org.jetbrains.kotlin.gradle.targets.js.ir.JsBinary
|
||||
@@ -33,8 +32,8 @@ open class KotlinJsCompilation @Inject internal constructor(
|
||||
HasBinaries<KotlinJsBinaryContainer> {
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
final override val compilerOptions: HasCompilerOptions<KotlinJsCompilerOptions>
|
||||
get() = compilation.compilerOptions as HasCompilerOptions<KotlinJsCompilerOptions>
|
||||
final override val compilerOptions: DeprecatedHasCompilerOptions<KotlinJsCompilerOptions>
|
||||
get() = compilation.compilerOptions as DeprecatedHasCompilerOptions<KotlinJsCompilerOptions>
|
||||
|
||||
internal fun compilerOptions(configure: KotlinJsCompilerOptions.() -> Unit) {
|
||||
compilerOptions.configure(configure)
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ import org.gradle.api.tasks.TaskProvider
|
||||
import org.gradle.api.tasks.compile.JavaCompile
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.HasCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImpl
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
import org.jetbrains.kotlin.gradle.utils.*
|
||||
@@ -27,7 +27,7 @@ open class KotlinJvmAndroidCompilation @Inject internal constructor(
|
||||
|
||||
override val target: KotlinAndroidTarget = compilation.target as KotlinAndroidTarget
|
||||
|
||||
override val compilerOptions: HasCompilerOptions<KotlinJvmCompilerOptions> =
|
||||
override val compilerOptions: DeprecatedHasCompilerOptions<KotlinJvmCompilerOptions> =
|
||||
compilation.compilerOptions.castCompilerOptionsType()
|
||||
|
||||
internal fun compilerOptions(configure: KotlinJvmCompilerOptions.() -> Unit) {
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ open class KotlinJvmCompilation @Inject internal constructor(
|
||||
|
||||
final override val target: KotlinJvmTarget = compilation.target as KotlinJvmTarget
|
||||
|
||||
override val compilerOptions: HasCompilerOptions<KotlinJvmCompilerOptions> =
|
||||
override val compilerOptions: DeprecatedHasCompilerOptions<KotlinJvmCompilerOptions> =
|
||||
compilation.compilerOptions.castCompilerOptionsType()
|
||||
|
||||
internal fun compilerOptions(configure: KotlinJvmCompilerOptions.() -> Unit) {
|
||||
|
||||
+2
-2
@@ -32,14 +32,14 @@ class KotlinJvmWithJavaTargetPreset(
|
||||
|
||||
project.plugins.apply(JavaPlugin::class.java)
|
||||
|
||||
@Suppress("UNCHECKED_CAST", "DEPRECATION")
|
||||
@Suppress("UNCHECKED_CAST", "DEPRECATION", "TYPEALIAS_EXPANSION_DEPRECATION")
|
||||
val target = (project.objects.newInstance(
|
||||
KotlinWithJavaTarget::class.java,
|
||||
project,
|
||||
KotlinPlatformType.jvm,
|
||||
name,
|
||||
{
|
||||
object : HasCompilerOptions<KotlinJvmCompilerOptions> {
|
||||
object : DeprecatedHasCompilerOptions<KotlinJvmCompilerOptions> {
|
||||
override val options: KotlinJvmCompilerOptions = project.objects
|
||||
.newInstance(KotlinJvmCompilerOptionsDefault::class.java)
|
||||
.configureExperimentalTryNext(project)
|
||||
|
||||
+2
-2
@@ -26,8 +26,8 @@ open class KotlinWithJavaCompilation<KotlinOptionsType : KotlinCommonOptions, CO
|
||||
DeprecatedKotlinCompilationWithResources<KotlinOptionsType> {
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
override val compilerOptions: HasCompilerOptions<CO> =
|
||||
compilation.compilerOptions as HasCompilerOptions<CO>
|
||||
override val compilerOptions: DeprecatedHasCompilerOptions<CO> =
|
||||
compilation.compilerOptions as DeprecatedHasCompilerOptions<CO>
|
||||
|
||||
internal fun compilerOptions(configure: CO.() -> Unit) {
|
||||
compilerOptions.configure(configure)
|
||||
|
||||
+3
-3
@@ -3,12 +3,12 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@file:Suppress("PackageDirectoryMismatch") // Old package for compatibility
|
||||
@file:Suppress("PackageDirectoryMismatch", "TYPEALIAS_EXPANSION_DEPRECATION") // Old package for compatibility
|
||||
package org.jetbrains.kotlin.gradle.plugin.mpp
|
||||
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.HasCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.DeprecatedHasCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.DefaultKotlinCompilationPreConfigure
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinJvmCompilationAssociator
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.factory.JvmWithJavaCompilationDependencyConfigurationsFactory
|
||||
@@ -19,7 +19,7 @@ import org.jetbrains.kotlin.gradle.utils.filesProvider
|
||||
|
||||
class KotlinWithJavaCompilationFactory<KotlinOptionsType : KotlinCommonOptions, CO : KotlinCommonCompilerOptions> internal constructor(
|
||||
override val target: KotlinWithJavaTarget<KotlinOptionsType, CO>,
|
||||
val compilerOptionsFactory: () -> HasCompilerOptions<CO>,
|
||||
val compilerOptionsFactory: () -> DeprecatedHasCompilerOptions<CO>,
|
||||
val kotlinOptionsFactory: (CO) -> KotlinOptionsType
|
||||
) : KotlinCompilationFactory<KotlinWithJavaCompilation<KotlinOptionsType, CO>> {
|
||||
|
||||
|
||||
+2
-4
@@ -15,10 +15,8 @@ import org.gradle.api.tasks.SourceSetContainer
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
||||
import org.jetbrains.kotlin.gradle.dsl.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.HasCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||
import org.jetbrains.kotlin.gradle.plugin.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.internal.JavaSourceSetsAccessor
|
||||
import org.jetbrains.kotlin.gradle.plugin.variantImplementationFactory
|
||||
import org.jetbrains.kotlin.gradle.tasks.KOTLIN_BUILD_DIR_NAME
|
||||
import org.jetbrains.kotlin.gradle.utils.newInstance
|
||||
import java.io.File
|
||||
@@ -28,7 +26,7 @@ abstract class KotlinWithJavaTarget<KotlinOptionsType : KotlinCommonOptions, CO
|
||||
project: Project,
|
||||
override val platformType: KotlinPlatformType,
|
||||
override val targetName: String,
|
||||
compilerOptionsFactory: () -> HasCompilerOptions<CO>,
|
||||
@Suppress("TYPEALIAS_EXPANSION_DEPRECATION") compilerOptionsFactory: () -> DeprecatedHasCompilerOptions<CO>,
|
||||
kotlinOptionsFactory: (CO) -> KotlinOptionsType
|
||||
) : AbstractKotlinTarget(project),
|
||||
HasConfigurableCompilerOptions<KotlinJvmCompilerOptions> {
|
||||
|
||||
+3
-4
@@ -12,8 +12,7 @@ import org.gradle.api.Project
|
||||
import org.gradle.api.tasks.TaskProvider
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinNativeCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.HasCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider
|
||||
import org.jetbrains.kotlin.gradle.plugin.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImpl
|
||||
import org.jetbrains.kotlin.gradle.targets.native.NativeCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile
|
||||
@@ -42,8 +41,8 @@ abstract class AbstractKotlinNativeCompilation internal constructor(
|
||||
get() = compilation.compileTaskProvider as TaskProvider<KotlinNativeCompile>
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
override val compilerOptions: HasCompilerOptions<KotlinNativeCompilerOptions>
|
||||
get() = compilation.compilerOptions as HasCompilerOptions<KotlinNativeCompilerOptions>
|
||||
override val compilerOptions: DeprecatedHasCompilerOptions<KotlinNativeCompilerOptions>
|
||||
get() = compilation.compilerOptions as DeprecatedHasCompilerOptions<KotlinNativeCompilerOptions>
|
||||
|
||||
internal fun compilerOptions(configure: KotlinNativeCompilerOptions.() -> Unit) {
|
||||
compilerOptions.configure(configure)
|
||||
|
||||
+4
-2
@@ -3,15 +3,17 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@file:Suppress("TYPEALIAS_EXPANSION_DEPRECATION")
|
||||
|
||||
package org.jetbrains.kotlin.gradle.targets.native
|
||||
|
||||
import org.gradle.api.Project
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinNativeCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinNativeCompilerOptionsDefault
|
||||
import org.jetbrains.kotlin.gradle.plugin.HasCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.DeprecatedHasCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.utils.configureExperimentalTryNext
|
||||
|
||||
class NativeCompilerOptions(project: Project) : HasCompilerOptions<KotlinNativeCompilerOptions> {
|
||||
class NativeCompilerOptions(project: Project) : DeprecatedHasCompilerOptions<KotlinNativeCompilerOptions> {
|
||||
|
||||
override val options: KotlinNativeCompilerOptions = project.objects
|
||||
.newInstance(KotlinNativeCompilerOptionsDefault::class.java)
|
||||
|
||||
+2
-4
@@ -8,15 +8,13 @@ package org.jetbrains.kotlin.gradle.util
|
||||
import org.gradle.api.NamedDomainObjectContainer
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
||||
import org.jetbrains.kotlin.gradle.dsl.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.HasCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||
import org.jetbrains.kotlin.gradle.plugin.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.external.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.external.ExternalKotlinCompilationDescriptor.CompilationFactory
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.external.ExternalKotlinTargetDescriptor.TargetFactory
|
||||
|
||||
class FakeCompilation(delegate: Delegate) : DecoratedExternalKotlinCompilation(delegate) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
@Suppress("UNCHECKED_CAST", "DEPRECATION")
|
||||
override val compilerOptions: HasCompilerOptions<KotlinJvmCompilerOptions>
|
||||
get() = super.compilerOptions as HasCompilerOptions<KotlinJvmCompilerOptions>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user