move commons-net to a module lbirary - don't use it

GitOrigin-RevId: af2851cd6f7b6a47cb3e0b1322cde112694c0ebc
This commit is contained in:
Vladimir Krivosheev
2022-12-27 10:57:36 +01:00
committed by intellij-monorepo-bot
parent 8624385827
commit cfcf973856
8 changed files with 34 additions and 45 deletions

View File

@@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="commons-net" type="repository">
<properties maven-id="commons-net:commons-net:3.9.0" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/commons-net/commons-net/3.9.0/commons-net-3.9.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/commons-net/commons-net/3.9.0/commons-net-3.9.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -132,7 +132,6 @@
<orderEntry type="module" module-name="intellij.completionMlRanking.tests" scope="TEST" />
<orderEntry type="module" module-name="intellij.java.debugger.streams" scope="RUNTIME" />
<orderEntry type="library" scope="RUNTIME" name="jgoodies-common" level="project" />
<orderEntry type="library" scope="RUNTIME" name="commons-net" level="project" />
<orderEntry type="module" module-name="intellij.testng.rt.tests" scope="TEST" />
<orderEntry type="module" module-name="intellij.editorconfig" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.vcs.changeReminder" scope="RUNTIME" />

View File

@@ -167,7 +167,6 @@ abstract class BaseIdeaProperties : ProductProperties() {
layout.withProjectLibrary("jetbrains-annotations", LibraryPackMode.STANDALONE_SEPARATE_WITHOUT_VERSION_NAME)
// for compatibility with users projects which refer to IDEA_HOME/lib/junit.jar
layout.withProjectLibrary("JUnit3", LibraryPackMode.STANDALONE_SEPARATE_WITHOUT_VERSION_NAME)
layout.withProjectLibrary("commons-net")
layout.withoutProjectLibrary("Ant")
// there is a patched version of the org.gradle.api.JavaVersion class placed into the Gradle plugin classpath as "rt" jar
@@ -175,7 +174,7 @@ abstract class BaseIdeaProperties : ProductProperties() {
// TODO should be used as regular project library when the issue will be fixed at the Gradle tooling api side https://github.com/gradle/gradle/issues/8431 and the patched class will be removed
layout.withoutProjectLibrary("Gradle")
// this library is placed into subdirectory of 'lib' directory in Android plugin layout, so we need to exclude it from the platform layout explicitly
// this library is placed into subdirectory of the 'lib' directory in Android plugin layout, so we need to exclude it from the platform layout explicitly
layout.withoutProjectLibrary("layoutlib")
layout.withoutProjectLibrary("qodana-sarif")
@@ -196,7 +195,7 @@ abstract class BaseIdeaProperties : ProductProperties() {
override suspend fun copyAdditionalFiles(context: BuildContext, targetDirectory: String) {
val targetDir = Path.of(targetDirectory)
// for compatibility with users projects which refer to IDEA_HOME/lib/annotations.jar
// for compatibility with user projects which refer to IDEA_HOME/lib/annotations.jar
Files.move(targetDir.resolve("lib/annotations-java5.jar"), targetDir.resolve("lib/annotations.jar"),
StandardCopyOption.REPLACE_EXISTING)
}

View File

@@ -95,7 +95,7 @@ class ProductModulesLayout {
/**
* Additional customizations of platform JARs. **This is a temporary property added to keep layout of some products.**
*/
internal var platformLayoutSpec = persistentListOf<BiConsumer<PlatformLayout.Spec, BuildContext>>()
internal var platformLayoutSpec = persistentListOf<(PlatformLayout.Spec, BuildContext) -> Unit>()
@Deprecated("PlatformLayout should be immutable", replaceWith = ReplaceWith("addPlatformSpec"))
fun addPlatformCustomizer(customizer: BiConsumer<PlatformLayout, BuildContext>) {
@@ -104,7 +104,7 @@ class ProductModulesLayout {
}
}
fun addPlatformSpec(customizer: BiConsumer<PlatformLayout.Spec, BuildContext>) {
fun addPlatformSpec(customizer: (PlatformLayout.Spec, BuildContext) -> Unit) {
platformLayoutSpec = platformLayoutSpec.add(customizer)
}

View File

@@ -569,7 +569,7 @@ fun getPluginLayoutsByJpsModuleNames(modules: Collection<String>, productLayout:
for (moduleName in modules) {
val customLayouts = pluginLayoutsByMainModule.get(moduleName)
if (customLayouts == null) {
check(moduleName == "kotlin-ultimate.kmm-plugin" || result.add(PluginLayout.simplePlugin(moduleName))) {
check(moduleName == "kotlin-ultimate.kmm-plugin" || result.add(PluginLayout.plugin(moduleName))) {
"Plugin layout for module $moduleName is already added (duplicated module name?)"
}
}

View File

@@ -55,7 +55,7 @@ private val PLATFORM_API_MODULES = persistentListOf(
)
/**
* List of modules which are included into lib/app.jar in all IntelliJ based IDEs.
* List of modules which are included in lib/app.jar in all IntelliJ based IDEs.
*/
private val PLATFORM_IMPLEMENTATION_MODULES = persistentListOf(
"intellij.platform.analysis.impl",
@@ -190,7 +190,7 @@ object PlatformModules {
layout.withoutProjectLibrary("Eclipse")
val layoutSpec = PlatformLayout.Spec(layout)
for (platformLayoutSpec in productLayout.platformLayoutSpec) {
platformLayoutSpec.accept(layoutSpec, context)
platformLayoutSpec(layoutSpec, context)
}
val alreadyPackedModules = HashSet<String>()
@@ -248,7 +248,7 @@ object PlatformModules {
"intellij.platform.extensions",
"intellij.platform.tracing.rt",
"intellij.platform.core",
// GeneralCommandLine is used by Scala in JPS plugin
// Scala uses GeneralCommandLine in JPS plugin
"intellij.platform.ide.util.io",
"intellij.platform.boot",
), productLayout, layout)

View File

@@ -22,7 +22,6 @@ import java.nio.file.Path
import java.nio.file.attribute.BasicFileAttributes
import java.util.function.BiConsumer
import java.util.function.BiPredicate
import java.util.function.Consumer
import java.util.function.UnaryOperator
typealias ResourceGenerator = suspend (Path, BuildContext) -> Unit
@@ -77,7 +76,7 @@ class PluginLayout private constructor(
* Creates the plugin layout description. The default plugin layout is composed of a jar with name {@code mainModuleName}.jar containing
* production output of {@code mainModuleName} module, and the module libraries of {@code mainModuleName} with scopes 'Compile' and 'Runtime'
* placed under 'lib' directory in a directory with name {@code mainModuleName}.
* If you need to include additional resources or modules into the plugin layout specify them in
* If you need to include additional resources or modules in the plugin layout, specify them in
* {@code body} parameter. If you don't need to change the default layout there is no need to call this method at all, it's enough to
* specify the plugin module in [org.jetbrains.intellij.build.ProductModulesLayout.bundledPluginModules],
* [org.jetbrains.intellij.build.ProductModulesLayout.bundledPluginModules],
@@ -85,19 +84,16 @@ class PluginLayout private constructor(
*
* <p>Note that project-level libraries on which the plugin modules depend, are automatically put to 'IDE_HOME/lib' directory for all IDEs
* which are compatible with the plugin. If this isn't desired (e.g. a library is used in a single plugin only, or if plugins where
* a library is used aren't bundled with IDEs, so we don't want to increase size of the distribution, you may invoke {@link PluginLayoutSpec#withProjectLibrary}
* a library is used aren't bundled with IDEs, so we don't want to increase the size of the distribution, you may invoke {@link PluginLayoutSpec#withProjectLibrary}
* to include such a library to the plugin distribution.</p>
* @param mainModuleName name of the module containing META-INF/plugin.xml file of the plugin
*/
@JvmStatic
fun plugin(
mainModuleName: String,
body: Consumer<PluginLayoutSpec>,
): PluginLayout {
fun plugin(mainModuleName: String, body: (PluginLayoutSpec) -> Unit): PluginLayout {
val layout = PluginLayout(mainModuleName)
val spec = PluginLayoutSpec(layout)
body.accept(spec)
body(spec)
layout.mainJarName = spec.mainJarName
layout.directoryName = spec.directoryName
@@ -109,21 +105,26 @@ class PluginLayout private constructor(
}
@JvmStatic
@JvmOverloads
fun plugin(
moduleNames: List<String>,
body: Consumer<SimplePluginLayoutSpec>? = null,
): PluginLayout {
fun plugin(moduleNames: List<String>, body: (SimplePluginLayoutSpec) -> Unit): PluginLayout {
val layout = PluginLayout(mainModule = moduleNames.first())
moduleNames.forEach(layout::withModule)
body?.accept(SimplePluginLayoutSpec(layout))
body(SimplePluginLayoutSpec(layout))
return layout
}
@JvmStatic
fun simplePlugin(mainModule: String): PluginLayout = plugin(listOf(mainModule))
fun plugin(moduleNames: List<String>): PluginLayout {
val layout = PluginLayout(mainModule = moduleNames.first())
moduleNames.forEach(layout::withModule)
return layout
}
@JvmStatic
fun plugin(mainModule: String): PluginLayout {
val layout = PluginLayout(mainModule = mainModule)
layout.withModule(mainModule)
return layout
}
}
override fun toString() = "Plugin '$mainModule'" + if (bundlingRestrictions != PluginBundlingRestrictions.NONE) ", restrictions: $bundlingRestrictions" else ""
@@ -179,7 +180,7 @@ class PluginLayout private constructor(
/**
* Custom name of the directory (under 'plugins' directory) where the plugin should be placed. By default, the main module name is used
* (with stripped {@code intellij} prefix and dots replaced by dashes).
* <strong>Don't set this property for new plugins</strong>; it is temporary added to keep layout of old plugins unchanged.
* <strong>Don't set this property for new plugins</strong>; it is temporary added to keep the layout of old plugins unchanged.
*/
set(value) {
field = value
@@ -230,9 +231,10 @@ class PluginLayout private constructor(
var mainJarName: String
get() = layout.mainJarName
/**
* Custom name of the main plugin JAR file. By default, the main module name with 'jar' extension is used (with stripped {@code intellij}
* Custom name of the main plugin JAR file.
* By default, the main module name with 'jar' an extension is used (with stripped {@code intellij}
* prefix and dots replaced by dashes).
* <strong>Don't set this property for new plugins</strong>; it is temporary added to keep layout of old plugins unchanged.
* <strong>Don't set this property for new plugins</strong>; it is temporary added to keep the layout of old plugins unchanged.
*/
set(value) {
layout.mainJarName = value
@@ -285,7 +287,8 @@ class PluginLayout private constructor(
}
/**
* By default, version of a plugin is equal to the build number of the IDE it's built with. This method allows to specify custom version evaluator.
* By default, a version of a plugin is equal to the build number of the IDE it's built with.
* This method allows specifying custom version evaluator.
*/
fun withCustomVersion(versionEvaluator: VersionEvaluator) {
layout.versionEvaluator = versionEvaluator
@@ -406,7 +409,7 @@ class PluginLayout private constructor(
}
/**
* Enables support for symlinks and files with posix executable bit set, such as required by macOS.
* Enables support for symlinks and files with a posix executable bit set, such as required by macOS.
*/
fun enableSymlinksAndExecutableResources() {
layout.enableSymlinksAndExecutableResources = true

View File

@@ -95,7 +95,7 @@ fun collectPluginDescriptors(skipImplementationDetailPlugins: Boolean,
val pluginXml = context.findFileInModuleSources(moduleName, "META-INF/plugin.xml") ?: continue
val pluginLayout = nonTrivialPlugins.get(moduleName) ?: PluginLayout.simplePlugin(moduleName)
val pluginLayout = nonTrivialPlugins.get(moduleName) ?: PluginLayout.plugin(moduleName)
val xml = JDOMUtil.load(pluginXml)
if (JDOMUtil.isEmpty(xml)) {
// throws an exception