From cfac5e7bbe54692903f4fed584a4b73095b52890 Mon Sep 17 00:00:00 2001 From: "Dmitriy.Panov" Date: Tue, 8 Apr 2025 14:14:25 +0200 Subject: [PATCH] IJI-2358 resolving the compiled classes (cherry picked from commit d3ace03be2b6b3fc2450d3a18d94a1dd99b69ae1) IJ-MR-159792 GitOrigin-RevId: 918c5c77b52426b02e857c66c06b27e563c58674 --- build/src/JewelMavenArtifactsBuildTarget.kt | 4 +++- .../jetbrains/intellij/build/JewelMavenArtifacts.kt | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/build/src/JewelMavenArtifactsBuildTarget.kt b/build/src/JewelMavenArtifactsBuildTarget.kt index 3db3d43a7fa7..5f29496c96b9 100644 --- a/build/src/JewelMavenArtifactsBuildTarget.kt +++ b/build/src/JewelMavenArtifactsBuildTarget.kt @@ -3,6 +3,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.runBlocking import org.jetbrains.intellij.build.BuildPaths.Companion.COMMUNITY_ROOT import org.jetbrains.intellij.build.BuildPaths.Companion.ULTIMATE_HOME +import org.jetbrains.intellij.build.CompilationTasks import org.jetbrains.intellij.build.IdeaCommunityProperties import org.jetbrains.intellij.build.JewelMavenArtifacts import org.jetbrains.intellij.build.impl.BuildContextImpl @@ -20,11 +21,12 @@ internal object JewelMavenArtifactsBuildTarget { projectHome = ULTIMATE_HOME, productProperties = IdeaCommunityProperties(COMMUNITY_ROOT.communityRoot), ) + CompilationTasks.create(context).compileModules(JewelMavenArtifacts.ALL_MODULES) val builder = MavenArtifactsBuilder(context) val outputDir = context.paths.artifactDir.resolve("maven-artifacts") outputDir.deleteRecursively() builder.generateMavenArtifacts( - JewelMavenArtifacts.CORE.keys + JewelMavenArtifacts.STANDALONE.keys, + JewelMavenArtifacts.ALL_MODULES, outputDir = outputDir.name, validate = true, ) diff --git a/build/src/org/jetbrains/intellij/build/JewelMavenArtifacts.kt b/build/src/org/jetbrains/intellij/build/JewelMavenArtifacts.kt index 7781039fb69b..fa6d16fbfc69 100644 --- a/build/src/org/jetbrains/intellij/build/JewelMavenArtifacts.kt +++ b/build/src/org/jetbrains/intellij/build/JewelMavenArtifacts.kt @@ -15,7 +15,7 @@ import kotlin.io.path.name internal object JewelMavenArtifacts { private const val GROUP_ID: String = "org.jetbrains.jewel" - val CORE: Map = mapOf( + private val CORE: Map = mapOf( "intellij.platform.jewel.foundation" to "jewel-foundation", "intellij.platform.jewel.markdown.core" to "jewel-markdown-core", "intellij.platform.jewel.ui" to "jewel-ui", @@ -29,6 +29,9 @@ internal object JewelMavenArtifacts { "intellij.platform.jewel.decoratedWindow" to "jewel-decorated-window", ) + private val ALL: Map = CORE + STANDALONE + val ALL_MODULES: Set = ALL.keys + fun isJewel(module: JpsModule): Boolean { return module.name.startsWith("intellij.platform.jewel.") } @@ -68,8 +71,7 @@ internal object JewelMavenArtifacts { } fun validate(context: BuildContext, mavenArtifacts: Collection) { - val jewelModules = CORE + STANDALONE - jewelModules.keys.asSequence() + ALL_MODULES.asSequence() .map(context::findRequiredModule) .flatMap { it.modulesTree() } .distinct().forEach { module -> @@ -90,7 +92,7 @@ internal object JewelMavenArtifacts { validateForMavenCentralPublication(artifact) } } - for ((jewelModuleName, artifactId) in jewelModules) { + for ((jewelModuleName, artifactId) in ALL) { check(mavenArtifacts.any { (module, mavenCoordinates) -> module.name == jewelModuleName && mavenCoordinates.groupId == GROUP_ID &&