Skip to content

v1.0.3

Compare
Choose a tag to compare
@lwronski lwronski released this 08 Aug 17:47
· 1363 commits to main since this release
83bc7bc

What's new

Access project configuration with the new BuildInfo

BuildInfo access your project's build configuration within your Scala code. This feature automatically gathers and generates build information about your project, making project details instantly accessible at runtime.

To generate BuildInfo, either use the --build-info command line option or include the //> using buildInfo directive in your code.

Upon activation, a BuildInfo object becomes accessible on your project's classpath. To use it, simply add the following import into your code:

import scala.cli.build.BuildInfo

This BuildInfo object encapsulates information such as the Scala version used, target platform, main class, scalac options, dependencies, and much more for both Main and Test scopes. The generation ensures up-to-date configuration data from both the console options and using directives in your project's sources.

Added by @MaciejG604 in #2249.

CompileOnly Dependencies

Now, users can declare dependencies that are exclusively included at the compile time. These dependencies are added to the classpath during compilation, but won't be included when the application is run, keeping your runtime environment lightweight.

To declare such a dependency:

  1. Via the using directive:
//> using compileOnly.dep "com.github.plokhotnyuk.jsoniter-scala::jsoniter-scala-macros:2.23.2"
  1. Via the command line:
scala-cli Hello.scala --compile-dep "com.github.plokhotnyuk.jsoniter-scala::jsoniter-scala-macros:2.23.2"

Added by @alexarchambault and @lwronski in #2299, Thanks!

Set globally Java properties

Scala CLI allows users to globally set Java properties for its launcher using the config command. This will simplify the JVM properties management process, eliminating the need to pass these properties with each scala-cli execution.

To set global Java properties execute the following command:

scala-cli config java.properties Djavax.net.ssl.trustStore=cacerts Dfoo=bar2

When modifying Java properties, remember that you must redefine all of them. It's not possible to update just a single property. Essentially, each time you use the config command for Java properties, you replace the entire list of properties.

Whenever overwriting existing Java properties Scala CLI will let you know what was the previous value and in interactive mode ensure that you are ok with replacing them.

Added by @lwronski in #2317, Thanks!

Rename parameter for publish command

We've updated the --version parameter for the publish command. Now, when specifying the project version, use --project-version instead.

scala-cli publish --project-version 1.0.3 ...

Other changes

  • Add custom exception and throw it when node not found in the path by @lwronski in #2323
  • Skip reading ide-options-v2.json if doesn't exist to avoid throwing a… by @lwronski in #2333
  • Skip setting release flag when user pass directly -release or -java-o… by @lwronski in #2321
  • Prevent downloading Java 17 when running a REPL without sources by @lwronski in #2305
  • Extract JAVA_HOME from /usr/libexec/java_home for Mac by @lwronski in #2304
  • Bump case-app, add names limit to HelpFormat, move some name aliases, add test by @MaciejG604 in #2280
  • Build info with compute version @MaciejG604 in #2310

Fixes

  • Fix - install ps, which is necessary for starting Bloop by @lwronski in #2332
  • Load virtual data as byte arrays without encoding using UTF-8 by @lwronski in #2313
  • Accept directive packageType native when using native platform by @lwronski in #2311
  • Ignore url query params @MaciejG604 in #2334

Documentation changes

Build and internal changes

Updates and maintenance

Full Changelog: v1.0.2...v1.0.3