diff --git a/build/src/org/jetbrains/intellij/build/IdeaCommunityProperties.kt b/build/src/org/jetbrains/intellij/build/IdeaCommunityProperties.kt index d8c1ff9495e7..adc75de842d6 100644 --- a/build/src/org/jetbrains/intellij/build/IdeaCommunityProperties.kt +++ b/build/src/org/jetbrains/intellij/build/IdeaCommunityProperties.kt @@ -97,6 +97,7 @@ open class IdeaCommunityProperties(private val communityHomeDir: Path) : JetBrai mavenArtifacts.addPomMetadata = { module, model -> when { JewelMavenArtifacts.isPublishedJewelModule(module) -> JewelMavenArtifacts.addPomMetadata(module, model) + JewelMavenArtifacts.isPublishedPlatformDependency(module) -> JewelMavenArtifacts.addPlatformPomMetadata(module, model) } } mavenArtifacts.isJavadocJarRequired = { diff --git a/build/src/org/jetbrains/intellij/build/JewelMavenArtifacts.kt b/build/src/org/jetbrains/intellij/build/JewelMavenArtifacts.kt index 4fa6464bfa71..1f4f3cb48605 100644 --- a/build/src/org/jetbrains/intellij/build/JewelMavenArtifacts.kt +++ b/build/src/org/jetbrains/intellij/build/JewelMavenArtifacts.kt @@ -89,6 +89,16 @@ internal object JewelMavenArtifacts { fun isPublishedJewelModule(module: JpsModule): Boolean = module.name.startsWith("intellij.platform.jewel.") && module.name !in NOT_PUBLISHED + /** + * Platform modules that are published to Maven Central as transitive dependencies of Jewel, + * see [PLATFORM_DEPENDENCY_PREFIXES]. The `intellij.platform.icons.` module-name prefix is the + * counterpart of the `icons-` artifactId prefix (the `platform` segment is dropped when the Maven + * coordinates are generated), and covers both `intellij.platform.icons.api` and + * `intellij.platform.icons.api.rendering`. + */ + fun isPublishedPlatformDependency(module: JpsModule): Boolean = + module.name.startsWith("intellij.platform.icons.") + fun patchCoordinates(module: JpsModule, coordinates: MavenCoordinates): MavenCoordinates { check(isPublishedJewelModule(module)) val version = "$VERSION-${coordinates.version}" @@ -183,6 +193,20 @@ internal object JewelMavenArtifacts { }) } + /** + * Supplies the POM metadata required by Maven Central for the [isPublishedPlatformDependency] modules. + * The `name`, `url`, `scm`, `developers` and `organization` fields are already filled in by the POM + * generator for these community modules; only `description` and `licenses` are missing. + */ + fun addPlatformPomMetadata(module: JpsModule, model: Model) { + check(isPublishedPlatformDependency(module)) + model.description = "IntelliJ Platform icons API." + model.addLicense(License().apply { + name = "Apache License 2.0" + url = "https://www.apache.org/licenses/LICENSE-2.0.txt" + }) + } + private fun JpsModule.modulesTree(): Sequence { return sequenceOf(this) + dependenciesList .dependencies