[Gradle][Minor] Move KotlinDependencyConfigurationsHolder into separate source file
KT-54312
This commit is contained in:
committed by
Space Team
parent
645d79d34a
commit
5777f4859c
-26
@@ -5,8 +5,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.plugin.mpp
|
package org.jetbrains.kotlin.gradle.plugin.mpp
|
||||||
|
|
||||||
import org.gradle.api.Action
|
|
||||||
import org.gradle.api.Project
|
|
||||||
import org.jetbrains.kotlin.gradle.dsl.*
|
import org.jetbrains.kotlin.gradle.dsl.*
|
||||||
import org.jetbrains.kotlin.gradle.plugin.*
|
import org.jetbrains.kotlin.gradle.plugin.*
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.*
|
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.*
|
||||||
@@ -15,7 +13,6 @@ import org.jetbrains.kotlin.gradle.plugin.sources.*
|
|||||||
import org.jetbrains.kotlin.gradle.utils.*
|
import org.jetbrains.kotlin.gradle.utils.*
|
||||||
import org.jetbrains.kotlin.tooling.core.closure
|
import org.jetbrains.kotlin.tooling.core.closure
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import javax.inject.Inject
|
|
||||||
|
|
||||||
interface CompilationDetails<T : KotlinCommonOptions> {
|
interface CompilationDetails<T : KotlinCommonOptions> {
|
||||||
val target: KotlinTarget
|
val target: KotlinTarget
|
||||||
@@ -53,26 +50,3 @@ internal val CompilationDetails<*>.associateCompilationsClosure: Iterable<Compil
|
|||||||
get() = closure { it.associateCompilations }
|
get() = closure { it.associateCompilations }
|
||||||
|
|
||||||
|
|
||||||
internal abstract class KotlinDependencyConfigurationsHolder @Inject constructor(
|
|
||||||
val project: Project,
|
|
||||||
private val configurationNamesPrefix: String?,
|
|
||||||
) : HasKotlinDependencies {
|
|
||||||
|
|
||||||
override val apiConfigurationName: String
|
|
||||||
get() = lowerCamelCaseName(configurationNamesPrefix, API)
|
|
||||||
|
|
||||||
override val implementationConfigurationName: String
|
|
||||||
get() = lowerCamelCaseName(configurationNamesPrefix, IMPLEMENTATION)
|
|
||||||
|
|
||||||
override val compileOnlyConfigurationName: String
|
|
||||||
get() = lowerCamelCaseName(configurationNamesPrefix, COMPILE_ONLY)
|
|
||||||
|
|
||||||
override val runtimeOnlyConfigurationName: String
|
|
||||||
get() = lowerCamelCaseName(configurationNamesPrefix, RUNTIME_ONLY)
|
|
||||||
|
|
||||||
override fun dependencies(configure: KotlinDependencyHandler.() -> Unit): Unit =
|
|
||||||
DefaultKotlinDependencyHandler(this, project).run(configure)
|
|
||||||
|
|
||||||
override fun dependencies(configure: Action<KotlinDependencyHandler>) =
|
|
||||||
dependencies { configure.execute(this) }
|
|
||||||
}
|
|
||||||
|
|||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* 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.gradle.api.Action
|
||||||
|
import org.gradle.api.Project
|
||||||
|
import org.jetbrains.kotlin.gradle.plugin.HasKotlinDependencies
|
||||||
|
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler
|
||||||
|
import org.jetbrains.kotlin.gradle.utils.*
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
internal abstract class KotlinDependencyConfigurationsHolder @Inject constructor(
|
||||||
|
val project: Project,
|
||||||
|
private val configurationNamesPrefix: String?,
|
||||||
|
) : HasKotlinDependencies {
|
||||||
|
|
||||||
|
override val apiConfigurationName: String
|
||||||
|
get() = lowerCamelCaseName(configurationNamesPrefix, API)
|
||||||
|
|
||||||
|
override val implementationConfigurationName: String
|
||||||
|
get() = lowerCamelCaseName(configurationNamesPrefix, IMPLEMENTATION)
|
||||||
|
|
||||||
|
override val compileOnlyConfigurationName: String
|
||||||
|
get() = lowerCamelCaseName(configurationNamesPrefix, COMPILE_ONLY)
|
||||||
|
|
||||||
|
override val runtimeOnlyConfigurationName: String
|
||||||
|
get() = lowerCamelCaseName(configurationNamesPrefix, RUNTIME_ONLY)
|
||||||
|
|
||||||
|
override fun dependencies(configure: KotlinDependencyHandler.() -> Unit): Unit =
|
||||||
|
DefaultKotlinDependencyHandler(this, project).run(configure)
|
||||||
|
|
||||||
|
override fun dependencies(configure: Action<KotlinDependencyHandler>) =
|
||||||
|
dependencies { configure.execute(this) }
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user