diff --git a/buildSrc/src/main/kotlin/pill/context.kt b/buildSrc/src/main/kotlin/pill/context.kt index eae52a1e471..82e594f1ffc 100644 --- a/buildSrc/src/main/kotlin/pill/context.kt +++ b/buildSrc/src/main/kotlin/pill/context.kt @@ -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 = emptyList()) +class MappedDependency(val main: PDependency?, val deferred: List = emptyList()) class ParserContext(val dependencyMappers: List, val variant: PillExtension.Variant) \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/pill/parser.kt b/buildSrc/src/main/kotlin/pill/parser.kt index 15e40c44341..98c8ac2586d 100644 --- a/buildSrc/src/main/kotlin/pill/parser.kt +++ b/buildSrc/src/main/kotlin/pill/parser.kt @@ -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) diff --git a/buildSrc/src/main/kotlin/pill/plugin.kt b/buildSrc/src/main/kotlin/pill/plugin.kt index a863f4e26ad..4d5fb754627 100644 --- a/buildSrc/src/main/kotlin/pill/plugin.kt +++ b/buildSrc/src/main/kotlin/pill/plugin.kt @@ -36,6 +36,12 @@ class JpsCompatiblePlugin : Plugin { 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")) },