Drop kotlin-reflect -> kotlin-reflect-api dependency substitution
Review: https://jetbrains.team/p/kt/reviews/6753
This dependency substitution was introduced in
5c99243c10 as a way to fight against
non-incremental compilations. Now it's not needed anymore as the
dependency on kotlin-reflect was changed to binary dependency just a few
commits ago.
This commit is contained in:
@@ -87,8 +87,6 @@ fun Project.configureJavaCompile() {
|
|||||||
|
|
||||||
fun Project.configureJavaBasePlugin() {
|
fun Project.configureJavaBasePlugin() {
|
||||||
plugins.withId("java-base") {
|
plugins.withId("java-base") {
|
||||||
project.configureShadowJarSubstitutionInCompileClasspath()
|
|
||||||
|
|
||||||
fun File.toProjectRootRelativePathOrSelf() = (relativeToOrNull(rootDir)?.takeUnless { it.startsWith("..") } ?: this).path
|
fun File.toProjectRootRelativePathOrSelf() = (relativeToOrNull(rootDir)?.takeUnless { it.startsWith("..") } ?: this).path
|
||||||
|
|
||||||
fun FileCollection.printClassPath(role: String) =
|
fun FileCollection.printClassPath(role: String) =
|
||||||
|
|||||||
@@ -92,24 +92,6 @@ private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Un
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.configureShadowJarSubstitutionInCompileClasspath() {
|
|
||||||
val substitutionMap = mapOf(":kotlin-reflect" to ":kotlin-reflect-api")
|
|
||||||
|
|
||||||
fun configureSubstitution(substitution: DependencySubstitution) {
|
|
||||||
val requestedProject = (substitution.requested as? ProjectComponentSelector)?.projectPath ?: return
|
|
||||||
val replacementProject = substitutionMap[requestedProject] ?: return
|
|
||||||
substitution.useTarget(project(replacementProject), "Non-default shadow jars should not be used in compile classpath")
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets.all {
|
|
||||||
for (configName in listOf(compileOnlyConfigurationName, compileClasspathConfigurationName)) {
|
|
||||||
configurations.getByName(configName).resolutionStrategy.dependencySubstitution {
|
|
||||||
all(::configureSubstitution)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Project.embeddableCompiler(taskName: String = "embeddable", body: ShadowJar.() -> Unit = {}): TaskProvider<ShadowJar> =
|
fun Project.embeddableCompiler(taskName: String = "embeddable", body: ShadowJar.() -> Unit = {}): TaskProvider<ShadowJar> =
|
||||||
compilerShadowJar(taskName) {
|
compilerShadowJar(taskName) {
|
||||||
configureEmbeddableCompilerRelocation()
|
configureEmbeddableCompilerRelocation()
|
||||||
|
|||||||
Reference in New Issue
Block a user