Skip to content

Commit dc56a8b

Browse files
reidspencerclaude
andcommitted
Release 1.2.0: Cleanup, new helpers, and documentation
Breaking change: CrossModule dependencies now opt-in - Removed automatic scalatest and scala-java-time dependencies - Use With.Scalatest() and With.ScalaJavaTime() explicitly New helpers: - With.Publishing (defaults to GitHub, .sonatype option available) - With.ScalaJavaTime() for cross-platform java.time support - With.ClassPathJar, With.UnmanagedJars, With.ShellPrompt exposed Cleanup: - Removed NodeTarget dead code from CrossModule - Removed placeholder Packaging methods (jdkPackager, linuxDebian, linuxRPM) - Removed obsolete project/SonatypePublishing.scala - Made Root project ID configurable via projectId parameter - Parameterized versions in ScalaJS and Native helpers Documentation: - Updated README with migration notes for 1.2.0 - Documented all new helpers and parameters Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c687458 commit dc56a8b

7 files changed

Lines changed: 91 additions & 113 deletions

File tree

NOTEBOOK.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
## Current Status
44

5-
Version 1.1.0 released. Significant maintenance work completed Jan 17, 2026
6-
addressing most of the 15 UX issues identified in the maintenance analysis.
7-
All 16 scripted tests now passing (100%). Key changes include:
5+
**Version 1.2.0 ready for release.** Significant maintenance work completed Jan 17, 2026
6+
addressing all 15 UX issues identified in the maintenance analysis.
7+
All 16 scripted tests passing (100%). Key changes since 1.1.0:
88
- CrossModule dependencies now opt-in (breaking change)
9-
- New helpers: `With.Publishing`, `With.ScalaJavaTime()`
9+
- New helpers: `With.Publishing`, `With.ScalaJavaTime()`, `With.ClassPathJar`, `With.UnmanagedJars`, `With.ShellPrompt`
1010
- Improved error messages when Root() not configured
1111
- Parameterized dependency versions in ScalaJS/Native helpers
12+
- Configurable Root project ID
13+
- Removed dead code (NodeTarget, placeholder Packaging methods)
14+
- Removed obsolete project/SonatypePublishing.scala
1215

1316
## Work Completed (Recent)
1417

README.md

Lines changed: 59 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ In your `project/plugins.sbt` file, add the GitHub Packages resolver and the plu
8282
// GitHub Packages resolver for sbt-ossuminc
8383
resolvers += "GitHub Packages" at "https://maven.pkg.github.com/ossuminc/sbt-ossuminc"
8484

