Skip to content

Conversation

@hsz
Copy link
Collaborator

@hsz hsz commented Jun 26, 2025

Summary by CodeRabbit

  • Chores
    • Updated copyright years across all build scripts.
    • Modernized and refactored build configuration for IntelliJ platform plugins, adopting more idiomatic Gradle Kotlin DSL practices.
    • Improved plugin and module dependency declarations, moving to provider-based, lazy evaluation and explicit platform type configuration.
    • Streamlined and consolidated plugin module packaging and dependency integration.
    • Removed obsolete helper functions and custom task logic to simplify build scripts.

@coderabbitai
Copy link

coderabbitai bot commented Jun 26, 2025

Walkthrough

This update extensively modernizes Gradle Kotlin DSL build scripts across the project. It replaces string-based and eagerly evaluated IntelliJ platform configuration with provider-based, typed, and lazily evaluated constructs. Custom sandbox normalization logic and related task configurations are removed. Dependency and plugin module declarations are consolidated within intellijPlatform blocks, and task registrations are refactored for idiomatic Kotlin DSL usage.

Changes

File(s)/Path(s) Change Summary
build.gradle.kts Removed custom sandbox normalization logic and related tasks; modernized IntelliJ platform and task configuration
plugin/*, embedded/*, mason/*, mojo/*, tt2/* Refactored IntelliJ platform configuration to use provider-based, typed, and lazy evaluation; updated dependencies and plugin modules to be declared inside intellijPlatform blocks; replaced string platform types with IntelliJPlatformType; removed helper properties functions where present
plugin/core, plugin/htmlmason/core, plugin/mason2/core, plugin/coverage/core, tt2/core, embedded/core, mojo/core Refactored task registrations for parser/lexer generation to use delegated properties and provider-based property assignments; updated task dependencies accordingly
plugin/testFixtures/build.gradle.kts Added license header; refactored platform and plugin configuration to use providers and explicit types
plugin/build.gradle.kts Modernized plugin and module declarations; consolidated dependencies into intellijPlatform block; removed redundant task configuration
buildSrc/build.gradle.kts, settings.gradle.kts Only copyright/comment updates

Sequence Diagram(s)

sequenceDiagram
    participant Gradle
    participant ProjectBuildScript
    participant IntelliJPlatformPlugin

    Gradle->>ProjectBuildScript: Evaluate build.gradle.kts
    ProjectBuildScript->>IntelliJPlatformPlugin: Call intellijPlatform.create(type, version, useInstaller) using providers
    IntelliJPlatformPlugin-->>ProjectBuildScript: Configure platform, modules, plugins lazily
    ProjectBuildScript->>Gradle: Register tasks using delegated properties and providers
    Gradle-->>ProjectBuildScript: Tasks and dependencies resolved at execution
Loading

Possibly related PRs

  • Camelcade/Perl5-IDEA#3015: Adds custom sandbox normalization logic and helper functions to the root build script, which are now removed or replaced in this PR.
  • Camelcade/Perl5-IDEA#2982: Upgrades the IntelliJ platform Gradle plugin version and introduces initial platform version updates without additional refactoring; this PR builds upon and extends those changes with further modernization.

Poem

🐇
Hop, hop, the build scripts grow,
From strings to types, the changes flow.
Providers dance, dependencies align,
No more sandboxes to normalize!
Kotlin DSL shines, so neat and spry—
The rabbit winks and bounds on by.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 21bce3b and a0c9717.

📒 Files selected for processing (1)
  • build.gradle.kts (11 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • build.gradle.kts
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Build (ubuntu-latest)
  • GitHub Check: Build (windows-latest)
  • GitHub Check: Build (macos-latest)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 23

♻️ Duplicate comments (21)
mojo/frontend/build.gradle.kts (1)

29-33: Same ambiguity & missing default as above

Mirror the fix applied to embedded/common: qualify the provider factory and make useInstaller safe.

-      type = provider { IntelliJPlatformType.IntellijIdeaCommunity },
-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      type = providers.provider { IntelliJPlatformType.IntellijIdeaCommunity },
+      useInstaller = providers.gradleProperty("useInstaller")
+        .map { it.toBoolean() }
+        .orElse(false),
plugin/plenv/build.gradle.kts (1)

22-26: Clarify provider call & safeguard useInstaller

Same concern as in other modules – qualify the provider factory and supply a default value.

-      type = provider { IntelliJPlatformType.IntellijIdeaCommunity },
-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      type = providers.provider { IntelliJPlatformType.IntellijIdeaCommunity },
+      useInstaller = providers.gradleProperty("useInstaller")
+        .map { it.toBoolean() }
+        .orElse(false),
embedded/frontend/build.gradle.kts (1)

29-33: Qualify provider factory & default useInstaller

Repeat the fix applied in other scripts:

-      type = provider { IntelliJPlatformType.IntellijIdeaCommunity },
-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      type = providers.provider { IntelliJPlatformType.IntellijIdeaCommunity },
+      useInstaller = providers.gradleProperty("useInstaller")
+        .map { it.toBoolean() }
+        .orElse(false),
plugin/perlInstall/build.gradle.kts (1)

22-26: Provider qualification & safe default

Apply the same pattern:

-      type = provider { IntelliJPlatformType.IntellijIdeaCommunity },
-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      type = providers.provider { IntelliJPlatformType.IntellijIdeaCommunity },
+      useInstaller = providers.gradleProperty("useInstaller")
+        .map { it.toBoolean() }
+        .orElse(false),
tt2/common/build.gradle.kts (1)

28-32: Same useInstaller default-value concern as in mason2/common
See earlier comment – the identical fix applies here.

plugin/frontend/split/build.gradle.kts (1)

29-33: Same useInstaller default-value concern as in mason2/common
See earlier comment – the identical fix applies here.

mason/mason2/frontend/split/build.gradle.kts (1)

31-35: Same useInstaller default-value concern as in mason2/common
See earlier comment – the identical fix applies here.

tt2/frontend/build.gradle.kts (1)

29-33: Same useInstaller default-value concern as in mason2/common
See earlier comment – the identical fix applies here.

plugin/copyright/build.gradle.kts (1)

22-26: Same useInstaller fallback is missing here as well
See the earlier comment in plugin/makeMaker/build.gradle.kts.

plugin/wsl/build.gradle.kts (1)

23-26: Same useInstaller pitfall as in other scripts

Apply the guarded .orElse(false) pattern here as well to avoid runtime failures.

plugin/carton/build.gradle.kts (1)

22-26: Guard against missing useInstaller property

Same fix as suggested for berrybrew: add .orElse(false) after the map { … }.

plugin/cpanminus/build.gradle.kts (1)

22-26: Potential failure on absent useInstaller

Guard with .orElse(false) as discussed above.

tt2/build.gradle.kts (1)

32-36: Unprotected useInstaller mapping

Add .orElse(false) to avoid NoSuchElementException when the flag is not supplied.

plugin/profiler/build.gradle.kts (1)

23-26: Repeat of enum-casing and useInstaller concerns.

The same enum-name and missing-property caveats raised for plugin/perlbrew apply here.

mason/htmlmason/build.gradle.kts (1)

33-37: Enum constant & useInstaller safeguards.

Please apply the enum-name verification and orElse(false) default here as well for consistency and robustness.

mason/mason2/build.gradle.kts (1)

31-37: Same useInstaller provider issue as noted in plugin/idea

Please apply the .orElse(false) safeguard here as well.

plugin/moduleBuild/build.gradle.kts (2)

22-26: Missing default for useInstaller

Identical to plugin/idea; add .orElse(false).


28-34: compileOnly/testCompileOnly incorrectly scoped

Move them outside the intellijPlatform block (see detailed diff in plugin/idea).

plugin/terminal/build.gradle.kts (2)

22-26: useInstaller default handling

Same absence-of-default problem – add .orElse(false).


30-36: Configuration scope for compileOnly / testCompileOnly

Same scoping issue – relocate out of intellijPlatform.

mojo/build.gradle.kts (1)

31-35: useInstaller provider needs a fallback

Apply .orElse(false) like in earlier comment.

🧹 Nitpick comments (22)
plugin/plenv/build.gradle.kts (1)

28-35: Redundant compileOnly/testCompileOnly alongside pluginModule

pluginModule(project(it)) already attaches the project as a compile-time dependency; adding compileOnly and testCompileOnly duplicates the class-path entry and slightly slows dependency resolution.

-      compileOnly(project(it))
-      testCompileOnly(project(it))
-      pluginModule(project(it))
+      pluginModule(project(it))          // sufficient for compile & runtime
plugin/perlInstall/build.gradle.kts (1)

28-34: Duplicate dependency scopes

pluginModule already covers compile/runtime; the extra compileOnly & testCompileOnly entries are superfluous.

-      compileOnly(project(it))
-      testCompileOnly(project(it))
-      pluginModule(project(it))
+      pluginModule(project(it))
mojo/common/build.gradle.kts (1)

28-32: Guard against missing useInstaller

Replicate the safe-default pattern to keep behaviour uniform across modules.

-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      useInstaller = providers.gradleProperty("useInstaller")
+        .map(String::toBoolean)
+        .orElse(false),
plugin/common/build.gradle.kts (1)

22-26: Defensive default for useInstaller

For consistency with the other build scripts, supply a fallback when the property is not provided.

-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      useInstaller = providers.gradleProperty("useInstaller")
+        .map(String::toBoolean)
+        .orElse(false),
plugin/makeMaker/build.gradle.kts (1)

28-34: Reduce duplication when wiring project modules

Each iteration repeats compileOnly, testCompileOnly, and pluginModule for the same target.
A tiny helper keeps the block concise and harder to forget to update:

fun DependencyHandlerScope.intellijPlugin(projectPath: String) =
  project(projectPath).also {
    compileOnly(it); testCompileOnly(it); pluginModule(it)
  }

listOf(":plugin.core").forEach(::intellijPlugin)
plugin/copyright/build.gradle.kts (1)

30-36: Consider extracting a tiny helper for repetitive dependency wiring

The triple-call (compileOnly, testCompileOnly, pluginModule) appears in several scripts; a shared extension would keep the build logic DRY.

plugin/docker/build.gradle.kts (1)

31-37: Repeated dependency wiring – extract helper

Same suggestion as in previous files to avoid three calls per project.

plugin/intelliLang/build.gradle.kts (1)

30-36: Extract helper to remove duplicate dependency declarations

The triple call (compileOnly, testCompileOnly, pluginModule) repeats across build scripts; consider a small extension as previously suggested.

plugin/testFixtures/build.gradle.kts (1)

45-48: Provide a safe default for useInstaller

If the useInstaller property is not supplied on the command line, providers.gradleProperty("useInstaller") yields a Provider with no value, and the build will fail at realisation time because create() receives a missing Boolean.
Adding a fallback avoids that fragility.

-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      useInstaller = providers
+        .gradleProperty("useInstaller")
+        .map(String::toBoolean)
+        .orElse(false),
mason/htmlmason/frontend/split/build.gradle.kts (1)

31-35: Add orElse(false) to prevent missing-property crashes

Same reasoning as in plugin/testFixtures: if -PuseInstaller is omitted, the provider is empty and the build breaks. Defaulting to false keeps the script robust.

-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      useInstaller = providers
+        .gradleProperty("useInstaller")
+        .map(String::toBoolean)
+        .orElse(false),
mason/framework/build.gradle.kts (1)

29-33: Gracefully handle an absent useInstaller flag

For consistency with other modules—and to avoid a late-evaluation failure—supply a default value when the project property is missing.

-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      useInstaller = providers
+        .gradleProperty("useInstaller")
+        .map(String::toBoolean)
+        .orElse(false),
mojo/frontend/split/build.gradle.kts (1)

31-35: Default useInstaller to false to keep the build resilient

Mirrors the recommendation for the other modules.

-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      useInstaller = providers
+        .gradleProperty("useInstaller")
+        .map(String::toBoolean)
+        .orElse(false),
plugin/berrybrew/build.gradle.kts (1)

28-34: Redundant compileOnly / testCompileOnly alongside pluginModule

pluginModule(project(it)) already puts the module on the compile & test class-paths.
Keeping the extra compileOnly / testCompileOnly lines adds no value and clutters the graph.

-      compileOnly(project(it))
-      testCompileOnly(project(it))
-      pluginModule(project(it))
+      pluginModule(project(it)) // sufficient
plugin/wsl/build.gradle.kts (1)

30-36: Duplicate dependency declarations

compileOnly + testCompileOnly are unnecessary when pluginModule is declared.
Consider trimming to keep the build faster & cleaner.

plugin/carton/build.gradle.kts (1)

28-34: Remove superfluous compileOnly / testCompileOnly lines

pluginModule already covers them.

plugin/cpanminus/build.gradle.kts (1)

28-34: Streamline dependency block

Drop the extra compileOnly / testCompileOnly lines; pluginModule suffices.

tt2/build.gradle.kts (1)

41-48: Consider eliminating compile-time overlap

pluginModule(project(it)) makes the packaged module available during compilation; any separate compileOnly/testCompileOnly for the same projects (see lines 20-26) become redundant and can be removed to shorten classpaths.

plugin/cpan/build.gradle.kts (1)

23-26: Same useInstaller defaulting issue.

All scripts should share a small util that returns providers.gradleProperty("useInstaller").map(String::toBoolean).orElse(false) to avoid copy-pasted logic and latent NPEs.

mason/htmlmason/build.gradle.kts (1)

44-52: Consider compressing the packaging list for readability.

Minor readability nit: the four pluginModule entries can be expressed as a single list variable declared at the top of the block; this keeps the block dense but comprehensible.

build.gradle.kts (3)

228-230: jacocoRootReport – expensive executionData aggregation runs on every build

Walking the coverage directory every time adds noticeable IO overhead in CI.
Cache the file list in a Provider or restrict it to onlyIf { withCoverage.get() } to save time when coverage is disabled.


120-121: Minor: avoid JvmTarget.fromTarget(it) allocation

it already contains the target string ("17" etc.). You can assign the string directly:

jvmTarget = properties("javaTargetVersion")

fromTarget creates an extra enum which is not necessary for compiler options.


278-279: Empty task registration – consider specifying a type for clarity

val generateLexers by registering registers a plain DefaultTask.
Giving it an explicit type (or at least a descriptive group / description) will help consumers and IDE navigation.

val generateLexers by registering {
  group = "code generation"
  description = "Aggregates lexer generation tasks from sub-projects."
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b50b787 and 21bce3b.

📒 Files selected for processing (54)
  • build.gradle.kts (10 hunks)
  • buildSrc/build.gradle.kts (2 hunks)
  • embedded/build.gradle.kts (3 hunks)
  • embedded/common/build.gradle.kts (2 hunks)
  • embedded/core/build.gradle.kts (3 hunks)
  • embedded/frontend/build.gradle.kts (3 hunks)
  • embedded/frontend/split/build.gradle.kts (3 hunks)
  • mason/framework/build.gradle.kts (3 hunks)
  • mason/htmlmason/build.gradle.kts (3 hunks)
  • mason/htmlmason/common/build.gradle.kts (2 hunks)
  • mason/htmlmason/core/build.gradle.kts (3 hunks)
  • mason/htmlmason/frontend/build.gradle.kts (3 hunks)
  • mason/htmlmason/frontend/split/build.gradle.kts (3 hunks)
  • mason/mason2/build.gradle.kts (3 hunks)
  • mason/mason2/common/build.gradle.kts (2 hunks)
  • mason/mason2/core/build.gradle.kts (3 hunks)
  • mason/mason2/frontend/build.gradle.kts (3 hunks)
  • mason/mason2/frontend/split/build.gradle.kts (3 hunks)
  • mojo/build.gradle.kts (3 hunks)
  • mojo/common/build.gradle.kts (2 hunks)
  • mojo/core/build.gradle.kts (3 hunks)
  • mojo/frontend/build.gradle.kts (3 hunks)
  • mojo/frontend/split/build.gradle.kts (3 hunks)
  • plugin/asdf/build.gradle.kts (2 hunks)
  • plugin/berrybrew/build.gradle.kts (2 hunks)
  • plugin/build.gradle.kts (2 hunks)
  • plugin/carton/build.gradle.kts (2 hunks)
  • plugin/common/build.gradle.kts (2 hunks)
  • plugin/copyright/build.gradle.kts (2 hunks)
  • plugin/core/build.gradle.kts (3 hunks)
  • plugin/coverage/build.gradle.kts (2 hunks)
  • plugin/cpan/build.gradle.kts (2 hunks)
  • plugin/cpanminus/build.gradle.kts (2 hunks)
  • plugin/debugger/build.gradle.kts (2 hunks)
  • plugin/docker/build.gradle.kts (2 hunks)
  • plugin/frontend/build.gradle.kts (2 hunks)
  • plugin/frontend/split/build.gradle.kts (3 hunks)
  • plugin/idea/build.gradle.kts (2 hunks)
  • plugin/intelliLang/build.gradle.kts (2 hunks)
  • plugin/makeMaker/build.gradle.kts (2 hunks)
  • plugin/moduleBuild/build.gradle.kts (2 hunks)
  • plugin/perlInstall/build.gradle.kts (2 hunks)
  • plugin/perlbrew/build.gradle.kts (2 hunks)
  • plugin/plenv/build.gradle.kts (2 hunks)
  • plugin/profiler/build.gradle.kts (2 hunks)
  • plugin/terminal/build.gradle.kts (2 hunks)
  • plugin/testFixtures/build.gradle.kts (2 hunks)
  • plugin/wsl/build.gradle.kts (2 hunks)
  • settings.gradle.kts (1 hunks)
  • tt2/build.gradle.kts (3 hunks)
  • tt2/common/build.gradle.kts (2 hunks)
  • tt2/core/build.gradle.kts (3 hunks)
  • tt2/frontend/build.gradle.kts (3 hunks)
  • tt2/frontend/split/build.gradle.kts (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Build (macos-latest)
  • GitHub Check: Build (windows-latest)
  • GitHub Check: Build (ubuntu-latest)
🔇 Additional comments (15)
buildSrc/build.gradle.kts (1)

2-2: Comment-only change looks good

Capitalizing “Gradle” improves consistency and professionalism.
No functional impact, nothing else to address.

settings.gradle.kts (1)

2-2: Copyright-year bump acknowledged

Pure comment update; no build-logic impact.
LGTM.

embedded/common/build.gradle.kts (1)

28-32: ```shell
#!/bin/bash
set -eu
echo "Listing build.gradle.kts files:"
fd build.gradle.kts -t f || true
echo "Showing contents around the create call in embedded/common/build.gradle.kts:"
grep -R -n "create(" -n embedded/common/build.gradle.kts | sed -e 's/:/ -> /g' | head -n 10
echo
sed -n '1,200p' embedded/common/build.gradle.kts


</details>
<details>
<summary>mason/mason2/frontend/build.gradle.kts (1)</summary>

`29-33`: **Add default for absent `useInstaller` property**

Same issue as in `plugin/asdf`: absence of the Gradle property causes provider resolution failure.  
Apply the `.orElse(false)` fallback.

```diff
-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      useInstaller = providers.gradleProperty("useInstaller")
+        .map(String::toBoolean)
+        .orElse(false),
embedded/frontend/split/build.gradle.kts (1)

31-35: Provide fallback for useInstaller property

Prevent build failures when the flag is omitted.

-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      useInstaller = providers.gradleProperty("useInstaller")
+        .map(String::toBoolean)
+        .orElse(false),
plugin/docker/build.gradle.kts (1)

28-30: Verify that remoteRunPlugin Gradle property is always present

bundledPlugin(providers.gradleProperty("remoteRunPlugin")) will fail if the property is undefined.
Either give it orNull/orElse, or document that it’s mandatory.

plugin/perlbrew/build.gradle.kts (2)

28-34: Duplicate delivery of the same artifacts.

pluginModule(project(it)) already adds the module to the IDE sandbox; keeping compileOnly/testCompileOnly is fine, but verify that these modules are not also added through runtimeOnly elsewhere to prevent classpath duplication and warning spam at build time.


23-24: Check enum constant casing against the plugin version.

IntelliJPlatformType.IntellijIdeaCommunity looks plausible, but the official enum constants have changed casing a few times (IDEA_COMMUNITY, IntellijIdeaCommunity, etc.). A mismatch will fail during the script’s class-loading phase, long before tasks run.

If you are on the latest org.jetbrains.intellij.platform.gradle plugin, please grep the classpath to confirm the exact constant:

#!/usr/bin/env bash
# Locate the enum constants shipped with the applied Gradle plugin
fd IntelliJPlatformType ~/.gradle/caches | head -n 10 | xargs grep -n "enum class IntelliJPlatformType" -A3
plugin/profiler/build.gradle.kts (1)

28-28: Confirm bundled module id.

"intellij.profiler.common" is correct for 2023.3+, but older IDEs expose it as "intellij.profiler". If you support multiple IDE baselines, guard this with version-based selection to avoid “cannot find bundled plugin” errors.

plugin/coverage/build.gradle.kts (1)

30-36: Classpath duplication warning.

Same note as for perlbrew: verify that adding pluginModule(project(it)) plus compileOnly/testCompileOnly does not create duplicated jars in the sandbox. Gradle will warn but still package duplicates, which bloats artifact size.

mojo/build.gradle.kts (1)

40-48: Packaging list looks good

Using pluginModule for the Mojo sub-modules is the right choice and matches the new DSL.

mason/mason2/core/build.gradle.kts (1)

55-59: Missing default for templating_lexer_skeleton property

If the Gradle property is not provided, the map will yield an unresolved provider and the
lexer task will fail when realised. Add a sensible default or use orElse.

-    skeleton = providers.gradleProperty("templating_lexer_skeleton").map { rootProject.file(it) }
+    skeleton = providers
+      .gradleProperty("templating_lexer_skeleton")
+      .map(rootProject::file)
+      .orElse(rootProject.file("gradle/lexer/templating.skeleton"))
plugin/core/build.gradle.kts (1)

52-53: Possible typo – bundledModule vs bundledModules

All other build scripts in this PR use the plural bundledModules(...).
Unless you have an extension that adds a singular form, Gradle will fail with “unresolved reference” here.

-    bundledModule("intellij.spellchecker")
+    bundledModules("intellij.spellchecker")

Please double-check the API or align with the plural form used elsewhere.

plugin/build.gradle.kts (1)

31-48: Provider passed where a plain list is expected – verify plugins(pluginList) & bundledPlugins(bundledPluginList)

plugins(...) and bundledPlugins(...) from the IntelliJ-Platform Gradle plugin historically accept vararg String or Iterable<String>, not Provider<List<String>>.
If no matching overload exists the build will fail with a type-mismatch.

Consider:

-      plugins(pluginList)
+      plugins(pluginList.get())

and

-      bundledPlugins(bundledPluginList)
+      bundledPlugins(bundledPluginList.get())

or, if the new API supports Provider, ignore this note.

build.gradle.kts (1)

60-62: Check that the declared JGit snapshot actually exists

org.eclipse.jgit:org.eclipse.jgit:7.3.0.202506031305-r looks like a future timestamp. Make sure it is published to Maven Central or your build will break for anyone without the artifact in a custom repository.

Comment on lines 26 to 33
val platformVersionProvider: Provider<String> by rootProject.extra
create("IC", platformVersionProvider.get(), useInstaller = providers.gradleProperty("useInstaller").get().toBoolean())

create(
type = provider { IntelliJPlatformType.IntellijIdeaCommunity },
version = platformVersionProvider,
useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Provide a safe default for useInstaller to prevent build failures

providers.gradleProperty("useInstaller") returns a provider that is absent when the property is not supplied.
Attempting to access it without a fallback (map { it.toBoolean() }) will throw at resolution time.

-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      useInstaller = providers.gradleProperty("useInstaller")
+        .map(String::toBoolean)        // transform only if present
+        .orElse(false),                // safe default

This mirrors the common JetBrains-plugin samples and keeps CI green even when the flag is omitted.

🤖 Prompt for AI Agents
In mason/htmlmason/common/build.gradle.kts around lines 26 to 33, the
useInstaller property is accessed without a safe default, causing build failures
if the property is not supplied. Fix this by providing a fallback value using
orElse("false") before mapping to boolean, ensuring the provider always has a
value and preventing resolution-time exceptions.

Comment on lines 26 to +33
intellijPlatform {
val platformVersionProvider: Provider<String> by rootProject.extra
create("IC", platformVersionProvider.get(), useInstaller = providers.gradleProperty("useInstaller").get().toBoolean())

create(
type = provider { IntelliJPlatformType.IntellijIdeaCommunity },
version = platformVersionProvider,
useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add orElse(false) for resilience

Same concern as in mason/htmlmason/common: without a default, missing -PuseInstaller causes an exception during task graph resolution.
Recommend the identical tweak:

-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      useInstaller = providers.gradleProperty("useInstaller")
+        .map(String::toBoolean)
+        .orElse(false),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
intellijPlatform {
val platformVersionProvider: Provider<String> by rootProject.extra
create("IC", platformVersionProvider.get(), useInstaller = providers.gradleProperty("useInstaller").get().toBoolean())
create(
type = provider { IntelliJPlatformType.IntellijIdeaCommunity },
version = platformVersionProvider,
useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
)
intellijPlatform {
val platformVersionProvider: Provider<String> by rootProject.extra
create(
type = provider { IntelliJPlatformType.IntellijIdeaCommunity },
version = platformVersionProvider,
useInstaller = providers.gradleProperty("useInstaller")
.map(String::toBoolean)
.orElse(false),
)
🤖 Prompt for AI Agents
In mason/htmlmason/frontend/build.gradle.kts around lines 26 to 33, the
useInstaller property is accessed via providers.gradleProperty("useInstaller")
without a default fallback, which can cause an exception if the property is
missing. Fix this by appending orElse("false") to provide a default value, then
convert it to boolean. This ensures resilience by preventing exceptions during
task graph resolution when the property is not set.

Comment on lines 26 to 33
val platformVersionProvider: Provider<String> by rootProject.extra
create("IC", platformVersionProvider.get(), useInstaller = providers.gradleProperty("useInstaller").get().toBoolean())

create(
type = provider { IntelliJPlatformType.IntellijIdeaCommunity },
version = platformVersionProvider,
useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Harden useInstaller handling

Apply the same safe-default pattern here to avoid fragile builds:

-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      useInstaller = providers.gradleProperty("useInstaller")
+        .map(String::toBoolean)
+        .orElse(false),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
val platformVersionProvider: Provider<String> by rootProject.extra
create("IC", platformVersionProvider.get(), useInstaller = providers.gradleProperty("useInstaller").get().toBoolean())
create(
type = provider { IntelliJPlatformType.IntellijIdeaCommunity },
version = platformVersionProvider,
useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
)
}
val platformVersionProvider: Provider<String> by rootProject.extra
create(
type = provider { IntelliJPlatformType.IntellijIdeaCommunity },
version = platformVersionProvider,
useInstaller = providers.gradleProperty("useInstaller")
.map(String::toBoolean)
.orElse(false),
)
}
🤖 Prompt for AI Agents
In plugin/frontend/build.gradle.kts around lines 26 to 33, the useInstaller
property is directly converted to boolean without a safe default, which can
cause fragile builds if the property is missing or malformed. Modify the
useInstaller assignment to provide a safe default value (e.g., false) when the
Gradle property "useInstaller" is not set or empty by using a fallback or
default method on the provider before mapping to boolean.

Comment on lines +25 to +26
useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Missing fallback when useInstaller property is absent

providers.gradleProperty("useInstaller") fails the build if the property is not supplied on the command line or via gradle.properties.
Add a defensive default to avoid unexpected resolution errors in CI / local runs.

-      useInstaller = providers.gradleProperty("useInstaller").map { it.toBoolean() },
+      useInstaller = providers.gradleProperty("useInstaller")
+        .map(String::toBoolean)
+        .orElse(false),
🤖 Prompt for AI Agents
In plugin/asdf/build.gradle.kts around lines 25 to 26, the useInstaller property
is set directly from providers.gradleProperty("useInstaller") which causes build
failures if the property is missing. To fix this, add a fallback default value
(e.g., false) when the property is absent by using orElse("false") before
mapping to boolean. This ensures the build does not fail due to missing property
in CI or local runs.

Comment on lines +28 to +35
listOf(
":plugin.core",
":plugin.perlInstall",
).forEach {
compileOnly(project(it))
testCompileOnly(project(it))
pluginModule(project(it))
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

compileOnly / testCompileOnly inside intellijPlatform block is misleading

compileOnly and testCompileOnly belong to the regular Gradle dependency scopes, not to the intellijPlatform { … } DSL.
Keeping them here works only by coincidence (method-resolution from the outer dependencies scope) and couples unrelated concerns. Move them out for clarity:

-    listOf(
-      ":plugin.core",
-      ":plugin.perlInstall",
-    ).forEach {
-      compileOnly(project(it))
-      testCompileOnly(project(it))
-      pluginModule(project(it))
-    }
+  }
+}
+
+listOf(
+  ":plugin.core",
+  ":plugin.perlInstall",
+).forEach {
+  dependencies {
+    compileOnly(project(it))
+    testCompileOnly(project(it))
+  }
+  intellijPlatform {
+    pluginModule(project(it))
+  }
 }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In plugin/asdf/build.gradle.kts around lines 28 to 35, the compileOnly and
testCompileOnly calls are placed inside the intellijPlatform block, which is
misleading because these are standard Gradle dependency scopes and not part of
the intellijPlatform DSL. To fix this, move the compileOnly and testCompileOnly
calls outside the intellijPlatform block into the regular dependencies block to
separate concerns and improve clarity.

Comment on lines +61 to +63
rootProject.tasks.named { it == "generateLexers" }.configureEach {
dependsOn(generateHTMLMasonLexer)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Same tasks.named predicate issue as above

-rootProject.tasks.named { it == "generateLexers" }.configureEach {
-  dependsOn(generateHTMLMasonLexer)
-}
+rootProject.tasks.named("generateLexers") {
+  dependsOn(generateHTMLMasonLexer)
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
rootProject.tasks.named { it == "generateLexers" }.configureEach {
dependsOn(generateHTMLMasonLexer)
}
rootProject.tasks.named("generateLexers") {
dependsOn(generateHTMLMasonLexer)
}
🤖 Prompt for AI Agents
In mason/htmlmason/core/build.gradle.kts around lines 61 to 63, the use of
tasks.named with a predicate is incorrect. Replace the predicate form with a
direct task name string argument in tasks.named, like
tasks.named("generateLexers"), to properly reference the task. Then configure
the dependency inside the configureEach block as intended.

Comment on lines +72 to +74
rootProject.tasks.named { it == "generateLexers" }.configureEach {
dependsOn(generateTT2Lexer)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix invalid named call to wire lexer generation task

-rootProject.tasks.named { it == "generateLexers" }.configureEach {
-  dependsOn(generateTT2Lexer)
-}
+rootProject.tasks.named("generateLexers") {
+  dependsOn(generateTT2Lexer)
+}
🤖 Prompt for AI Agents
In tt2/core/build.gradle.kts around lines 72 to 74, the use of the named call is
incorrect because it uses a predicate instead of the task name string. Replace
the named call argument with the exact task name string "generateLexers" to
correctly reference the task. This will properly configure the dependency on
generateTT2Lexer.

Comment on lines +59 to +61
rootProject.tasks.named { it == "generateLexers" }.configureEach {
dependsOn(generateMojoliciousLexer)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Correct named usage for Mojolicious lexer dependency

-rootProject.tasks.named { it == "generateLexers" }.configureEach {
-  dependsOn(generateMojoliciousLexer)
-}
+rootProject.tasks.named("generateLexers") {
+  dependsOn(generateMojoliciousLexer)
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
rootProject.tasks.named { it == "generateLexers" }.configureEach {
dependsOn(generateMojoliciousLexer)
}
rootProject.tasks.named("generateLexers") {
dependsOn(generateMojoliciousLexer)
}
🤖 Prompt for AI Agents
In mojo/core/build.gradle.kts around lines 59 to 61, the usage of the named
function is incorrect for specifying the "generateLexers" task. Replace the
lambda with a direct string argument "generateLexers" in the named function call
to correctly reference the task by name. This will properly configure the
dependency on generateMojoliciousLexer.

Comment on lines +82 to 87
rootProject.tasks.named { it == "generateLexers" }.configureEach {
dependsOn(
generatePerlLexer,
generatePodLexer,
)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

tasks.named { … } is an invalid overload – this will not compile

TaskContainer.named() expects the task name (String / Name) or (name, type), not a lambda.
The current call tries to pass a Boolean and will explode at configuration time.

-  rootProject.tasks.named { it == "generateLexers" }.configureEach {
+  rootProject.tasks.matching { it.name == "generateLexers" }.configureEach {
     dependsOn(
       generatePerlLexer,
       generatePodLexer,
     )
   }

Alternatively, if the task is guaranteed to exist:

rootProject.tasks.named("generateLexers") {
  dependsOn(generatePerlLexer, generatePodLexer)
}
🤖 Prompt for AI Agents
In plugin/core/build.gradle.kts around lines 82 to 87, the use of tasks.named
with a lambda predicate is incorrect and causes a compilation error. Replace the
call to tasks.named { it == "generateLexers" } with
tasks.named("generateLexers") to directly reference the task by name. Then
configure the dependsOn relationship inside the lambda passed to
tasks.named("generateLexers").

Comment on lines +60 to +62
rootProject.tasks.named { it == "generateLexers" }.configureEach {
dependsOn(generateEmbeddedPerlLexer)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Same tasks.named { … } misuse here

Replace the boolean predicate with either tasks.matching { it.name == "generateLexers" } or tasks.named("generateLexers") as shown in the plugin/core fix.

🤖 Prompt for AI Agents
In embedded/core/build.gradle.kts around lines 60 to 62, the code incorrectly
uses tasks.named with a boolean predicate, which is not supported. Replace
tasks.named { it == "generateLexers" } with tasks.named("generateLexers") to
correctly reference the task by name, then call configureEach on it to add the
dependency on generateEmbeddedPerlLexer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants