Build tool for Scala projects
Version 0.1.7 features various UI improvements as well as new commands for running, publishing and documenting modules.
You can follow the linked pull requests for detailed descriptions of the changes.
Use the following command to upgrade Seed:
blp-coursier bootstrap \
-r bintray:tindzk/maven \
tindzk:seed_2.12:0.1.7 \
-f -o seed
The latest stable Bloop version 1.3.2 is recommended. Builds generated by Seed should be compatible with the newer prerelease version 1.4.0-RC1 too.
This release is fully backward-compatible.
The project documentation is now available as a separate website, courtesy of @hejfelix.
This release integrates more tightly with Bloop. Previously, all Seed commands relied on Bloop CLI invocations which had several limitations (see #63). The majority of these were replaced by BSP requests.
This opened up the ability to make various user-facing improvements outlined in the following subsections.
When building modules, Seed subscribes to BSP notifications. Since Bloop publishes structured information on the compilation process, we can show progress bars in all Seed commands involving compilation. This is particularly useful in modular projects and helps to identify bottlenecks in the build pipeline:
In addition to the already-existing link
and build
commands, run
was introduced. The new command is similar to bloop run <module>
which runs the main class of the supplied module. It is currently limited to only one module since programs may be non-terminating.
Seed can now register file watchers and trigger a new compilation pass whenever source files have changed. The watch mode is compatible with long-running processes such as servers:
Furthermore, the user can run operations in parallel on multiple modules defined in the same build (which solves a limitation in Bloop v1.3.2). As an example, this makes the following workflow for client/server applications possible:
seed link client --watch # Terminal 1: Link Scala.js frontend
seed run server --watch # Terminal 2: Run Scala JVM backend
With the new CLI command publish
, modules can be published to a repository. The command packages and uploads the compiled class files, sources and documentation. At the moment, only Maven-style Bintray repositories are supported.
The following example shows how to publish a project to Bintray:
The first step is to define a [package]
section in the build configuration. Afterwards, we set a Git tag for the new release. Finally, running the command seed publish <target> <modules>
builds, packages and uploads the supplied module.
For more information, please refer to the sections on credentials, build configuration and usage in the manual.
A new CLI command doc
is available for generating HTML documentations. doc
takes a list of modules and runs Scaladoc on them separately. It supports Scala 2.11, 2.12 and 2.13, including alternative compilers such as Typelevel Scala.
doc
can be invoked on any module without any changes to the build file:
Several changes were made for Scala.js 1.0 compatibility. Whilst Bloop 1.3.2 does not support Scala.js 1.0 yet, Seed builds are compatible with the upcoming Bloop 1.4.0 release.
Once Bloop 1.4.0 has been published, a new Docker image will be made available too.
Previously, all dependencies were resolved at once. Modular projects are likely to contain libraries with diverging versions across different modules. A Coursier resolution pass merges these duplicate libraries, only retaining the latest version. This may lead to unexpected compile- and runtime behaviour. The new resolution logic solves this limitation by performing a separate resolution pass for each module. As a consequence of these changes, the resolution will be slightly slower, but the speed is still acceptable on larger projects.
Version 0.1.6 fixes numerous bugs, stabilises the generation of IDEA projects and improves error reporting for invalid build files.
You can follow the linked pull requests for a detailed description of the changes.
Use the following command to upgrade Seed:
blp-coursier bootstrap \
-r bintray:tindzk/maven \
tindzk:seed_2.12:0.1.6 \
-f -o seed
Next, make sure you have Bloop v1.3.2 installed. Although builds generated by this Seed release are compatible with v1.3.4, the Bloop version in the Docker image could not be upgraded due to a regression.
This release is fully backward-compatible.
Version 0.1.5 includes usability improvements and fixes a number of bugs. This release adds support for code generation via custom build targets. Finally, all project-level settings are available on modules now.
You can follow the linked pull requests for a detailed description of the changes.
Use the following command to upgrade Seed:
blp-coursier bootstrap \
-r bintray:tindzk/maven \
tindzk:seed_2.12:0.1.5 \
-f -o seed
Next, make sure you have Bloop v1.3.2 installed.
This release is fully backward-compatible.
The CLI output was redesigned to be more succinct and readable. It uses Unicode symbols to indicate the log levels. Messages make better use of colours which allow to identify warnings or errors faster. See the following screenshots for a comparison.
Before:
After:
If you would like to partially revert to the old behaviour, you can set unicode
to false
in the seed.toml
configuration file:
[cli]
unicode = false
Also, the minimum log level can be configured now. The new CLI settings are described here.
Previously, you had to write shell scripts in order to build non-Scala artefacts. This proved difficult when artefacts were built in multiple dependent modules and had to be copied over to the root project's build path. Now you can define custom build targets on modules and run commands as part of the build process. For example, if you would like to copy font assets to your build path, you can include the following definition:
[module.template.target.fonts]
root = "fonts"
command = "cp -Rv fonts $BUILD_PATH"
Besides spawning commands, you can run any main class defined in the project. For instance, to generate a JSON file for your Scala.js application, you could write a script and reference it in a build target:
[module.layouts.target.js-bundle]
root = "layouts"
class = ["keyboard:jvm", "keyboard.Bundle"]
Since we set the root path on these two modules, Seed will also generate IDEA modules for them.
You can inherit these build targets via moduleDeps
. Whenever app
is linked (seed link app
), the build targets will be run too. Note that like regular modules, build targets are inherited transitively.
[module.app.js]
moduleDeps = ["template", "layouts"]
# ...
If you would like to only run a specific build target, a new CLI command (build
) was introduced:
seed build template:fonts
For more information, please refer to the documentation.
Until now, every build required a [project]
section which defined global build settings. Since 0.1.5, these settings are available on modules too.
Instead of:
[project]
scalaVersion = "2.11.11"
scalaNativeVersion = "0.3.7"
[module.demo.native]
sources = ["src/"]
You could write:
[module.demo.native]
scalaVersion = "2.11.11"
scalaNativeVersion = "0.3.7"
sources = ["src/"]
As a consequence, you can define scalaOptions
on a base module and set additional Scala options on platform modules. For example:
[module.demo]
scalaOptions = ["-Yliteral-types"]
[module.demo.js]
scalaOptions = ["-P:scalajs:sjsDefinedByDefault"]
This means that every module is compiled exactly with the Scala version and options it was defined with. Therefore, it is not possible to depend on modules which have an incompatible Scala version. Including a 2.12 module in a 2.13 module will trigger an error henceforth.
This change is the first step towards supporting the Metals language server (see #15). Previously, the resolution modules were not populated which prevented code navigation. If you would like to generate this Bloop section, set the following option in seed.toml
:
[resolution]
optionalArtefacts = true
For more information, please refer to the documentation.
--optimise
parameter to link
command (#42)Version 0.1.4 implements a server mode and fixes a couple of inheritance-related bugs. The Docker image comes with the latest Bloop which is compatible with Scala 2.13.
You can follow the linked pull requests for a detailed description of the changes.
Use the following command to upgrade Seed:
blp-coursier bootstrap \
-r bintray:tindzk/maven \
tindzk:seed_2.12:0.1.4 \
-f -o seed
Next, upgrade Bloop to v1.3.2.
This release is fully backward-compatible.
You can now link modules directly from Seed:
seed link <module>
This will link all platform modulesseed link <module>:js
This will link only the JavaScript moduleThe second new feature is the ability to run Seed in server mode (seed server
). You can use the server as a message bus and trigger linking from the IDE or the command line. At the same time, you can have multiple event listeners that subscribe to build status events, for example in order to reload the web page or browser extension after your build completed.
For more information, please refer to the documentation.
Version 0.1.3 implements two new features, a number of bug fixes and improved test coverage. You can follow the linked pull requests for a detailed description of the changes.
Use the following command to upgrade Seed:
blp-coursier bootstrap \
-r bintray:tindzk/maven \
tindzk:seed_2.12:0.1.3 \
-f -o seed
This release is fully backward-compatible.
On scalaDeps
, you can now specify a fourth parameter for the version tag. For example, this allows you to include dependencies that target specific Scala versions:
scalaDeps = [
["org.scalameta", "interactive", "4.1.0", "full"]
]
With the new compilerDeps
setting you can depend on compiler plug-ins in your build:
[module.macros.js]
compilerDeps = [
["org.scalamacros", "paradise", "2.1.1", "full"]
]
A complete cross-compiled example can be found here.
branch
is not available for tag events (5f48fa54a4b736fc61489efb2ee6f5674cc2ed56)