[Gradle, K/N] Deprecate endorsed libraries

#KT-54177 Fixed
This commit is contained in:
Alexander Likhachev
2022-09-26 01:07:18 +02:00
committed by Space
parent 5924a80ec8
commit daf14d0931
8 changed files with 17 additions and 2 deletions
@@ -164,6 +164,7 @@ abstract class BenchmarkingPlugin: Plugin<Project> {
kotlin.targetFromPreset(hostPreset, NATIVE_TARGET_NAME) {
@Suppress("DEPRECATION")
compilations.getByName("main").kotlinOptions.freeCompilerArgs = benchmark.compilerOpts + project.compilerArgs
@Suppress("DEPRECATION") // enableEndorsedLibs is scheduled to be removed in 1.9.0, see KT-54098
compilations.getByName("main").enableEndorsedLibs = true
configureNativeOutput(this@configureNativeTarget)
}
@@ -18,6 +18,8 @@ internal class GradleKpmNativeVariantCompilationData(
override val konanTarget: KonanTarget
get() = variant.konanTarget
@Suppress("DEPRECATION", "DeprecatedCallableAddReplaceWith")
@Deprecated("Declare dependencies explicitly please. This option is scheduled to be removed in 1.9.0")
override val enableEndorsedLibs: Boolean
get() = variant.enableEndorsedLibraries
@@ -29,6 +29,7 @@ abstract class GradleKpmNativeVariantInternal(
),
GradleKpmSingleMavenPublishedModuleHolder by GradleKpmDefaultSingleMavenPublishedModuleHolder(containingModule, fragmentName) {
@Deprecated("Declare dependencies explicitly please. This option is scheduled to be removed in 1.9.0")
override var enableEndorsedLibraries: Boolean = false
override val gradleVariantNames: Set<String>
@@ -43,6 +44,8 @@ abstract class GradleKpmNativeVariantInternal(
interface KotlinNativeCompilationData<T : KotlinCommonOptions> : KotlinCompilationData<T> {
val konanTarget: KonanTarget
@Deprecated("Declare dependencies explicitly please. This option is scheduled to be removed in 1.9.0")
val enableEndorsedLibs: Boolean
}
@@ -198,7 +198,8 @@ internal open class KotlinNativeFragmentMetadataCompilationDataImpl(
?: HostManager.host
}
// FIXME endorsed libs?
@Suppress("DeprecatedCallableAddReplaceWith")
@Deprecated("Declare dependencies explicitly please. This option is scheduled to be removed in 1.9.0")
override val enableEndorsedLibs: Boolean
get() = false
}
@@ -48,6 +48,7 @@ abstract class AbstractKotlinNativeCompilation(
get() = project.nativeUseEmbeddableCompilerJar
// Endorsed library controller.
@Deprecated("Declare dependencies explicitly please. This option is scheduled to be removed in 1.9.0")
override var enableEndorsedLibs: Boolean = false
}
@@ -278,7 +278,8 @@ constructor(
objectFactory.property(it.file(filename).asFile)
}
@Suppress("DEPRECATION")
@Suppress("DEPRECATION", "DeprecatedCallableAddReplaceWith")
@Deprecated("Declare dependencies explicitly please. This option is scheduled to be removed in 1.9.0")
@get:Input
val enableEndorsedLibs: Boolean get() = compilation.enableEndorsedLibs
@@ -315,6 +316,8 @@ constructor(
konanPropertiesService = konanPropertiesService.get()
).buildCompilerArgs(resolvedDependencyGraph)
@Suppress("DEPRECATION") val enableEndorsedLibs = this.enableEndorsedLibs // TODO: remove before 1.9.0, see KT-54098
val buildArgs = buildKotlinNativeBinaryLinkerArgs(
output,
optimized,
@@ -208,6 +208,7 @@ abstract class AbstractKotlinNativeCompile<
get() = languageSettings.progressiveMode
// endregion.
@Deprecated("Declare dependencies explicitly please. This option is scheduled to be removed in 1.9.0")
@get:Input
val enableEndorsedLibs: Boolean by project.provider { compilation.enableEndorsedLibs }
@@ -63,6 +63,7 @@ open class KotlinNativeLinkArtifactTask @Inject constructor(
@get:Input
var debuggable: Boolean = true
@Deprecated("Declare dependencies explicitly please. This option is scheduled to be removed in 1.9.0")
@get:Input
var enableEndorsedLibs: Boolean = false
@@ -202,6 +203,8 @@ open class KotlinNativeLinkArtifactTask @Inject constructor(
val localBinaryOptions = nativeBinaryOptions + binaryOptions
@Suppress("DEPRECATION") val enableEndorsedLibs = this.enableEndorsedLibs // TODO: remove before 1.9.0, see KT-54098
val buildArgs = buildKotlinNativeBinaryLinkerArgs(
outFile = outFile,
optimized = optimized,