85-
addSbtPlugin("com.ossuminc" % "sbt-ossuminc" % "1.1.0")
85+
addSbtPlugin("com.ossuminc" % "sbt-ossuminc" % "1.2.0")
8686
```
8787

8888
### ~/sbt/1.0/github.sbt
@@ -225,15 +225,16 @@ then your commands get passed down to the sub-projects.
225225

226226
For example, this:
227227

228-
```scala
228+
```scala
229229
lazy val riddl: Project = Root(
230230
ghRepoName = "my-project",
231231
ghOrgName = "my-organization",
232232
orgPackage = "com.my_org.my_proj",
233233
orgName = "My Organization",
234234
orgPage = url("https://my_org.com/"),
235-
maintainerEmail = "somebody@my_org.com",
236-
startYr = 2024)
235+
startYr = 2024,
236+
projectId = "root" // Optional: customize sbt project ID (default: "root")
237+
)
237238
.configure(With.noPublishing, With.git, With.dynver)
238239
.aggregate(
239240
module0, // a sub-component of your project
@@ -412,6 +413,10 @@ These helpers take no parameters (or use all defaults):
412413
* **`With.scalajs`** - Enable Scala.js compilation (default configuration)
413414
* **`With.noMiMa`** - Disable binary compatibility checking
414415
* **`With.noPublishing`** - Disable artifact publishing (useful for root aggregator projects)
416+
* **`With.ScalaJavaTime()`** - Add `scala-java-time` dependency for cross-platform `java.time` API
417+
* **`With.ClassPathJar`** - Use classpath JAR for packaging (reduces command line length)
418+
* **`With.UnmanagedJars`** - Use unmanaged JAR files from `libs/` directory
419+
* **`With.ShellPrompt`** - Custom shell prompt showing project name, git branch, and version
415420
* **`With.release`** - Enable `sbt-release` plugin
416421
* **`With.resolvers`** - Add standard resolvers (Maven Local, JCenter, Typesafe)
417422
* **`With.scala2`** - Configure for Scala 2.13 (latest)
@@ -420,10 +425,13 @@ These helpers take no parameters (or use all defaults):
420425

421426
### Publishing Helpers
422427

423-
* **`With.GithubPublishing`** - Configure publishing to GitHub Packages
424-
* **`With.SonatypePublishing`** - Configure publishing to Sonatype/Maven Central
428+
* **`With.Publishing`** - Configure publishing (defaults to GitHub Packages)
429+
* **`With.Publishing.github`** - Explicitly configure GitHub Packages publishing
430+
* **`With.Publishing.sonatype`** - Configure publishing to Sonatype/Maven Central
431+
* **`With.GithubPublishing`** - Alias for `With.Publishing.github`
432+
* **`With.SonatypePublishing`** - Alias for `With.Publishing.sonatype`
425433

426-
> **Note**: Do not combine GithubPublishing and SonatypePublishing in the same project.
434+
> **Note**: Do not combine GitHub and Sonatype publishing in the same project.
427435
428436
### Composite Helpers
429437

@@ -521,13 +529,16 @@ Configure Scala.js compilation.
521529
- **`hasMain`**: Enable main module initializer
522530
- **`forProd`**: Enable optimizer (production mode)
523531
- **`withCommonJSModule`**: Use CommonJS modules instead of ES modules
532+
- **`scalaJavaTimeVersion`**: Override scala-java-time version (default: `"2.6.0"`)
533+
- **`scalatestVersion`**: Override scalatest version (default: `"3.2.19"`)
524534

525535
```scala
526536
CrossModule("my-ui", "ui")(JVM, JS)
527537
.jsConfigure(With.ScalaJS(
528538
header = "My App UI v1.0",
529539
hasMain = true,
530-
forProd = true
540+
forProd = true,
541+
scalaJavaTimeVersion = "2.6.0"
531542
))
532543
```
533544

@@ -573,12 +584,14 @@ Configure Scala Native compilation.
573584
- **`verbose`**: Verbose compilation output
574585
- **`targetTriple`**: Target platform triple (optional)
575586
- **`linkOptions`**: Additional linker options
587+
- **`scalatestVersion`**: Override scalatest version (default: `"3.2.19"`)
576588

577589
```scala
578590
CrossModule("cli-tool", "tool")(JVM, Native)
579591
.nativeConfigure(With.Native(
580592
mode = "release",
581-
buildTarget = "application"
593+
buildTarget = "application",
594+
scalatestVersion = "3.2.19"
582595
))
583596
```
584597

@@ -684,6 +697,42 @@ DocSite(
684697
)
685698
```
686699

687-
700+
## Migration Notes
701+
702+
### Migrating from 1.1.0 to 1.2.0
703+
704+
#### Breaking Change: CrossModule Dependencies Now Opt-In
705+
706+
In 1.1.0, `CrossModule` automatically included testing and time dependencies. In 1.2.0, these are now opt-in for cleaner, more explicit builds.
707+
708+
```scala
709+
// Old (1.1.0) - dependencies were automatic
710+
CrossModule("foo", "bar")(JVM, JS)
711+
712+
// New (1.2.0) - explicitly add what you need
713+
CrossModule("foo", "bar")(JVM, JS)
714+
.configure(With.Scalatest()) // Add if you need testing
715+
.configure(With.ScalaJavaTime()) // Add if you need java.time API
716+
```
717+
718+
#### New Helpers in 1.2.0
719+
720+
* **`With.Publishing`** - Generic publishing helper (defaults to GitHub Packages)
721+
- Use `With.Publishing` for default (GitHub) publishing
722+
- Use `With.Publishing.github` to explicitly use GitHub Packages
723+
- Use `With.Publishing.sonatype` for Sonatype/Maven Central
724+
725+
* **`With.ScalaJavaTime()`** - Add `scala-java-time` dependency for cross-platform date/time support
726+
727+
* **`With.ClassPathJar`** - Use classpath JAR to reduce command line length on Windows
728+
729+
* **`With.UnmanagedJars`** - Configure unmanaged JAR files from `libs/` directory
730+
731+
* **`With.ShellPrompt`** - Custom sbt shell prompt with project, branch, and version info
732+
733+
#### Other Changes
734+
735+
* **`Root()` project ID is now configurable** - Use `projectId` parameter to customize (default: `"root"`)
736+
* **Parameterized versions** - `With.ScalaJS()` and `With.Native()` now accept version parameters to override defaults
688737

689738

project/SonatypePublishing.scala

Lines changed: 0 additions & 80 deletions
This file was deleted.

