Pill: Fix compilation, forcibly move the annotations-13 dependency to the end of classpath
This commit is contained in:
@@ -7,9 +7,10 @@ class DependencyMapper(
|
||||
val group: String,
|
||||
val module: String,
|
||||
vararg val configurations: String,
|
||||
val version: String? = null,
|
||||
val mapping: (ResolvedDependency) -> MappedDependency?
|
||||
)
|
||||
|
||||
class MappedDependency(val main: PDependency, val deferred: List<PDependency> = emptyList())
|
||||
class MappedDependency(val main: PDependency?, val deferred: List<PDependency> = emptyList())
|
||||
|
||||
class ParserContext(val dependencyMappers: List<DependencyMapper>, val variant: PillExtension.Variant)
|
||||
@@ -366,11 +366,15 @@ private fun ParserContext.parseDependencies(project: Project, forTests: Boolean)
|
||||
if (dependency.moduleGroup == mapper.group
|
||||
&& dependency.moduleName == mapper.module
|
||||
&& dependency.configuration in mapper.configurations
|
||||
&& (mapper.version == null || dependency.moduleVersion == mapper.version)
|
||||
) {
|
||||
val mappedDependency = mapper.mapping(dependency)
|
||||
|
||||
if (mappedDependency != null) {
|
||||
mainRoots += POrderRoot(mappedDependency.main, scope)
|
||||
val mainDependency = mappedDependency.main
|
||||
if (mainDependency != null) {
|
||||
mainRoots += POrderRoot(mainDependency, scope)
|
||||
}
|
||||
|
||||
for (deferredDep in mappedDependency.deferred) {
|
||||
deferredRoots += POrderRoot(deferredDep, scope)
|
||||
|
||||
@@ -36,6 +36,12 @@ class JpsCompatiblePlugin : Plugin<Project> {
|
||||
listOf(PDependency.Library("annotations-13.0"))
|
||||
)
|
||||
},
|
||||
DependencyMapper("org.jetbrains", "annotations", "default", version = "13.0") {
|
||||
MappedDependency(
|
||||
null,
|
||||
listOf(PDependency.Library("annotations-13.0"))
|
||||
)
|
||||
},
|
||||
DependencyMapper("org.jetbrains.kotlin", "kotlin-reflect-api", "runtimeElements") {
|
||||
MappedDependency(PDependency.Library("kotlin-reflect"))
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user