platform/build-scripts/product-dsl/docs/quick-start.md
Get started with product-dsl in 5 minutes.
Scenario: Add intellij.platform.new.feature to the essential module set.
Open the module set file:
community/platform/build-scripts/src/org/jetbrains/intellij/build/productLayout/CommunityModuleSets.kt
Find the module set function and add your module:
fun essential(): ModuleSet = moduleSet("essential", includeDependencies = true) {
// ... existing modules ...
module("intellij.platform.new.feature") // Add your module
}
Run the generator:
bazel run //platform/buildScripts:plugin-model-toolCommit the changes (both Kotlin and generated XML).
Scenario: Create a new myFeature module set.
Add a function to CommunityModuleSets.kt:
/**
* My feature modules.
* Provides X functionality for Y products.
*/
fun myFeature(): ModuleSet = moduleSet("myFeature") {
embeddedModule("intellij.myFeature.core")
module("intellij.myFeature.impl")
module("intellij.myFeature.ui")
}
Run the generator to create XML:
Run "Generate Product Layouts"
Use in a product (see Task 3).
Scenario: Include myFeature() in GoLand.
Open the product properties file:
platform/buildScripts/src/productLayout/GoLandProperties.kt
Add to getProductContentDescriptor():
override fun getProductContentDescriptor() = productModules {
// ... existing module sets ...
moduleSet(myFeature()) // Add your module set
}
Run the generator.
Scenario: "Missing dependency" error during generation.
Product: GoLand
✗ Missing: 'intellij.platform.symbols'
Needed by: intellij.platform.vcs.impl
Suggestion: Add module set: symbols
Fix options (in order of preference):
Add the suggested module set:
moduleSet(symbols()) // In product's getProductContentDescriptor()
Add the individual module:
module("intellij.platform.symbols")
Allow missing (temporary/special cases only):
allowMissingDependencies("intellij.platform.symbols")
Scenario: Make a module embedded in a specific product.
override fun getProductContentDescriptor() = productModules {
moduleSet(essential()) {
overrideAsEmbedded("intellij.platform.specific.module")
}
}
Note: Overrides cause the module set to be inlined (no xi:include).
| Mode | DSL Function | Use Case |
|---|---|---|
| Default | module() | Regular modules |
| Embedded | embeddedModule() | Core classloader |
| Required | requiredModule() | Test frameworks |
| Set | Description |
|---|---|
essential() | Core IDE modules |
vcs() | Version control |
xml() | XML support |
debugger() | Debugger platform |
ideCommon() | Full IDE common |
ideUltimate() | Ultimate base |
| Method | Command |
|---|---|
| IDE | Run "Generate Product Layouts" |
| Bazel | bazel run //platform/buildScripts:plugin-model-tool |
| JSON | --json flag for analysis output |
Check: Is your function public and returning ModuleSet?
fun mySet(): ModuleSet = moduleSet("my.set") { ... } // ✓
private fun mySet() = ... // ✗ Not discovered
Check: Is the module in multiple sets?
# Search for the module name
grep -r "intellij.duplicate.module" community/platform/build-scripts/
Check: Are you overriding a direct module (not nested)?
// ✗ Wrong: nested module override
moduleSet(parentSet()) {
overrideAsEmbedded("module.from.nested.set") // Error!
}
// ✓ Correct: reference nested set directly
moduleSet(nestedSet()) {
overrideAsEmbedded("module.from.nested.set") // OK
}