mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[JEWEL-1354] Fix: Publishing Jewel Standalone to Maven Central fails: transitive icons-api POM is missing metadata
(cherry picked from commit 4e68447dc930833945238fb57a60fb8570e2411f) IJ-MR-212081 GitOrigin-RevId: bf6f94d867d05ec88f3446fe90d18a5d766b17de
This commit is contained in:
committed by
intellij-monorepo-bot
parent
032935307a
commit
3b3ee4cd01
@@ -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 = {
|
||||
|
||||
@@ -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<JpsModule> {
|
||||
return sequenceOf(this) + dependenciesList
|
||||
.dependencies
|
||||
|
||||
Reference in New Issue
Block a user