📊 Build status for all bb4 projects
Published Gradle convention plugins for Barry’s bb4 Scala/Java projects.
| Item | Version |
|---|---|
| Gradle (minimum) | 9.1+ (enforced by com.barrybecker4.bb4.settings) |
| Gradle (wrapper in this repo) | 9.9.1 (see gradle/wrapper/gradle-wrapper.properties) |
| Java toolchain | 25 (enforced by com.barrybecker4.bb4.base) |
| Scala (default in plugins) | 3.10.1 (override via bb4 { scalaVersion.set("…") } if needed) |
The Java 25 toolchain requirement means:
- This plugin (
bb4-gradle) is compiled with Java 25, and requires a Gradle daemon running on Java 25 or later to execute. - Consumer projects that apply
com.barrybecker4.bb4.baseorcom.barrybecker4.bb4.scala-librarywill default to Java 25 toolchains for compilation.
Bytecode target: By default, consumer projects produce Java 25 bytecode. To target an older API/bytecode level while keeping the Java 25 toolchain:
bb4 {
release = 21 // or 17, etc. — sets javac --release and scalac -release:
}Leave bb4.release unset for toolchain-only defaults.
Minimum supported: Gradle 9.1+ and JDK 25.
| Plugin ID | Purpose |
|---|---|
com.barrybecker4.bb4.settings |
Settings plugin: Gradle 9.1 floor, Foojay, Central snapshots repo, bb4Libs version catalog, sibling includeBuild substitution |
com.barrybecker4.bb4.base |
Java 25 toolchain, shared repositories, resolution defaults, Central Portal credential property placeholders |
com.barrybecker4.bb4.scala-library |
java-library + Scala, bb4 source layouts, core test deps (JUnit 5.14 + ScalaTest, no Vintage), default Scala flags (-deprecation, -feature, -Wunused:imports), quiet failure test logging with assertions, jar/manifest conventions; optional bb4.htmlReports |
com.barrybecker4.bb4.publish |
maven-publish + signing, Maven Central / Central Portal, sources/javadoc/scaladoc jars (single artifact) |
com.barrybecker4.bb4.application |
application plugin, run stdin, bb4.apps → run* / create*App, website deploy tasks, distribution tweaks; optional bb4.jpackage native installers |
com.barrybecker4.bb4.quality |
Optional Spotless + Scalafmt for scala-source / scala-test (not applied by scala-library) |
Also published from this repo:
| Coordinate | Purpose |
|---|---|
com.barrybecker4:bb4-platform |
Maven BOM of recommended bb4 library and third-party versions |
com.barrybecker4:bb4-catalog |
The same versions as a Gradle version catalog |
Plugin implementations live under src/main/kotlin/. Version numbers live in gradle/libs.versions.toml (packaged into the plugin jar; Bb4DependencyVersions reads the third-party keys).
Plugins publish to Maven Central / snapshots (not only the Plugin Portal). Gradle resolves the settings plugin before that plugin can add repositories, so a short pluginManagement block remains.
Replace <bb4-gradle-version> with the version on Maven Central (or this repo’s gradle.properties while developing locally).
settings.gradle (or .kts):
pluginManagement {
def sibling = new File(settings.settingsDir, '../bb4-gradle')
// Included builds must not include bb4-gradle again.
if (sibling.directory && gradle.parent == null) includeBuild(sibling.canonicalFile)
repositories {
mavenLocal()
gradlePluginPortal()
mavenCentral()
maven { url = 'https://central.sonatype.com/repository/maven-snapshots/' }
}
plugins {
id 'com.barrybecker4.bb4.settings' version '<bb4-gradle-version>'
}
}
plugins {
id 'com.barrybecker4.bb4.settings'
}The settings plugin installs the bb4Libs catalog (not named bb4, which is the project extension), applies Foojay, and includeBuilds neighboring bb4-* checkouts. Pass -Pbb4.includeSiblings=false to disable sibling substitution.
build.gradle (Groovy example):
plugins {
alias(bb4Libs.plugins.scala.library)
alias(bb4Libs.plugins.publish) // if this module publishes
alias(bb4Libs.plugins.application) // optional, for apps
}
group = 'com.barrybecker4'
version = '<bb4-gradle-version>'
dependencies {
implementation bb4Libs.common
implementation bb4Libs.math
// Domain / alignment (not applied by scala-library):
// api bb4Libs.vecmath
// implementation bb4Libs.gson
// implementation platform(bb4Libs.bb4.platform)
// Or without the catalog:
// implementation platform('com.barrybecker4:bb4-platform:<bb4-gradle-version>')
// implementation 'com.barrybecker4:bb4-common'
}
bb4 {
archivesBaseName.set('my-artifact') // optional; defaults to project.name
mainClass.set('com.example.Main') // optional jar manifest / application main
// repository.set('bb4-my-lib') // optional GitHub repo name for POM url/scm
// scalaVersion.set('3.10.1') // optional override (scala-library)
// release = 21 // optional bytecode target (Java + Scala)
// Optional: ScalaTest HTML reporter runtime deps (scala-xml + flexmark-all)
// htmlReports {
// enabled = true
// }
// Optional: multi-app model (run*, create*App start scripts, deployHtml, jpackage).
// Prefer apps over appMap / ext.appMap. Map key mx is accepted as maxHeap.
// apps.put('demo', [title: 'Demo', mainClass: 'com.example.Main', command: 'bb4-demo',
// description: 'd', longDescription: 'd', mx: '512m'])
// Optional: schema root for deploySchemas (default source/schema)
// schemaDirectory.set(layout.projectDirectory.dir('source/schema'))
// Optional: native installers (requires apps/appMap + LICENSE + packaging/icons/<appId>/)
// Uses the project jar as --main-jar.
// jpackage {
// enabled = true
// packageIdentifierPrefix = 'com.example'
// defaultMainClass = 'com.example.Main'
// javaOptions = { appId, props -> ['-ea', '-Dfile.encoding=UTF-8'] }
// arguments = { appId, props -> [] } // each element -> --arguments
// // consoleDesktopTemplate = layout.projectDirectory.file('packaging/linux-console/template.desktop')
// }
}
Each library keeps its own release version in the catalog. A one-library hotfix is: publish that library, bump its line in gradle/libs.versions.toml, and republish bb4-catalog / bb4-platform. An explicit module version in a consumer build overrides the BOM constraint.
Apply bb4.publish only when another project may depend on your Maven coordinates.
App / installer-only repos (bb4-games, bb4-puzzles, bb4-simulations, bb4-adventure,
bb4-aikido-app, bb4-Q-learning, bb4-experimentation, and similar leaf apps) should use
bb4.scala-library + bb4.application (or custom run* tasks) without bb4.publish.
Apply only what you need:
- Settings →
com.barrybecker4.bb4.settings(once per repo). Delete hand-written Foojay and libraryincludeBuildblocks when adopting it. - Library →
alias(bb4Libs.plugins.scala.library)(applies base conventions internally). Usebb4Libs.plugins.basealone only if you want toolchain/repos without applying Scala. - Publish to Sonatype → add
alias(bb4Libs.plugins.publish)(libraries only). - CLI / dist / deploy → add
alias(bb4Libs.plugins.application). Configurebb4.apps(or legacyappMap) so the plugin registersrun*,create*Appstart scripts, and deploy helpers. Schemas copy frombb4.schemaDirectory(defaultsource/schema). PreferinstallDistover the removedcopyToLibtask. - Native installers → with
bb4.application, setbb4.jpackage.enabled = true. Requiresbb4.apps(or legacy appMap), aLICENSEfile, andpackaging/icons/<appId>/icon.{icns,ico,png}. Uses the projectjaras--main-jar(bb4.publishnot required). Run./gradlew jpackageAllApps(orjpackage<AppId>). Release CI can call the reusable workflowbb4/.github/.github/workflows/jpackage-release.yml.
The plugins are designed to work in any application order:
bb4.publishcan be applied before or afterbb4.scala-library. It requires thejavaorjava-libraryplugin to be present (applied automatically byscala-library). For Java-only projects (using onlybb4.base+java-library),bb4.publishwill publish sources and javadoc jars without requiring Scaladoc.bb4.applicationcan be applied before or afterbb4.scala-library/bb4.base. Whenbb4.baseis present,bb4.mainClassis wired toapplication.mainClass. The standardapplicationextension remains fully usable.bb4 {}is owned bybb4.base(also applied insidescala-library).
Supported combinations:
| Plugins applied | Result |
|---|---|
bb4.base alone |
Java 25 toolchain, repositories, resolution defaults, and bb4 {} extension |
bb4.base + java-library |
Plain Java library (no Scala) with typed bb4 {} |
bb4.base + java-library + bb4.publish |
Plain Java library with Maven Central publishing (sources + javadoc); set bb4.repository / archivesBaseName on the extension |
bb4.scala-library |
Scala + Java library (includes bb4.base internally) |
bb4.scala-library + bb4.publish |
Scala library with publishing (sources + javadoc + scaladoc) |
bb4.scala-library + bb4.application |
App / installer-only Scala project (bb4.mainClass wired; no Central publish) |
bb4.scala-library + bb4.publish + bb4.application |
Scala app that also publishes library coordinates (rare) |
bb4.scala-library + bb4.quality |
Same as scala-library, plus Spotless/Scalafmt (spotlessCheck on check) |
Source layout expected by scala-library:
- Java:
source/, tests:test/ - Scala:
scala-source/, tests:scala-test/ - Non-source files in those trees (for example
package.pngbeside a package) are packaged as resources;.javaand.scalaare excluded from the resource pipeline so they are not duplicated into jars.
The plugin project includes a Gradle TestKit functional test suite in src/test/groovy. The suite exercises plugin behavior in temporary consumer projects, covering:
- Plugin application and combinations (all four public plugin IDs)
- Java/Scala compilation with toolchain configuration
- Test engine discovery and execution (JUnit Jupiter 5.14 + ScalaTest; failure-only logging, assertions on)
- Default Scala compiler flags (
-deprecation,-feature,-Wunused:imports) - Maven publication coordinates, POM metadata, and signing decisions (SNAPSHOT vs. release)
- Application distributions and scripts (including paths with spaces and custom build directories)
- Extension value customization
Run the tests locally:
./gradlew testThe CI workflow (.github/workflows/ci.yml) calls the org reusable
bb4-ci workflow
on every push and pull request (build test, SNAPSHOT publish on main).
Full runbook: docs/publishing-sonatype.md. Short version:
- Set
versioningradle.properties(release = no-SNAPSHOT). - Credentials + GPG:
ossrhToken/ossrhTokenPassword(orOSSRH_*env), plus either keyring signing props or in-memorysigningKey/signingPassword(Central Portal user token, not legacy OSSRH). ./gradlew clean buildthen./gradlew publishArtifacts.- Releases: signed bundle → Central Publisher API (
AUTOMATICby default). - Snapshots: deploy to Central maven-snapshots.
- Releases: signed bundle → Central Publisher API (
- After Central is live, commit/tag the release and bump
versioningradle.propertiesto the next-SNAPSHOT.
POM metadata uses project.group, project.description, and bb4.repository (GitHub repo name).
A CycloneDX SBOM (classifier=cyclonedx) is attached to every publication.
Legacy buildscript { classpath 'com.barrybecker4:bb4-gradle:…' } + apply from: …getResource('bb4.gradle') is removed in 2.x. See docs/migration-from-scripts.md.
See CHANGELOG.md.
MIT — see LICENSE.