mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
IJI-2358 no need to generate a Maven artifact for a library module
which is supposed to contain just Maven dependencies, nothing else (cherry picked from commit 6424295db657219c4f1526725df40f028c8ff803) IJ-MR-159792 GitOrigin-RevId: 3924394eb888d32a6ee16abebc7ac40365a14941
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4c4ef2b996
commit
068723f005
@@ -0,0 +1,35 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.intellij.build.impl.libraries
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import org.jetbrains.jps.model.module.JpsModule
|
||||
|
||||
/**
|
||||
* A library module is supposed to contain no source code and depend on Maven dependencies or another library module.
|
||||
* It is used to transform libraries into consumable content modules (V2 plugin model).
|
||||
* Won't be published as a Maven artifact, see [org.jetbrains.intellij.build.impl.maven.MavenArtifactsBuilder].
|
||||
*/
|
||||
@ApiStatus.Internal
|
||||
fun JpsModule.isLibraryModule(): Boolean {
|
||||
return name in LIBRARY_MODULE_NAMES
|
||||
}
|
||||
|
||||
/**
|
||||
* Please mind that intellij.libraries.microba and intellij.libraries.cglib are exceptions and should not be included in this list
|
||||
*/
|
||||
private val LIBRARY_MODULE_NAMES: Set<String> = setOf(
|
||||
"intellij.libraries.assertj.core",
|
||||
"intellij.libraries.compose.desktop",
|
||||
"intellij.libraries.compose.foundation.desktop",
|
||||
"intellij.libraries.compose.foundation.desktop.junit",
|
||||
"intellij.libraries.grpc",
|
||||
"intellij.libraries.grpc.netty.shaded",
|
||||
"intellij.libraries.junit4",
|
||||
"intellij.libraries.junit5",
|
||||
"intellij.libraries.kotlinTest",
|
||||
"intellij.libraries.ktor.client",
|
||||
"intellij.libraries.ktor.client.cio",
|
||||
"intellij.libraries.skiko",
|
||||
"intellij.libraries.testng",
|
||||
"intellij.libraries.dokka",
|
||||
)
|
||||
@@ -20,6 +20,7 @@ import org.jetbrains.intellij.build.DirSource
|
||||
import org.jetbrains.intellij.build.buildJar
|
||||
import org.jetbrains.intellij.build.impl.commonModuleExcludes
|
||||
import org.jetbrains.intellij.build.impl.getLibraryFilename
|
||||
import org.jetbrains.intellij.build.impl.libraries.isLibraryModule
|
||||
import org.jetbrains.intellij.build.telemetry.TraceManager.spanBuilder
|
||||
import org.jetbrains.intellij.build.telemetry.use
|
||||
import org.jetbrains.jps.model.java.JavaResourceRootType
|
||||
@@ -262,7 +263,15 @@ open class MavenArtifactsBuilder(protected val context: BuildContext) {
|
||||
mavenizable = false
|
||||
continue
|
||||
}
|
||||
dependencies.add(MavenArtifactDependency(depArtifact.coordinates, true, ArrayList<String>(), scope as DependencyScope?))
|
||||
if (depArtifact.module.isLibraryModule()) {
|
||||
check(depArtifact.dependencies.any()) {
|
||||
"A library module ${depArtifact.module.name} is expected to have some library dependencies"
|
||||
}
|
||||
dependencies += depArtifact.dependencies
|
||||
}
|
||||
else {
|
||||
dependencies.add(MavenArtifactDependency(depArtifact.coordinates, true, ArrayList(), scope as DependencyScope?))
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (dependency is JpsLibraryDependency) {
|
||||
@@ -287,7 +296,9 @@ open class MavenArtifactsBuilder(protected val context: BuildContext) {
|
||||
}
|
||||
|
||||
val artifactData = MavenArtifactData(module, generateMavenCoordinatesForModule(module), dependencies)
|
||||
if (!module.isLibraryModule()) {
|
||||
results[module] = artifactData
|
||||
}
|
||||
return artifactData
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user