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:
Nikita Bobko
2022-07-26 13:45:01 +02:00
parent 8547cb0afd
commit 62cadde3e6
2 changed files with 0 additions and 20 deletions
@@ -87,8 +87,6 @@ fun Project.configureJavaCompile() {
fun Project.configureJavaBasePlugin() {
plugins.withId("java-base") {
project.configureShadowJarSubstitutionInCompileClasspath()
fun File.toProjectRootRelativePathOrSelf() = (relativeToOrNull(rootDir)?.takeUnless { it.startsWith("..") } ?: this).path
fun FileCollection.printClassPath(role: String) =
-18
View File
@@ -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> =
compilerShadowJar(taskName) {
configureEmbeddableCompilerRelocation()