Skip to content

docs: Document the sbt-uni-crossproject plugin - #627

Merged
xerial merged 1 commit into
mainfrom
docs/sbt-uni-crossproject
Jun 30, 2026
Merged

docs: Document the sbt-uni-crossproject plugin#627
xerial merged 1 commit into
mainfrom
docs/sbt-uni-crossproject

Conversation

@xerial

@xerial xerial commented Jun 30, 2026

Copy link
Copy Markdown
Member

What

Adds a Build Tooling reference page for sbt-uni-crossproject (merged in #623), mirroring the sbt-uni-playwright page, and links it in both duplicated sidebars in config.mts.

Covers: installation (with __UNI_VERSION__), the crossProject(...) usage and val-name → coreJVM/coreJS/coreNative derivation, the CrossType.Pure directory layout, the %%-on-sbt-2.x note, and a supported-API table — all verified against the merged source.

Validation

pnpm docs:build succeeds (no dead links).

🤖 Generated with Claude Code

Add a Build Tooling reference page for the new minimal sbt 2.x crossproject
plugin (CrossType.Pure), mirroring the sbt-uni-playwright page, and link it in
both duplicated sidebars. Verified with pnpm docs:build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the doc Improvements or additions to documentation label Jun 30, 2026
@xerial
xerial enabled auto-merge (squash) June 30, 2026 19:58
@xerial
xerial merged commit 1cd98c8 into main Jun 30, 2026
15 checks passed
@xerial
xerial deleted the docs/sbt-uni-crossproject branch June 30, 2026 19:58

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds documentation for the new sbt-uni-crossproject plugin, including updating the VitePress sidebar configuration. The review feedback focuses on improving the documentation by using the more idiomatic Test configuration object instead of the string literal "test", ensuring consistency in method naming within the API table, and documenting the .configs(...) method.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

lazy val app = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Pure)
.in(file("app"))
.dependsOn(core, core % "test")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

In sbt, it is more idiomatic and common to use the Test configuration object (e.g., core % Test) rather than the string literal "test" (e.g., core % "test"). Since the scripted tests for this plugin also use core % Test, updating this example to use Test improves consistency and follows standard sbt practices.

Suggested change
.dependsOn(core, core % "test")
.dependsOn(core, core % Test)

Comment on lines +100 to +101
| `.jvmSettings` / `.jsSettings` / `.nativeSettings`| Settings applied to one platform only |
| `.configure(...)` / `.jvmConfigure` / `.jsConfigure` / `.nativeConfigure` | Apply `Project => Project` transforms |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The methods .jvmSettings, .jsSettings, .nativeSettings, .jvmConfigure, .jsConfigure, and .nativeConfigure all accept arguments (e.g., settings definitions or project transformers). Adding parentheses/parameter placeholders (like (...)) to these method names in the table makes them consistent with other methods like .settings(...) and .configure(...).

Suggested change
| `.jvmSettings` / `.jsSettings` / `.nativeSettings`| Settings applied to one platform only |
| `.configure(...)` / `.jvmConfigure` / `.jsConfigure` / `.nativeConfigure` | Apply `Project => Project` transforms |
| .jvmSettings(...) / .jsSettings(...) / .nativeSettings(...) | Settings applied to one platform only |
| .configure(...) / .jvmConfigure(...) / .jsConfigure(...) / .nativeConfigure(...) | Apply Project => Project transforms |

| `.settings(...)` | Settings applied to every platform project |
| `.jvmSettings` / `.jsSettings` / `.nativeSettings`| Settings applied to one platform only |
| `.configure(...)` / `.jvmConfigure` / `.jsConfigure` / `.nativeConfigure` | Apply `Project => Project` transforms |
| `.enablePlugins(...)` / `.disablePlugins(...)` | Enable/disable sbt plugins on every platform project |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The CrossProject class also exposes a public .configs(...) method (defined on line 55 of CrossProject.scala) to add configurations to all platform projects. It would be beneficial to document this method in the API table to ensure completeness.

Suggested change
| `.enablePlugins(...)` / `.disablePlugins(...)` | Enable/disable sbt plugins on every platform project |
| .enablePlugins(...) / .disablePlugins(...) | Enable/disable sbt plugins on every platform project |
| .configs(...) | Add configurations to every platform project |

| `.jvmSettings` / `.jsSettings` / `.nativeSettings`| Settings applied to one platform only |
| `.configure(...)` / `.jvmConfigure` / `.jsConfigure` / `.nativeConfigure` | Apply `Project => Project` transforms |
| `.enablePlugins(...)` / `.disablePlugins(...)` | Enable/disable sbt plugins on every platform project |
| `.dependsOn(other, other % "test")` | Depend on another cross-project, optionally scoped to a config|

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using the Test configuration object is more idiomatic in sbt than the string literal "test". Updating this row to use Test aligns with standard sbt practices.

Suggested change
| `.dependsOn(other, other % "test")` | Depend on another cross-project, optionally scoped to a config|
| .dependsOn(other, other % Test) | Depend on another cross-project, optionally scoped to a config |

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

Labels

doc Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant