Skip to content

0.1.5

Compare
Choose a tag to compare
@tindzk tindzk released this 16 Aug 09:28
· 71 commits to master since this release

Release Summary πŸ“

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.

Migration Steps πŸ’»

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.

New Features πŸš€

Improved CLI output (#26)

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:
old

After:
new

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.

Custom build targets (#19)

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.

Module-level build settings (#45)

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.

Bloop: Populate resolution modules (#37)

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.

Bug Fixes πŸ”₯

  • IDEA: Set language level for Scala library (#20)
  • ProcessHelper: Exit when command returned with non-zero code (#25)
  • Package: Skip entries that were already added to the JAR file (#28)
  • Fix inheritance of compiler plug-ins (#29)
  • BuildTarget: Create build path if it does not exist (#32)
  • Bloop: Fix output path of submodules (#33)
  • MavenCentral: Fix parsing of library artefacts (#34)
  • Scaffold: Only return compatible compiler versions (#35)
  • SemanticVersioning: Fix parsing of large pre-release versions (#41)
  • BuildConfig: Only include modules with same platform in classpath (#43)
  • IDEA: Do not skip modules that only have test sources (#44)
  • BuildConfig: Fix inheritance of settings on test modules (#46)

Improvements ⭐

  • Implement custom build targets (#19)
  • Build: Upgrade Alpine Linux base image to v3.10 (#21)
  • Refactor build path logic (#22)
  • README: Add Gitter badge (#24)
  • Improve CLI output (#26)
  • Improve scaffold command (#27)
  • Build all test projects in temporary folder (#31)
  • Use ZIO instead of Futures (#36)
  • Bloop: Populate resolution modules (#37)
  • Add scalafmt configuration and reformat code (#40)
  • Cli: Add --optimise parameter to link command (#42)