Skip to content

Commit

Permalink
[Gradle] Deprecate KotlinCompile DSL
Browse files Browse the repository at this point in the history
^KT-63419 In Progress
  • Loading branch information
Tapchicoma authored and qodana-bot committed Feb 28, 2024
1 parent 2f70478 commit 24acf80
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
*
* @see [KotlinCommonOptions]
*/
@Deprecated(
message = "Replaced with 'KotlinCompilationTask' that exposes the compiler options DSL. More details are here: https://kotl.in/u1r8ln"
)
@KotlinGradlePluginDsl
interface KotlinCompile<out T : KotlinCommonOptions> : Task {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,26 @@ import groovy.lang.Closure
import org.gradle.api.Task
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Internal
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile as KotlinJvmCompileApi

interface KotlinJsCompile : KotlinCompile<KotlinJsOptions>
@Suppress("DEPRECATION")
interface KotlinJsCompile : KotlinCompile<KotlinJsOptions>,
KotlinCompilationTask<KotlinJsCompilerOptions>

@Deprecated(
message = "Moved into API artifact",
replaceWith = ReplaceWith("KotlinJvmCompile", "org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile")
)
interface KotlinJvmCompile : KotlinJvmCompileApi

interface KotlinCommonCompile : KotlinCompile<KotlinMultiplatformCommonOptions>
@Suppress("DEPRECATION")
internal interface KotlinNativeCompileTask : KotlinCompile<KotlinCommonOptions>,
KotlinCompilationTask<KotlinNativeCompilerOptions>

@Suppress("DEPRECATION")
interface KotlinCommonCompile : KotlinCompile<KotlinMultiplatformCommonOptions>,
KotlinCompilationTask<KotlinMultiplatformCommonCompilerOptions>

interface KotlinJsDce : Task {
@get:Internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
@file:Suppress("PackageDirectoryMismatch") // Old package for compatibility
package org.jetbrains.kotlin.gradle.tasks

import org.gradle.api.Action
import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.artifacts.*
Expand All @@ -28,7 +27,6 @@ import org.jetbrains.kotlin.cli.common.arguments.*
import org.jetbrains.kotlin.compilerRunner.*
import org.jetbrains.kotlin.compilerRunner.KotlinNativeCInteropRunner.Companion.run
import org.jetbrains.kotlin.gradle.dsl.*
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
import org.jetbrains.kotlin.gradle.internal.ensureParentDirsCreated
import org.jetbrains.kotlin.gradle.internal.isInIdeaSync
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
Expand Down Expand Up @@ -277,13 +275,12 @@ internal constructor(
final override val compilation: KotlinCompilationInfo,
override val compilerOptions: KotlinNativeCompilerOptions,
private val objectFactory: ObjectFactory,
private val providerFactory: ProviderFactory,
providerFactory: ProviderFactory,
private val execOperations: ExecOperations,
) : AbstractKotlinNativeCompile<KotlinCommonOptions, K2NativeCompilerArguments>(objectFactory),
KotlinCompile<KotlinCommonOptions>,
KotlinNativeCompileTask,
K2MultiplatformCompilationTask,
UsesBuildMetricsService,
KotlinCompilationTask<KotlinNativeCompilerOptions>,
UsesBuildFusService,
UsesKotlinNativeBundleBuildService {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package org.jetbrains.kotlin.gradle.tasks
import org.gradle.api.Task
import org.gradle.api.tasks.Nested
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile

/**
* Analogous to [KotlinCompilationTask] for K2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ abstract class Kotlin2JsCompile @Inject constructor(
objectFactory: ObjectFactory,
workerExecutor: WorkerExecutor,
) : AbstractKotlinCompile<K2JSCompilerArguments>(objectFactory, workerExecutor),
KotlinCompilationTask<KotlinJsCompilerOptions>,
UsesLibraryFilterCachingService,
UsesBuildFusService,
KotlinJsCompile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ abstract class KotlinCompileCommon @Inject constructor(
workerExecutor: WorkerExecutor,
objectFactory: ObjectFactory
) : AbstractKotlinCompile<K2MetadataCompilerArguments>(objectFactory, workerExecutor),
KotlinCompilationTask<KotlinMultiplatformCommonCompilerOptions>,
KotlinCommonCompile {

init {
Expand Down

0 comments on commit 24acf80

Please sign in to comment.