scala-cli
scala-cli copied to clipboard
Run all cross builds when `--cross` is passed
Fixes #3590 Fixes #3026
Given smth.sc like this
//> using scala 3 2.13 2.12
println("Hello")
Before these changes, running with --cross would compile against all cross versions, but only run against the first one passed (with no indication via logs, either):
scala-cli smth.sc
# Compiling project (Scala 3.7.1, JVM (23))
# Compiled project (Scala 3.7.1, JVM (23))
# Hello
scala-cli clean .
scala-cli smth.sc --cross --power
# The `--cross` option is experimental
# Please bear in mind that non-ideal user experience should be expected.
# If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli
# Compiling project (Scala 3.7.1, JVM (23))
# Compiled project (Scala 3.7.1, JVM (23))
# Compiling project (Scala 2.13.16, JVM (23))
# Compiled project (Scala 2.13.16, JVM (23))
# Compiling project (Scala 2.12.20, JVM (23))
# Compiled project (Scala 2.12.20, JVM (23))
# Hello
Now it actually gets run for each configuration, as it should (and there're some logs for sanity's sake):
scala-cli smth.sc
# Compiling project (Scala 3.7.1, JVM (23))
# Compiled project (Scala 3.7.1, JVM (23))
# Cross-building is disabled, ignoring 2 builds:
# Scala 2.13, JVM
# Scala 2.12, JVM
# Cross builds are only available when the --cross option is passed.
# Defaulting to Scala 3.7.1, JVM
# Hello
scala-cli clean .
scala-cli smth.sc --cross --power
# The `--cross` option is experimental
# Please bear in mind that non-ideal user experience should be expected.
# If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli
# Compiling project (Scala 3.7.1, JVM (23))
# Compiled project (Scala 3.7.1, JVM (23))
# Compiling project (Scala 2.13.16, JVM (23))
# Compiled project (Scala 2.13.16, JVM (23))
# Compiling project (Scala 2.12.20, JVM (23))
# Compiled project (Scala 2.12.20, JVM (23))
# Hello
# Hello
# Hello