[build scripts] introduce ProductProperties.rootModuleForModularLoader property instead of supportModularLoading (RDCT-1034)

This way we can explicitly specify which root module should be used for different variants of JetBrains Client. Before, 'applicationInfoModule' property was used for that. It was confusing and also required copying the JetBrainsClientApplicationInfo.xml file to the custom root module.

GitOrigin-RevId: cadd910e880db6525fc3d083eb3f3cb90e69c666
This commit is contained in:
Nikolay Chashnikov
2024-02-26 11:15:14 +01:00
committed by intellij-monorepo-bot
parent 07fab541fc
commit 0dcb43ec5c
4 changed files with 13 additions and 13 deletions

View File

@@ -65,7 +65,7 @@ interface BuildContext : CompilationContext {
val ideMainClassName: String
/**
* Specifies whether the new modular loader should be used in the IDE distributions, see [ProductProperties.supportModularLoading] and
* Specifies whether the new modular loader should be used in the IDE distributions, see [ProductProperties.rootModuleForModularLoader] and
* [BuildOptions.useModularLoader].
*/
val useModularLoader: Boolean

View File

@@ -379,8 +379,8 @@ data class BuildOptions(
val nonBundledPluginDirectoriesToInclude: Set<String> = getSetProperty("intellij.build.non.bundled.plugin.dirs.to.include")
/**
* If this option and [ProductProperties.supportModularLoading] are set to `true`, a file containing module descriptors will be added to
* the distribution (IJPL-109), and launchers will use it to start the IDE (IJPL-128).
* If this option is set to `true` and [ProductProperties.rootModuleForModularLoader] is non-null, a file containing module descriptors
* will be added to the distribution (IJPL-109), and launchers will use it to start the IDE (IJPL-128).
*/
@ApiStatus.Experimental
var useModularLoader: Boolean = SystemProperties.getBooleanProperty("intellij.build.use.modular.loader", true)

View File

@@ -187,13 +187,6 @@ abstract class ProductProperties {
*/
var buildCrossPlatformDistribution: Boolean = false
/**
* Set to `true` if the product can be started using [com.intellij.platform.runtime.loader.IntellijLoader].
* [BuildOptions.useModularLoader] will be used to determine whether the produced distribution will actually use this way.
*/
@ApiStatus.Experimental
var supportModularLoading: Boolean = false
/**
* Specifies the main module of JetBrains Client product which distribution should be embedded into the IDE's distribution to allow
* running JetBrains Client.
@@ -209,10 +202,17 @@ abstract class ProductProperties {
@ApiStatus.Experimental
var embeddedJetBrainsClientProperties: (() -> ProductProperties)? = null
/**
* Set to the root product module (the one containing product-modules.xml file) to enable using module-based loader for the product.
* [BuildOptions.useModularLoader] will be used to determine whether the produced distribution will actually use this way.
*/
@ApiStatus.Experimental
var rootModuleForModularLoader: String? = null
/**
* Specifies the mode of this product which will be used to determine which plugin modules should be loaded at runtime by
* [the modular loader][com.intellij.platform.bootstrap.ModuleBasedProductLoadingStrategy].
* This property makes sense only if [supportModularLoading] is set to `true`.
* This property makes sense only if [rootModuleForModularLoader] is set to a non-null value.
*/
@ApiStatus.Experimental
var productMode: ProductMode = ProductMode.LOCAL_IDE

View File

@@ -79,7 +79,7 @@ class BuildContextImpl(
get() = if (useModularLoader) "com.intellij.platform.runtime.loader.IntellijLoader" else productProperties.mainClassName
override val useModularLoader: Boolean
get() = productProperties.supportModularLoading && options.useModularLoader
get() = productProperties.rootModuleForModularLoader != null && options.useModularLoader
override val generateRuntimeModuleRepository: Boolean
get() = useModularLoader || isEmbeddedJetBrainsClientEnabled && options.generateRuntimeModuleRepository
@@ -323,7 +323,7 @@ class BuildContextImpl(
jvmArgs.add("-Dintellij.platform.runtime.repository.path=${macroName}/${MODULE_DESCRIPTORS_JAR_PATH}".let { if (isScript) '"' + it + '"' else it })
}
if (useModularLoader) {
jvmArgs.add("-Dintellij.platform.root.module=${productProperties.applicationInfoModule}")
jvmArgs.add("-Dintellij.platform.root.module=${productProperties.rootModuleForModularLoader!!}")
jvmArgs.add("-Dintellij.platform.product.mode=${productProperties.productMode.id}")
}