[Gradle][Minor] Move DefaultCompilationDetailsWithRuntime into separate source file
KT-54312
This commit is contained in:
committed by
Space Team
parent
f75f0e647d
commit
64e2e01d7d
-18
@@ -59,24 +59,6 @@ interface CompilationDetailsWithRuntime<T : KotlinCommonOptions> : CompilationDe
|
|||||||
internal val CompilationDetails<*>.associateCompilationsClosure: Iterable<CompilationDetails<*>>
|
internal val CompilationDetails<*>.associateCompilationsClosure: Iterable<CompilationDetails<*>>
|
||||||
get() = closure { it.associateCompilations }
|
get() = closure { it.associateCompilations }
|
||||||
|
|
||||||
open class DefaultCompilationDetailsWithRuntime<T : KotlinCommonOptions, CO : CompilerCommonOptions>(
|
|
||||||
target: KotlinTarget,
|
|
||||||
compilationPurpose: String,
|
|
||||||
defaultSourceSet: KotlinSourceSet,
|
|
||||||
createCompilerOptions: DefaultCompilationDetails<T, CO>.() -> HasCompilerOptions<CO>,
|
|
||||||
createKotlinOptions: DefaultCompilationDetails<T, CO>.() -> T
|
|
||||||
) : DefaultCompilationDetails<T, CO>(
|
|
||||||
target, compilationPurpose, defaultSourceSet, createCompilerOptions, createKotlinOptions
|
|
||||||
), CompilationDetailsWithRuntime<T> {
|
|
||||||
override val runtimeDependencyFilesHolder: GradleKpmDependencyFilesHolder = project.newDependencyFilesHolder(
|
|
||||||
lowerCamelCaseName(
|
|
||||||
target.disambiguationClassifier,
|
|
||||||
compilationPurpose.takeIf { it != KotlinCompilation.MAIN_COMPILATION_NAME }.orEmpty(),
|
|
||||||
"runtimeClasspath"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
open class NativeCompilationDetails(
|
open class NativeCompilationDetails(
|
||||||
target: KotlinTarget,
|
target: KotlinTarget,
|
||||||
compilationPurpose: String,
|
compilationPurpose: String,
|
||||||
|
|||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2022 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.gradle.plugin.mpp
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.CompilerCommonOptions
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions
|
||||||
|
import org.jetbrains.kotlin.gradle.plugin.HasCompilerOptions
|
||||||
|
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
|
||||||
|
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
|
||||||
|
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
|
||||||
|
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.GradleKpmDependencyFilesHolder
|
||||||
|
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.newDependencyFilesHolder
|
||||||
|
import org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName
|
||||||
|
|
||||||
|
open class DefaultCompilationDetailsWithRuntime<T : KotlinCommonOptions, CO : CompilerCommonOptions>(
|
||||||
|
target: KotlinTarget,
|
||||||
|
compilationPurpose: String,
|
||||||
|
defaultSourceSet: KotlinSourceSet,
|
||||||
|
createCompilerOptions: DefaultCompilationDetails<T, CO>.() -> HasCompilerOptions<CO>,
|
||||||
|
createKotlinOptions: DefaultCompilationDetails<T, CO>.() -> T
|
||||||
|
) : DefaultCompilationDetails<T, CO>(
|
||||||
|
target, compilationPurpose, defaultSourceSet, createCompilerOptions, createKotlinOptions
|
||||||
|
), CompilationDetailsWithRuntime<T> {
|
||||||
|
override val runtimeDependencyFilesHolder: GradleKpmDependencyFilesHolder = project.newDependencyFilesHolder(
|
||||||
|
lowerCamelCaseName(
|
||||||
|
target.disambiguationClassifier,
|
||||||
|
compilationPurpose.takeIf { it != KotlinCompilation.MAIN_COMPILATION_NAME }.orEmpty(),
|
||||||
|
"runtimeClasspath"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user