src/main/scala/com/ossuminc/sbt/CrossModule.scala

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ object CrossModule {
1717
sealed trait Target { def platform: Platform }
1818
case object JVMTarget extends Target { def platform: Platform = JVMPlatform }
1919
case object JSTarget extends Target { def platform: Platform = JSPlatform }
20-
case object NodeTarget extends Target { def platform: Platform = NodePlatform }
2120
case object NativeTarget extends Target { def platform: Platform = NativePlatform }
2221

2322
/** Define a subproject or module of the root project. Make sure to use the [[Root]] function
@@ -67,9 +66,3 @@ object CrossModule {
6766
} else cp4
6867
}
6968
}
70-
71-
case object NodePlatform extends Platform {
72-
def identifier: String = "node"
73-
def sbtSuffix: String = "NODE"
74-
def enable(project: Project): Project = project
75-
}

src/main/scala/com/ossuminc/sbt/OssumIncPlugin.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,16 @@ object OssumIncPlugin extends AutoPlugin {
185185
/** Do not configure binary compatibility checking */
186186
def noMiMa: ConfigFunc = helpers.MiMa.without
187187

188+
/** Use a classpath JAR for packaging (reduces command line length) */
189+
def ClassPathJar: ConfigFunc = helpers.Miscellaneous.useClassPathJar
190+
191+
/** Use unmanaged JAR files from libs/ directory */
192+
def UnmanagedJars: ConfigFunc = helpers.Miscellaneous.useUnmanagedJarLibs
193+
194+
/** Custom shell prompt showing project name, branch, and version */
195+
def ShellPrompt: Def.Initialize[State => String] =
196+
helpers.Miscellaneous.buildShellPrompt
197+
188198
/** Configure project to produce no artifact and not be published */
189199
def noPublishing(project: Project): Project =
190200
project.settings(

src/main/scala/com/ossuminc/sbt/Root.scala

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@ package com.ossuminc.sbt
22

33
import sbt.{Developer, Project, URL, file, url}
44

5-
/** A configuration object for a root project of a monorepo composed of subordinate sbt projects */
5+
/** A configuration object for a root project of a monorepo composed of
6+
* subordinate sbt projects
7+
*/
68
object Root {
79

8-
/** Define a Root level project whether it is for a single-project repo or an unirepo with many subprojects. This
9-
* project is configured with a shell prompt, and the standard project information at ThisBuild scope
10+
/** Define a Root level project whether it is for a single-project repo or
11+
* a unirepo with many subprojects. This project is configured with a shell
12+
* prompt, and the standard project information at ThisBuild scope.
13+
*
1014
* @param ghRepoName
1115
* The name of the GitHub repository we are building
1216
* @param ghOrgName
13-
* THe name of the GitHub organization/user that contains the `ghRepoName`
17+
* The name of the GitHub organization/user that contains the `ghRepoName`
1418
* @param orgPackage
1519
* The organization part of the JVM package this repo uses for its code
1620
* @param orgName
@@ -21,6 +25,10 @@ object Root {
2125
* The year in which this project started, for copyright purposes
2226
* @param devs
2327
* A list of Developer specifications to include in POM (required by Maven)
28+
* @param spdx
29+
* The SPDX license identifier (e.g., "Apache-2.0", "MIT")
30+
* @param projectId
31+
* The sbt project ID (default: "root")
2432
* @return
2533
* The project that was created and configured.
2634
*/
@@ -32,10 +40,11 @@ object Root {
3240
orgPage: URL = url("https://ossuminc.com/"),
3341
startYr: Int = 2023,
3442
devs: List[Developer] = List.empty,
35-
spdx: String = "Apache-2.0"
43+
spdx: String = "Apache-2.0",
44+
projectId: String = "root"
3645
): Project = {
3746
Project
38-
.apply("root", file(System.getProperty("user.dir")))
47+
.apply(projectId, file(System.getProperty("user.dir")))
3948
.enablePlugins(OssumIncPlugin)
4049
.configure(
4150
helpers.RootProjectInfo.initialize(

src/main/scala/com/ossuminc/sbt/helpers/Packaging.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,4 @@ object Packaging extends AutoPluginHelper {
6464
graalVMNativeImageCommand := native_image_path.getAbsolutePath
6565
)
6666
}
67-
68-
def jdkPackager()(project: Project): Project = project
69-
70-
def linuxDebian()(project: Project): Project = project
71-
72-
def linuxRPM()(project: Project): Project = project
7367
}

0 commit comments

Comments
 (0)