diff --git a/.github/release/release-procedure.md b/.github/release/release-procedure.md index 59f54075f4..d0829fddb1 100644 --- a/.github/release/release-procedure.md +++ b/.github/release/release-procedure.md @@ -15,6 +15,8 @@ - [ ] Copy any fixes over to the draft after getting the PR reviewed and merged. - [ ] Mark the release draft as `pre-release` and then `Publish Release` - [ ] Wait for a green release CI build with all the updated versions. + - [ ] Double check if none of the steps failed, including individual distribution channels in + the `update-packages` and `windows-packages` jobs. - [ ] ScalaCLI Setup - [ ] Merge pull request with updated Scala CLI version in [scala-cli-setup](https://github.com/VirtusLab/scala-cli-setup) repository. Pull request should be opened diff --git a/.github/scripts/get-latest-cs.sh b/.github/scripts/get-latest-cs.sh index 75452b0840..ec4e5a9256 100644 --- a/.github/scripts/get-latest-cs.sh +++ b/.github/scripts/get-latest-cs.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -e -CS_VERSION="2.1.13" +CS_VERSION="2.1.17" DIR="$(cs get --archive "https://github.com/coursier/coursier/releases/download/v$CS_VERSION/cs-x86_64-pc-win32.zip")" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a818da4f8..e9fdc6cd29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1592,7 +1592,48 @@ jobs: retention-days: 2 publish: - needs: [unit-tests, jvm-tests-1, jvm-tests-2, jvm-tests-3, jvm-tests-4, jvm-tests-5, format, checks, reference-doc] + needs: + - unit-tests + - jvm-tests-1 + - jvm-tests-2 + - jvm-tests-3 + - jvm-tests-4 + - jvm-tests-5 + - native-linux-tests-1 + - native-linux-tests-2 + - native-linux-tests-3 + - native-linux-tests-4 + - native-linux-tests-5 + - native-macos-tests-1 + - native-macos-tests-2 + - native-macos-tests-3 + - native-macos-tests-4 + - native-macos-tests-5 + - native-macos-m1-tests-1 + - native-macos-m1-tests-2 + - native-macos-m1-tests-3 + - native-macos-m1-tests-4 + - native-macos-m1-tests-5 + - native-windows-tests-1 + - native-windows-tests-2 + - native-windows-tests-3 + - native-windows-tests-4 + - native-windows-tests-5 + - native-mostly-static-tests-1 + - native-mostly-static-tests-2 + - native-mostly-static-tests-3 + - native-mostly-static-tests-4 + - native-mostly-static-tests-5 + - native-static-tests-1 + - native-static-tests-2 + - native-static-tests-3 + - native-static-tests-4 + - native-static-tests-5 + - vc-redist + - format + - checks + - reference-doc + - docs-tests if: github.event_name == 'push' && github.repository == 'VirtusLab/scala-cli' runs-on: ubuntu-20.04 steps: @@ -1787,31 +1828,38 @@ jobs: ${{ secrets.HOMEBREW_SCALA_EXPERIMENTAL_KEY }} ${{ secrets.SCALA_CLI_SETUP_KEY }} - run: ./mill -i ci.updateInstallationScript + continue-on-error: true - run: ./mill -i ci.updateScalaCliBrewFormula + continue-on-error: true - name: GPG setup run: .github/scripts/gpg-setup.sh env: PGP_SECRET: ${{ secrets.PGP_SECRET }} - run: ./mill -i ci.updateDebianPackages + continue-on-error: true env: PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} GPG_EMAIL: ${{ secrets.GPG_EMAIL }} - run: ./mill -i ci.updateCentOsPackages + continue-on-error: true env: PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} KEYGRIP: ${{ secrets.KEYGRIP }} PGP_SECRET: ${{ secrets.PGP_SECRET }} GPG_EMAIL: ${{ secrets.GPG_EMAIL }} - run: ./mill -i ci.updateStandaloneLauncher + continue-on-error: true env: UPLOAD_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Publish to SDKMAN + continue-on-error: true run: .github/scripts/publish-sdkman.sh shell: bash env: SDKMAN_KEY: ${{ secrets.SDKMAN_KEY }} SDKMAN_TOKEN: ${{ secrets.SDKMAN_TOKEN }} - run: ./mill -i ci.updateScalaCliSetup + continue-on-error: true - run: ./mill -i ci.updateScalaExperimentalBrewFormula update-windows-packages: @@ -1835,6 +1883,7 @@ jobs: path: artifacts/ - name: Publish to chocolatey run: ./mill -i ci.updateChocolateyPackage + continue-on-error: true env: CHOCO_SECRET: ${{ secrets.CHOCO_SECRET_KEY }} - uses: vedantmgoyal9/winget-releaser@main diff --git a/.mill-version b/.mill-version index bd0119f963..44ab23e43e 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.11.12 +0.11.13 diff --git a/build.sc b/build.sc index 1ea08965f2..3bcc4b3bc6 100644 --- a/build.sc +++ b/build.sc @@ -1,6 +1,6 @@ import $ivy.`com.lihaoyi::mill-contrib-bloop:$MILL_VERSION` -import $ivy.`io.get-coursier::coursier-launcher:2.1.13` -import $ivy.`io.github.alexarchambault.mill::mill-native-image-upload:0.1.26` +import $ivy.`io.get-coursier::coursier-launcher:2.1.17` +import $ivy.`io.github.alexarchambault.mill::mill-native-image-upload:0.1.29` import $file.project.deps, deps.{Deps, Docker, InternalDeps, Java, Scala, TestDeps} import $file.project.publish, publish.{ghOrg, ghName, ScalaCliPublishModule, organization} import $file.project.settings, settings.{ @@ -228,6 +228,7 @@ trait GenerateReferenceDoc extends CrossSbtModule with ScalaCliScalafixModule { ) def repositoriesTask = T.task(super.repositoriesTask() ++ customRepositories) def ivyDeps = Agg( + Deps.argonautShapeless, Deps.caseApp, Deps.munit ) @@ -1819,7 +1820,7 @@ object ci extends Module { "--env", "GPG_EMAIL", "--env", "KEYGRIP", "--privileged", - "fedora", + "fedora:40", "sh", "updateCentOsPackages.sh" ) // format: on diff --git a/mill b/mill index 817bc103a1..a83014df72 100755 --- a/mill +++ b/mill @@ -2,7 +2,7 @@ # Adapted from -coursier_version="2.1.13" +coursier_version="2.1.17" # https://stackoverflow.com/questions/3466166/how-to-check-if-running-in-cygwin-mac-or-linux/17072017#17072017 if [ "$(expr substr $(uname -s) 1 5 2>/dev/null)" == "Linux" ]; then diff --git a/mill.bat b/mill.bat index e259bda101..e1a9a2629a 100755 --- a/mill.bat +++ b/mill.bat @@ -16,7 +16,7 @@ rem but I don't think we need to support them in 2019 setlocal enabledelayedexpansion if [!DEFAULT_MILL_VERSION!]==[] ( - set "DEFAULT_MILL_VERSION=0.11.12" + set "DEFAULT_MILL_VERSION=0.11.13" ) set "MILL_REPO_URL=https://github.com/com-lihaoyi/mill" diff --git a/millw b/millw index f34303960d..6ab9d5b07b 100755 --- a/millw +++ b/millw @@ -14,7 +14,7 @@ set -e if [ -z "${DEFAULT_MILL_VERSION}" ] ; then - DEFAULT_MILL_VERSION=0.11.12 + DEFAULT_MILL_VERSION=0.11.13 fi diff --git a/modules/cli/src/main/scala/scala/cli/commands/RestrictedCommandsParser.scala b/modules/cli/src/main/scala/scala/cli/commands/RestrictedCommandsParser.scala index 09670fabc6..f49ba7b2e2 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/RestrictedCommandsParser.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/RestrictedCommandsParser.scala @@ -3,13 +3,13 @@ package scala.cli.commands import caseapp.Name import caseapp.core.app.Command import caseapp.core.parser.Parser -import caseapp.core.util.Formatter +import caseapp.core.util.{CaseUtil, Formatter} import caseapp.core.{Arg, Error} import scala.build.Logger import scala.build.input.ScalaCliInvokeData import scala.build.internal.util.WarningMessages -import scala.build.internals.FeatureType +import scala.build.internals.{ConsoleUtils, FeatureType} import scala.cli.ScalaCli import scala.cli.util.ArgHelpers.* @@ -57,6 +57,16 @@ object RestrictedCommandsParser { if arg.isExperimental && !shouldSuppressExperimentalWarnings => logger.experimentalWarning(passedOption, FeatureType.Option) r + case (r @ Right(Some(_, arg: Arg, _)), passedOption :: _) + if arg.isDeprecated => + // TODO implement proper deprecation logic: https://github.com/VirtusLab/scala-cli/issues/3258 + arg.deprecatedOptionAliases.find(_ == passedOption) + .foreach { deprecatedAlias => + logger.message( + s"""[${Console.YELLOW}warn${Console.RESET}] The $deprecatedAlias option alias has been deprecated and may be removed in a future version.""" + ) + } + r case (other, _) => other } diff --git a/modules/cli/src/main/scala/scala/cli/commands/new/New.scala b/modules/cli/src/main/scala/scala/cli/commands/new/New.scala index 8f09cd5d39..71477efdae 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/new/New.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/new/New.scala @@ -14,7 +14,7 @@ object New extends ScalaCommand[NewOptions] { override def scalaSpecificationLevel = SpecificationLevel.EXPERIMENTAL - val giter8Dependency = + private def giter8Dependency = Seq(dep"${Constants.giter8Organization}::${Constants.giter8Name}:${Constants.giter8Version}") override def runCommand(options: NewOptions, remainingArgs: RemainingArgs, logger: Logger): Unit = diff --git a/modules/cli/src/main/scala/scala/cli/commands/package0/PackageOptions.scala b/modules/cli/src/main/scala/scala/cli/commands/package0/PackageOptions.scala index b3a578a89d..917579ae11 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/package0/PackageOptions.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/package0/PackageOptions.scala @@ -48,11 +48,14 @@ final case class PackageOptions( library: Boolean = false, @Group(HelpGroup.Package.toString) @HelpMessage("Generate a source JAR rather than an executable JAR") + @Name("sourcesJar") + @Name("jarSources") @Name("sources") - @Name("src") + @Name("source") + @Tag(tags.deprecated("source")) // alias to be removed in 1.6.x @Tag(tags.restricted) @Tag(tags.inShortHelp) - source: Boolean = false, + src: Boolean = false, @Group(HelpGroup.Package.toString) @HelpMessage("Generate a scaladoc JAR rather than an executable JAR") @ExtraName("scaladoc") @@ -144,7 +147,7 @@ final case class PackageOptions( def packageTypeOpt: Option[PackageType] = forcedPackageTypeOpt.orElse { if (library) Some(PackageType.LibraryJar) - else if (source) Some(PackageType.SourceJar) + else if (src) Some(PackageType.SourceJar) else if (assembly) Some( PackageType.Assembly( addPreamble = preamble, diff --git a/modules/cli/src/main/scala/scala/cli/commands/shared/ScalaJsOptions.scala b/modules/cli/src/main/scala/scala/cli/commands/shared/ScalaJsOptions.scala index 62df4b4c59..96045c4eec 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/shared/ScalaJsOptions.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/shared/ScalaJsOptions.scala @@ -59,6 +59,11 @@ final case class ScalaJsOptions( @HelpMessage("Enable jsdom") jsDom: Option[Boolean] = None, + @Group(HelpGroup.ScalaJs.toString) + @Tag(tags.experimental) + @HelpMessage("Emit WASM") + jsEmitWasm: Option[Boolean] = None, + @Group(HelpGroup.ScalaJs.toString) @Tag(tags.should) @HelpMessage("A header that will be added at the top of generated .js files") diff --git a/modules/cli/src/main/scala/scala/cli/commands/shared/SharedOptions.scala b/modules/cli/src/main/scala/scala/cli/commands/shared/SharedOptions.scala index 4d1d039099..08b243ac4a 100644 --- a/modules/cli/src/main/scala/scala/cli/commands/shared/SharedOptions.scala +++ b/modules/cli/src/main/scala/scala/cli/commands/shared/SharedOptions.scala @@ -251,7 +251,8 @@ final case class SharedOptions( smallModuleForPackage = jsSmallModuleForPackage, esVersionStr = jsEsVersion, noOpt = jsNoOpt, - remapEsModuleImportMap = jsEsModuleImportMap.filter(_.trim.nonEmpty).map(os.Path(_, Os.pwd)) + remapEsModuleImportMap = jsEsModuleImportMap.filter(_.trim.nonEmpty).map(os.Path(_, Os.pwd)), + jsEmitWasm = jsEmitWasm.getOrElse(false) ) } diff --git a/modules/cli/src/main/scala/scala/cli/util/ArgHelpers.scala b/modules/cli/src/main/scala/scala/cli/util/ArgHelpers.scala index 0af1067145..879c920a49 100644 --- a/modules/cli/src/main/scala/scala/cli/util/ArgHelpers.scala +++ b/modules/cli/src/main/scala/scala/cli/util/ArgHelpers.scala @@ -2,6 +2,7 @@ package scala.cli.util import caseapp.core.Arg import caseapp.core.help.HelpFormat +import caseapp.core.util.CaseUtil import scala.build.input.ScalaCliInvokeData import scala.build.internal.util.WarningMessages @@ -12,8 +13,24 @@ import scala.cli.commands.{SpecificationLevel, tags} object ArgHelpers { extension (arg: Arg) { private def hasTag(tag: String): Boolean = arg.tags.exists(_.name == tag) - def isExperimental: Boolean = arg.hasTag(tags.experimental) - def isRestricted: Boolean = arg.hasTag(tags.restricted) + private def hasTagPrefix(tagPrefix: String): Boolean = + arg.tags.exists(_.name.startsWith(tagPrefix)) + def isExperimental: Boolean = arg.hasTag(tags.experimental) + def isRestricted: Boolean = arg.hasTag(tags.restricted) + def isDeprecated: Boolean = arg.hasTagPrefix(tags.deprecatedPrefix) + + def deprecatedNames: List[String] = arg.tags + .filter(_.name.startsWith(tags.deprecatedPrefix)) + .map(_.name.stripPrefix(s"${tags.deprecatedPrefix}${tags.valueSeparator}")) + .toList + + def deprecatedOptionAliases: List[String] = arg.deprecatedNames.map { + case name if name.startsWith("-") => name + case name if name.length == 1 => "-" + name + case name => "--" + CaseUtil.pascalCaseSplit(name.toCharArray.toList).map( + _.toLowerCase + ).mkString("-") + } def isExperimentalOrRestricted: Boolean = arg.isRestricted || arg.isExperimental diff --git a/modules/core/src/main/scala/scala/build/internals/OsLibc.scala b/modules/core/src/main/scala/scala/build/internals/OsLibc.scala index 1b228c2426..9e9613c4ad 100644 --- a/modules/core/src/main/scala/scala/build/internals/OsLibc.scala +++ b/modules/core/src/main/scala/scala/build/internals/OsLibc.scala @@ -1,7 +1,7 @@ package scala.build.internal import bloop.rifle.VersionUtil.parseJavaVersion -import coursier.jvm.{JavaHome, JvmIndex} +import coursier.jvm.{JavaHome, JvmChannel} import java.io.IOException import java.nio.charset.Charset @@ -56,7 +56,7 @@ object OsLibc { // FIXME These values should be the default ones in coursier-jvm lazy val jvmIndexOs: String = { - val default = JvmIndex.defaultOs() + val default = JvmChannel.defaultOs if (default == "linux" && isMusl.getOrElse(false)) "linux-musl" else default } diff --git a/modules/directives/src/main/scala/scala/build/preprocessing/directives/Dependency.scala b/modules/directives/src/main/scala/scala/build/preprocessing/directives/Dependency.scala index 45234df10c..d67919e16b 100644 --- a/modules/directives/src/main/scala/scala/build/preprocessing/directives/Dependency.scala +++ b/modules/directives/src/main/scala/scala/build/preprocessing/directives/Dependency.scala @@ -21,7 +21,7 @@ import scala.cli.commands.SpecificationLevel @DirectiveExamples("//> using test.dep org.scalatest::scalatest:3.2.10") @DirectiveExamples("//> using test.dep org.scalameta::munit:0.7.29") @DirectiveExamples( - "//> using dep tabby:tabby:0.2.3,url=https://github.com/bjornregnell/tabby/releases/download/v0.2.3/tabby_3-0.2.3.jar" + "//> using dep \"tabby:tabby:0.2.3,url=https://github.com/bjornregnell/tabby/releases/download/v0.2.3/tabby_3-0.2.3.jar\"" ) @DirectiveUsage( "//> using dep org:name:ver | //> using deps org:name:ver org2:name2:ver2", diff --git a/modules/directives/src/main/scala/scala/build/preprocessing/directives/ScalaJs.scala b/modules/directives/src/main/scala/scala/build/preprocessing/directives/ScalaJs.scala index 68c89bbee7..9793830d7e 100644 --- a/modules/directives/src/main/scala/scala/build/preprocessing/directives/ScalaJs.scala +++ b/modules/directives/src/main/scala/scala/build/preprocessing/directives/ScalaJs.scala @@ -43,6 +43,8 @@ import scala.util.Try |`//> using jsModuleSplitStyleStr` _value_ | |`//> using jsEsVersionStr` _value_ + | + |`//> using jsEmitWasm` _true|false_ | |`//> using jsEsModuleImportMap` _value_ |""".stripMargin @@ -65,7 +67,8 @@ final case class ScalaJs( jsAvoidClasses: Option[Boolean] = None, jsAvoidLetsAndConsts: Option[Boolean] = None, jsModuleSplitStyleStr: Option[String] = None, - jsEsVersionStr: Option[String] = None + jsEsVersionStr: Option[String] = None, + jsEmitWasm: Option[Boolean] = None ) extends HasBuildOptions { // format: on def buildOptions: Either[BuildException, BuildOptions] = @@ -83,7 +86,8 @@ final case class ScalaJs( avoidLetsAndConsts = jsAvoidLetsAndConsts, moduleSplitStyleStr = jsModuleSplitStyleStr, esVersionStr = jsEsVersionStr, - noOpt = jsNoOpt + noOpt = jsNoOpt, + jsEmitWasm = jsEmitWasm.getOrElse(false) ) def absFilePath(pathStr: String): Either[ImportMapNotFound, Path] = diff --git a/modules/generate-reference-doc/src/main/scala/scala/cli/doc/GenerateReferenceDoc.scala b/modules/generate-reference-doc/src/main/scala/scala/cli/doc/GenerateReferenceDoc.scala index 5878a14351..13398552b0 100644 --- a/modules/generate-reference-doc/src/main/scala/scala/cli/doc/GenerateReferenceDoc.scala +++ b/modules/generate-reference-doc/src/main/scala/scala/cli/doc/GenerateReferenceDoc.scala @@ -207,7 +207,11 @@ object GenerateReferenceDoc extends CaseApp[InternalDocOptions] { names .tail .sortBy(_.dropWhile(_ == '-')) - .map(n => s"`$n`") + .map { + case name if arg.deprecatedOptionAliases.contains(name) => + s"[deprecated] `$name`" + case name => s"`$name`" + } .mkString("Aliases: ", ", ", "\n\n") ) diff --git a/modules/integration/src/test/scala/scala/cli/integration/NativePackagerTests.scala b/modules/integration/src/test/scala/scala/cli/integration/NativePackagerTests.scala index 43f645b37b..8767b06545 100644 --- a/modules/integration/src/test/scala/scala/cli/integration/NativePackagerTests.scala +++ b/modules/integration/src/test/scala/scala/cli/integration/NativePackagerTests.scala @@ -430,7 +430,8 @@ class NativePackagerTests extends ScalaCliSuite { } if (Properties.isLinux) - test("building docker image with scala native app") { + // FIXME make this test pass consistently on the CI again + test("building docker image with scala native app".flaky) { TestUtil.retryOnCi() { runNativeTest() } diff --git a/modules/integration/src/test/scala/scala/cli/integration/PackageTestDefinitions.scala b/modules/integration/src/test/scala/scala/cli/integration/PackageTestDefinitions.scala index f92f18532d..fe54f6cd62 100644 --- a/modules/integration/src/test/scala/scala/cli/integration/PackageTestDefinitions.scala +++ b/modules/integration/src/test/scala/scala/cli/integration/PackageTestDefinitions.scala @@ -859,11 +859,16 @@ abstract class PackageTestDefinitions extends ScalaCliSuite with TestScalaVersio test("source JAR") { val dest = os.rel / "sources.jar" simpleInputWithScalaAndSc.fromRoot { root => - os.proc(TestUtil.cli, "--power", "package", extraOptions, ".", "-o", dest, "--source").call( - cwd = root, - stdin = os.Inherit, - stdout = os.Inherit - ) + val r = + os.proc(TestUtil.cli, "--power", "package", extraOptions, ".", "-o", dest, "--source").call( + cwd = root, + stdin = os.Inherit, + stdout = os.Inherit, + stderr = os.Pipe + ) + expect(r.err.trim().contains( + "The --source option alias has been deprecated and may be removed in a future version" + )) expect(os.isFile(root / dest)) diff --git a/modules/integration/src/test/scala/scala/cli/integration/RunScalaJsTestDefinitions.scala b/modules/integration/src/test/scala/scala/cli/integration/RunScalaJsTestDefinitions.scala index 7909fd1b36..f7afee07cf 100644 --- a/modules/integration/src/test/scala/scala/cli/integration/RunScalaJsTestDefinitions.scala +++ b/modules/integration/src/test/scala/scala/cli/integration/RunScalaJsTestDefinitions.scala @@ -291,6 +291,43 @@ trait RunScalaJsTestDefinitions { _: RunTestDefinitions => } } + test("Emit Wasm") { + val outDir = "out" + + val inputs = TestInputs( + os.rel / "run.scala" -> + s"""//> using jsEmitWasm true + |//> using jsModuleKind es + |//> using jsModuleSplitStyleStr fewestmodules + | + |object Foo { + | def main(args: Array[String]): Unit = { + | println("Hello") + | } + |} + |""".stripMargin + ) + inputs.fromRoot { root => + val absOutDir = root / outDir + + os.proc( + TestUtil.cli, + "--power", + "package", + "run.scala", + "--js", + "-o", + absOutDir.toString(), + "-f", + extraOptions + ) + .call(cwd = root).out.trim() + expect(os.exists(absOutDir / "main.wasm")) + + // TODO : Run WASM using node. Requires node 22. + } + } + test("remap imports directive") { val importmapFile = "importmap.json" val outDir = "out" diff --git a/modules/options/src/main/scala/scala/build/Artifacts.scala b/modules/options/src/main/scala/scala/build/Artifacts.scala index 573dae3046..23451ad8c6 100644 --- a/modules/options/src/main/scala/scala/build/Artifacts.scala +++ b/modules/options/src/main/scala/scala/build/Artifacts.scala @@ -168,7 +168,9 @@ object Artifacts { scalaArtifactsParams.compilerPlugins .map { posDep => val posDep0 = - posDep.map(dep => dep.copy(userParams = dep.userParams + ("intransitive" -> None))) + posDep.map(dep => + dep.copy(userParams = dep.userParams ++ Seq("intransitive" -> None)) + ) artifacts( Seq(posDep0), allExtraRepositories, @@ -529,7 +531,7 @@ object Artifacts { .map(positionedDepTupleSeq => positionedDepTupleSeq.map { case Positioned(positions, (dep, csDep)) => - val maybeUrl = dep.userParams.get("url").flatten.map(new URL(_)) + val maybeUrl = dep.userParams.find(_._1 == "url").flatMap(_._2.map(new URL(_))) val fallback = maybeUrl.map(url => (csDep.module -> csDep.version) -> (url -> true)) Positioned(positions, (csDep, fallback)) } diff --git a/modules/options/src/main/scala/scala/build/actionable/ActionableDependencyHandler.scala b/modules/options/src/main/scala/scala/build/actionable/ActionableDependencyHandler.scala index be7d68fab4..33e400e1fb 100644 --- a/modules/options/src/main/scala/scala/build/actionable/ActionableDependencyHandler.scala +++ b/modules/options/src/main/scala/scala/build/actionable/ActionableDependencyHandler.scala @@ -39,10 +39,10 @@ case object ActionableDependencyHandler if Version(latestVersion) > Version(currentVersion) && !isLatestSyntaxVersion(currentVersion) // filtering out toolkit-test to prevent double-update-diagnostic - if !(dependency.userParams.contains(Constants.toolkitName) && + if !(dependency.userParams.exists(_._1 == Constants.toolkitName) && dependency.module.name == Constants.toolkitTestName) } yield - if dependency.userParams.contains(Constants.toolkitName) + if dependency.userParams.exists(_._1 == Constants.toolkitName) then val toolkitSuggestion = if dependency.module.organization == Constants.toolkitOrganization then latestVersion diff --git a/modules/options/src/main/scala/scala/build/info/ScopedBuildInfo.scala b/modules/options/src/main/scala/scala/build/info/ScopedBuildInfo.scala index 8c15327669..78e777ddc7 100644 --- a/modules/options/src/main/scala/scala/build/info/ScopedBuildInfo.scala +++ b/modules/options/src/main/scala/scala/build/info/ScopedBuildInfo.scala @@ -8,7 +8,6 @@ import dependency.AnyDependency import java.nio.charset.StandardCharsets import scala.build.options.{BuildOptions, ConfigMonoid} -import scala.reflect.io.Path final case class ScopedBuildInfo( sources: Seq[String] = Nil, diff --git a/modules/options/src/main/scala/scala/build/internal/ScalaJsLinkerConfig.scala b/modules/options/src/main/scala/scala/build/internal/ScalaJsLinkerConfig.scala index 6722f5aa3e..24c21909b1 100644 --- a/modules/options/src/main/scala/scala/build/internal/ScalaJsLinkerConfig.scala +++ b/modules/options/src/main/scala/scala/build/internal/ScalaJsLinkerConfig.scala @@ -11,7 +11,8 @@ final case class ScalaJsLinkerConfig( jsHeader: Option[String] = None, prettyPrint: Boolean = false, relativizeSourceMapBase: Option[String] = None, - remapEsModuleImportMap: Option[os.Path] = None + remapEsModuleImportMap: Option[os.Path] = None, + emitWasm: Boolean = false ) { def linkerCliArgs: Seq[String] = { val moduleKindArgs = Seq("--moduleKind", moduleKind) @@ -34,6 +35,7 @@ final case class ScalaJsLinkerConfig( val jsEsModuleImportMap = if (remapEsModuleImportMap.nonEmpty) Seq("--importmap", remapEsModuleImportMap.getOrElse(os.pwd / "importmap.json").toString) else Nil + val jsEmitWasm = if (emitWasm) Seq("--emitWasm") else Nil val configArgs = Seq[os.Shellable]( moduleKindArgs, @@ -45,7 +47,8 @@ final case class ScalaJsLinkerConfig( relativizeSourceMapBaseArgs, jsHeaderArg, prettyPrintArgs, - jsEsModuleImportMap + jsEsModuleImportMap, + jsEmitWasm ) configArgs.flatMap(_.value) diff --git a/modules/options/src/main/scala/scala/build/internals/Util.scala b/modules/options/src/main/scala/scala/build/internals/Util.scala index 88a06e0392..94dbb51606 100644 --- a/modules/options/src/main/scala/scala/build/internals/Util.scala +++ b/modules/options/src/main/scala/scala/build/internals/Util.scala @@ -71,13 +71,13 @@ object Util { (coursier.Organization(mod.organization), coursier.ModuleName(mod.name)) } } - for (clOpt <- dep.userParams.get("classifier"); cl <- clOpt) + for (clOpt <- dep.userParams.find(_._1 == "classifier").map(_._2); cl <- clOpt) dep0 = dep0.withPublication(dep0.publication.withClassifier(coursier.core.Classifier(cl))) - for (tpeOpt <- dep.userParams.get("type"); tpe <- tpeOpt) + for (tpeOpt <- dep.userParams.find(_._1 == "type").map(_._2); tpe <- tpeOpt) dep0 = dep0.withPublication(dep0.publication.withType(coursier.core.Type(tpe))) - for (extOpt <- dep.userParams.get("ext"); ext <- extOpt) + for (extOpt <- dep.userParams.find(_._1 == "ext").map(_._2); ext <- extOpt) dep0 = dep0.withPublication(dep0.publication.withExt(coursier.core.Extension(ext))) - for (_ <- dep.userParams.get("intransitive")) + for (_ <- dep.userParams.find(_._1 == "intransitive")) dep0 = dep0.withTransitive(false) dep0 } diff --git a/modules/options/src/main/scala/scala/build/options/ScalaJsOptions.scala b/modules/options/src/main/scala/scala/build/options/ScalaJsOptions.scala index 8c56c0f0ba..20e0288a6a 100644 --- a/modules/options/src/main/scala/scala/build/options/ScalaJsOptions.scala +++ b/modules/options/src/main/scala/scala/build/options/ScalaJsOptions.scala @@ -25,7 +25,8 @@ final case class ScalaJsOptions( moduleSplitStyleStr: Option[String] = None, smallModuleForPackage: List[String] = Nil, esVersionStr: Option[String] = None, - noOpt: Option[Boolean] = None + noOpt: Option[Boolean] = None, + jsEmitWasm: Boolean = false ) { def fullOpt: Either[UnrecognizedJsOptModeError, Boolean] = if (mode.isValid) @@ -150,7 +151,8 @@ final case class ScalaJsOptions( smallModuleForPackage = smallModuleForPackage, esFeatures = esFeatures, jsHeader = header, - remapEsModuleImportMap = remapEsModuleImportMap + remapEsModuleImportMap = remapEsModuleImportMap, + emitWasm = jsEmitWasm ) } } diff --git a/modules/specification-level/src/main/scala/scala/cli/commands/SpecificationLevel.scala b/modules/specification-level/src/main/scala/scala/cli/commands/SpecificationLevel.scala index 3aa488863a..2b3d29fa1f 100644 --- a/modules/specification-level/src/main/scala/scala/cli/commands/SpecificationLevel.scala +++ b/modules/specification-level/src/main/scala/scala/cli/commands/SpecificationLevel.scala @@ -58,6 +58,8 @@ object SpecificationLevel { } object tags { + val valueSeparator: String = ":" // separates values in a tag + // specification level tags val experimental: String = SpecificationLevel.EXPERIMENTAL.toString val restricted: String = SpecificationLevel.RESTRICTED.toString @@ -68,7 +70,10 @@ object tags { // other tags // the `inShortHelp` tag whitelists options to be included in --help // this is in contrast to blacklisting options in --help with the @Hidden annotation - val inShortHelp: String = "inShortHelp" // included in --help by default + val inShortHelp: String = "inShortHelp" // included in --help by default + val deprecatedPrefix: String = "deprecated" + def deprecated(name: String): String = + s"$deprecatedPrefix$valueSeparator$name" // produces a deprecated warning for the given name def levelFor(name: String): Option[SpecificationLevel] = name match { case `experimental` => Some(SpecificationLevel.EXPERIMENTAL) diff --git a/project/deps.sc b/project/deps.sc index b8ed1546cf..5ab4df215e 100644 --- a/project/deps.sc +++ b/project/deps.sc @@ -10,8 +10,8 @@ object Scala { def scala3Lts = s"$scala3LtsPrefix.4" // the LTS version currently used in the build def scala3NextPrefix = "3.5" def scala3Next = s"$scala3NextPrefix.2" // the newest/next version of Scala - def scala3NextAnnounced = scala3Next // the newest/next version of Scala that's been announced - def scala3NextRc = "3.6.1" // the latest RC version of Scala Next + def scala3NextAnnounced = scala3Next // the newest/next version of Scala that's been announced + def scala3NextRc = "3.6.2-RC1" // the latest RC version of Scala Next // The Scala version used to build the CLI itself. def defaultInternal = sys.props.get("scala.version.internal").getOrElse(scala3Lts) @@ -102,8 +102,9 @@ object Deps { object Versions { def ammonite = "3.0.0-2-6342755f" def ammoniteForScala3Lts = ammonite + def argonautShapeless = "1.3.1" // jni-utils version may need to be sync-ed when bumping the coursier version - def coursierDefault = "2.1.14" + def coursierDefault = "2.1.17" def coursier = coursierDefault def coursierCli = coursierDefault def coursierM1Cli = coursierDefault @@ -113,7 +114,7 @@ object Deps { def jsoup = "1.18.1" def scalaMeta = "4.9.9" def scalaNative04 = "0.4.17" - def scalaNative05 = "0.5.5" + def scalaNative05 = "0.5.6" def scalaNative = scalaNative05 def maxScalaNativeForToolkit = scalaNative05 def maxScalaNativeForTypelevelToolkit = scalaNative04 @@ -123,9 +124,9 @@ object Deps { def signingCli = "0.2.4" def signingCliJvmVersion = Java.defaultJava def javaSemanticdb = "0.10.0" - def javaClassName = "0.1.3" - def bloop = "2.0.3" - def sbtVersion = "1.10.3" + def javaClassName = "0.1.4" + def bloop = "2.0.5" + def sbtVersion = "1.10.5" def mavenVersion = "3.8.1" def mavenScalaCompilerPluginVersion = "4.9.1" def mavenExecPluginVersion = "3.3.0" @@ -138,7 +139,9 @@ object Deps { // that Scala CLI supports. def ammonite = ivy"com.lihaoyi:::ammonite:${Versions.ammonite}" def ammoniteForScala3Lts = ivy"com.lihaoyi:::ammonite:${Versions.ammoniteForScala3Lts}" - def asm = ivy"org.ow2.asm:asm:9.7.1" + def argonautShapeless = + ivy"com.github.alexarchambault:argonaut-shapeless_6.3_2.13:${Versions.argonautShapeless}" + def asm = ivy"org.ow2.asm:asm:9.7.1" // Force using of 2.13 - is there a better way? def bloopConfig = ivy"ch.epfl.scala:bloop-config_2.13:2.1.0" .exclude(("com.github.plokhotnyuk.jsoniter-scala", "jsoniter-scala-core_2.13")) @@ -158,15 +161,20 @@ object Deps { def coursierPublish = ivy"io.get-coursier.publish:publish_2.13:0.1.6" .exclude(("org.scala-lang.modules", "scala-collection-compat_2.13")) .exclude(("com.github.plokhotnyuk.jsoniter-scala", "jsoniter-scala-core_2.13")) - def dependency = ivy"io.get-coursier::dependency:0.2.4" + def dependency = ivy"io.get-coursier::dependency:0.3.1" def dockerClient = ivy"com.spotify:docker-client:8.16.0" // TODO bump once 0.15.5 is out - def expecty = ivy"com.eed3si9n.expecty::expecty:0.16.0" + def expecty = ivy"com.eed3si9n.expecty::expecty:0.17.0" def fansi = ivy"com.lihaoyi::fansi:0.5.0" def giter8 = ivy"org.foundweekends.giter8:giter8:0.16.2" def guava = ivy"com.google.guava:guava:33.3.1-jre" def javaClassName = ivy"org.virtuslab.scala-cli.java-class-name:java-class-name_3:${Versions.javaClassName}" + .exclude( + "org.jline" -> "jline-reader", + "org.jline" -> "jline-terminal", + "org.jline" -> "jline-terminal-jna" + ) def jgit = ivy"org.eclipse.jgit:org.eclipse.jgit:6.8.0.202311291450-r" def jimfs = ivy"com.google.jimfs:jimfs:1.3.0" def jmhGeneratorBytecode = ivy"org.openjdk.jmh:jmh-generator-bytecode:${Versions.jmh}" diff --git a/project/settings.sc b/project/settings.sc index b28ed46f4d..ff6a6278a9 100644 --- a/project/settings.sc +++ b/project/settings.sc @@ -1,5 +1,5 @@ import $ivy.`com.goyeau::mill-scalafix::0.3.1` -import $ivy.`io.github.alexarchambault.mill::mill-native-image::0.1.26` +import $ivy.`io.github.alexarchambault.mill::mill-native-image::0.1.29` import $file.deps, deps.{Deps, Docker, alpineVersion, buildCsVersion, buildCsM1Version, libsodiumVersion} diff --git a/scala-cli.bat b/scala-cli.bat index 3a1b0044d0..1acd63d756 100644 --- a/scala-cli.bat +++ b/scala-cli.bat @@ -7,7 +7,7 @@ rem Download the latest version of this script at https://github.com/VirtusLab/s setlocal enabledelayedexpansion -set "SCALA_CLI_VERSION=1.5.1" +set "SCALA_CLI_VERSION=1.5.3" set SCALA_CLI_URL=https://github.com/VirtusLab/scala-cli/releases/download/v%SCALA_CLI_VERSION%/scala-cli.bat set CACHE_BASE=%localappdata%/Coursier/v1 diff --git a/scala-cli.sh b/scala-cli.sh index d565e0610b..9730080359 100755 --- a/scala-cli.sh +++ b/scala-cli.sh @@ -7,7 +7,7 @@ set -eu -SCALA_CLI_VERSION="1.5.1" +SCALA_CLI_VERSION="1.5.3" GH_ORG="VirtusLab" GH_NAME="scala-cli" diff --git a/website/docs/reference/cli-options.md b/website/docs/reference/cli-options.md index a092661578..eb67fc5986 100644 --- a/website/docs/reference/cli-options.md +++ b/website/docs/reference/cli-options.md @@ -749,9 +749,9 @@ Overwrite the destination file, if it exists Generate a library JAR rather than an executable JAR -### `--source` +### `--src` -Aliases: `--sources`, `--src` +Aliases: `--jar-sources`, [deprecated] `--source`, `--sources`, `--sources-jar` Generate a source JAR rather than an executable JAR @@ -1322,6 +1322,10 @@ A file relative to the root directory containing import maps for ES module impor Enable jsdom +### `--js-emit-wasm` + +Emit WASM + ### `--js-header` A header that will be added at the top of generated .js files @@ -1384,7 +1388,7 @@ Enable Scala Native. To show more options for Scala Native pass `--help-native` ### `--native-version` -Set the Scala Native version (0.5.5 by default). +Set the Scala Native version (0.5.6 by default). ### `--native-mode` diff --git a/website/docs/reference/directives.md b/website/docs/reference/directives.md index 3ced9f0aea..067928b655 100644 --- a/website/docs/reference/directives.md +++ b/website/docs/reference/directives.md @@ -107,7 +107,7 @@ Add dependencies `//> using test.dep org.scalameta::munit:0.7.29` -`//> using dep tabby:tabby:0.2.3,url=https://github.com/bjornregnell/tabby/releases/download/v0.2.3/tabby_3-0.2.3.jar` +`//> using dep "tabby:tabby:0.2.3,url=https://github.com/bjornregnell/tabby/releases/download/v0.2.3/tabby_3-0.2.3.jar"` ### Exclude sources @@ -407,6 +407,8 @@ Add Scala.js options `//> using jsModuleSplitStyleStr` _value_ `//> using jsEsVersionStr` _value_ + +`//> using jsEmitWasm` _true|false_ `//> using jsEsModuleImportMap` _value_ diff --git a/website/docs/reference/scala-command/cli-options.md b/website/docs/reference/scala-command/cli-options.md index e970a0a45b..86e5df761e 100644 --- a/website/docs/reference/scala-command/cli-options.md +++ b/website/docs/reference/scala-command/cli-options.md @@ -846,7 +846,7 @@ Enable Scala Native. To show more options for Scala Native pass `--help-native` `SHOULD have` per Scala Runner specification -Set the Scala Native version (0.5.5 by default). +Set the Scala Native version (0.5.6 by default). ### `--native-mode` diff --git a/website/docs/reference/scala-command/directives.md b/website/docs/reference/scala-command/directives.md index eee4499d25..270fe88e47 100644 --- a/website/docs/reference/scala-command/directives.md +++ b/website/docs/reference/scala-command/directives.md @@ -48,7 +48,7 @@ Add dependencies `//> using test.dep org.scalameta::munit:0.7.29` -`//> using dep tabby:tabby:0.2.3,url=https://github.com/bjornregnell/tabby/releases/download/v0.2.3/tabby_3-0.2.3.jar` +`//> using dep "tabby:tabby:0.2.3,url=https://github.com/bjornregnell/tabby/releases/download/v0.2.3/tabby_3-0.2.3.jar"` ### Java options @@ -282,6 +282,8 @@ Add Scala.js options `//> using jsModuleSplitStyleStr` _value_ `//> using jsEsVersionStr` _value_ + +`//> using jsEmitWasm` _true|false_ `//> using jsEsModuleImportMap` _value_ diff --git a/website/docs/reference/scala-command/runner-specification.md b/website/docs/reference/scala-command/runner-specification.md index 0b274366df..7e1a6a3330 100644 --- a/website/docs/reference/scala-command/runner-specification.md +++ b/website/docs/reference/scala-command/runner-specification.md @@ -178,7 +178,7 @@ Enable Scala Native. To show more options for Scala Native pass `--help-native` **--native-version** -Set the Scala Native version (0.5.5 by default). +Set the Scala Native version (0.5.6 by default). **--native-mode** @@ -959,7 +959,7 @@ Enable Scala Native. To show more options for Scala Native pass `--help-native` **--native-version** -Set the Scala Native version (0.5.5 by default). +Set the Scala Native version (0.5.6 by default). **--native-mode** @@ -1542,7 +1542,7 @@ Enable Scala Native. To show more options for Scala Native pass `--help-native` **--native-version** -Set the Scala Native version (0.5.5 by default). +Set the Scala Native version (0.5.6 by default). **--native-mode** @@ -2157,7 +2157,7 @@ Enable Scala Native. To show more options for Scala Native pass `--help-native` **--native-version** -Set the Scala Native version (0.5.5 by default). +Set the Scala Native version (0.5.6 by default). **--native-mode** @@ -2785,7 +2785,7 @@ Enable Scala Native. To show more options for Scala Native pass `--help-native` **--native-version** -Set the Scala Native version (0.5.5 by default). +Set the Scala Native version (0.5.6 by default). **--native-mode** @@ -3389,7 +3389,7 @@ Enable Scala Native. To show more options for Scala Native pass `--help-native` **--native-version** -Set the Scala Native version (0.5.5 by default). +Set the Scala Native version (0.5.6 by default). **--native-mode** @@ -4030,7 +4030,7 @@ Enable Scala Native. To show more options for Scala Native pass `--help-native` **--native-version** -Set the Scala Native version (0.5.5 by default). +Set the Scala Native version (0.5.6 by default). **--native-mode** @@ -4722,7 +4722,7 @@ Enable Scala Native. To show more options for Scala Native pass `--help-native` **--native-version** -Set the Scala Native version (0.5.5 by default). +Set the Scala Native version (0.5.6 by default). **--native-mode** @@ -5655,7 +5655,7 @@ Enable Scala Native. To show more options for Scala Native pass `--help-native` **--native-version** -Set the Scala Native version (0.5.5 by default). +Set the Scala Native version (0.5.6 by default). **--native-mode** diff --git a/website/docs/release_notes.md b/website/docs/release_notes.md index 997a13747b..2c610bfd29 100644 --- a/website/docs/release_notes.md +++ b/website/docs/release_notes.md @@ -8,6 +8,201 @@ import ReactPlayer from 'react-player' # Release notes +## [v1.5.4](https://github.com/VirtusLab/scala-cli/releases/tag/v1.5.4) + +### Hotfix release +Although Scala CLI 1.5.4 includes a few updates and improvements, it is primarily a hotfix release for versions 1.5.2 and 1.5.3, which due to technical limitations weren't available on some of our distribution channels. + +For extra context refer to: +* [Scala CLI 1.5.2 release notes](#v152) +* [Scala CLI 1.5.3 release notes](#v153) + +### Support for Scala Native 0.5.6 +This Scala CLI version switches the default Scala Native version to 0.5.6. + +```bash +scala-cli -e 'println("Hello from Scala Native 0.5.6!")' --native +# Compiling project (Scala 3.5.2, Scala Native 0.5.6) +# Compiled project (Scala 3.5.2, Scala Native 0.5.6) +# [info] Linking (multithreadingEnabled=true, disable if not used) (949 ms) +# [info] Discovered 887 classes and 5408 methods after classloading +# [info] Checking intermediate code (quick) (40 ms) +# [info] Multithreading was not explicitly enabled - initial class loading has not detected any usage of system threads. Multithreading support will be disabled to improve performance. +# [info] Linking (multithreadingEnabled=false) (285 ms) +# [info] Discovered 499 classes and 2500 methods after classloading +# [info] Checking intermediate code (quick) (7 ms) +# [info] Discovered 478 classes and 1914 methods after optimization +# [info] Optimizing (debug mode) (429 ms) +# [info] Produced 9 LLVM IR files +# [info] Generating intermediate code (296 ms) +# [info] Compiling to native code (1464 ms) +# [info] Linking with [pthread, dl] +# [info] Linking native code (immix gc, none lto) (208 ms) +# [info] Postprocessing (0 ms) +# [info] Total (3728 ms) +# Hello from Scala Native 0.5.6! +``` + +Added by [@Gedochao](https://github.com/Gedochao) in [#3295](https://github.com/VirtusLab/scala-cli/pull/3295) + +### Fixes +* Pin Fedora docker image at `fedora:40` by [@Gedochao](https://github.com/Gedochao) in [#3283](https://github.com/VirtusLab/scala-cli/pull/3283) +* Don't fail the `update-packages` and `windows-packages` jobs on individual distributions' steps by [@Gedochao](https://github.com/Gedochao) in [#3288](https://github.com/VirtusLab/scala-cli/pull/3288) + +### Documentation changes +* Fix broken example in `//> using dep` reference doc by [@Gedochao](https://github.com/Gedochao) in [#3281](https://github.com/VirtusLab/scala-cli/pull/3281) +* Mention distribution limitations in the Scala CLI 1.5.3 release notes by [@Gedochao](https://github.com/Gedochao) in [#3286](https://github.com/VirtusLab/scala-cli/pull/3286) +* Back port of documentation changes to main by [@github-actions](https://github.com/github-actions) in [#3287](https://github.com/VirtusLab/scala-cli/pull/3287) + +### Updates +* Update `mill-native-image` to 0.1.29 by [@Gedochao](https://github.com/Gedochao) in [#3278](https://github.com/VirtusLab/scala-cli/pull/3278) +* Update expecty to 0.17.0 by [@scala-steward](https://github.com/scala-steward) in [#3277](https://github.com/VirtusLab/scala-cli/pull/3277) +* Update Bloop to 2.0.5 by [@Gedochao](https://github.com/Gedochao) in [#3276](https://github.com/VirtusLab/scala-cli/pull/3276) +* Update dependency to 0.2.5 by [@scala-steward](https://github.com/scala-steward) in [#3269](https://github.com/VirtusLab/scala-cli/pull/3269) +* Update `coursier` to 2.1.17 by [@Gedochao](https://github.com/Gedochao) in [#3275](https://github.com/VirtusLab/scala-cli/pull/3275) +* Update SBT to 1.10.5 by [@Gedochao](https://github.com/Gedochao) in [#3280](https://github.com/VirtusLab/scala-cli/pull/3280) +* Update `java-class-name` to 0.1.4 by [@Gedochao](https://github.com/Gedochao) in [#3284](https://github.com/VirtusLab/scala-cli/pull/3284) +* Update scala-cli.sh launcher for 1.5.3 by [@Gedochao](https://github.com/Gedochao) in [#3285](https://github.com/VirtusLab/scala-cli/pull/3285) +* Update Scala Native to 0.5.6 by [@Gedochao](https://github.com/Gedochao) in [#3295](https://github.com/VirtusLab/scala-cli/pull/3295) +* Update Mill to 0.11.13 by [@Gedochao](https://github.com/Gedochao) in [#3296](https://github.com/VirtusLab/scala-cli/pull/3296) +* Update coursier to 2.1.17 for Linux arm64 builds by [@Gedochao](https://github.com/Gedochao) in [#3298](https://github.com/VirtusLab/scala-cli/pull/3298) +* Update coursier/dependency to 0.3.1 by [@Gedochao](https://github.com/Gedochao) in [#3297](https://github.com/VirtusLab/scala-cli/pull/3297) + +**Full Changelog**: https://github.com/VirtusLab/scala-cli/compare/v1.5.3...v1.5.4 + +## [v1.5.3](https://github.com/VirtusLab/scala-cli/releases/tag/v1.5.3) + +This is a hotfix release, which makes all the fixes and enhancements of Scala CLI 1.5.2 available through most standard distribution channels (rather than just Maven Central). +For the main release notes, please refer to the [v1.5.2 ones](#v152). + +### Distribution limitations +Due to technical difficulties within our release pipeline, Scala CLI 1.5.3 is **not** available via the following channels: +- `yum` (on RedHat/Cent OS/Fedora) +- `SDKMAN!` + +We have followed up with a 1.5.4 hotfix release to address this issue. + +### Hot-fixes +- Tag failing native packager tests as flaky by [@Gedochao](https://github.com/Gedochao) in [#3270](https://github.com/VirtusLab/scala-cli/pull/3270) +- Make publishing depend on all integration tests & docs tests by [@Gedochao](https://github.com/Gedochao) in [#3272](https://github.com/VirtusLab/scala-cli/pull/3272) + +**Full Changelog**: https://github.com/VirtusLab/scala-cli/compare/v1.5.2...v1.5.3 + +## [v1.5.2](https://github.com/VirtusLab/scala-cli/releases/tag/v1.5.2) + +### Scala CLI 1.5.2 will only be available on JVM +Due to technical difficulties with our release pipeline, Scala CLI 1.5.2 was only released as a JVM launcher on Maven Central. While it can be used as such, we followed it up with a hotfix 1.5.3 release, which should be available through all standard distribution channels. + +```bash +scala-cli --cli-version 1.5.2 --version +# Scala CLI version: 1.5.2 +# Scala version (default): 3.5.2 +``` + +### `--source` is now deprecated and scheduled for removal in Scala CLI v1.6.x +Due to how easy it is to confuse `--source` (the command line option for producing source JARs +with the `package` sub-command) and `-source` (the Scala compiler option, which can also be passed +as `--source` in recent Scala 3 versions), using the former is now deprecated, and will likely be removed +in Scala CLI v1.6.x. + +```bash ignore +scala-cli --power package --source . +# [warn] The --source option alias has been deprecated and may be removed in a future version. +# (...) +``` + +Do note that the deprecation (and future removal) only affects the option alias. +The feature of packaging source JARs remains unchanged. +It is now recommended to switch to using the `--src` alias instead. + +```bash ignore +scala-cli --power package --src . +``` + +Added by [@Gedochao](https://github.com/Gedochao) in [#3257](https://github.com/VirtusLab/scala-cli/pull/3257). + +### Support for Scala 3.5.2 +This Scala CLI version switches the default Scala version to 3.5.2. + +```bash +scala-cli version +# Scala CLI version: 1.5.2 +# Scala version (default): 3.5.2 +``` + +Added by [@Gedochao](https://github.com/Gedochao) in [#3230](https://github.com/VirtusLab/scala-cli/pull/3230). + +### (experimental) Initial support for emitting Wasm with a command line option and a directive +It is now possible to emit Wasm via Scala.js with the `//> using jsEmitWasm` directive: +```scala title=wasm.sc compile power +//> using platform js +//> using jsEmitWasm +//> using jsModuleKind es +//> using jsModuleSplitStyleStr fewestmodules +println("Hello") +``` +Or with the `--js-emit-wasm` command line option: +```bash ignore +scala-cli --power package wasm.sc --js --js-emit-wasm +# The `--js-emit-wasm` 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.5.2, Scala.js 1.17.0) +# Compiled project (Scala 3.5.2, Scala.js 1.17.0) +# Wrote ~/wasm/wasm.js/main.js, run it with +# node ./wasm.js/main.js +tree wasm.js +# wasm.js +# ├── __loader.js +# ├── main.js +# └── main.wasm +# +# 1 directory, 3 files +``` + +For more information about Wasm (WebAssembly) support via Scala.js, refer [here](https://www.scala-js.org/doc/project/webassembly.html). + +Added by [@Quafadas](https://github.com/Quafadas) in [#3255](https://github.com/VirtusLab/scala-cli/pull/3255). + +### Features +* Add a `--js-emit-wasm` option and a corresponding `using` directive by [@Quafadas](https://github.com/Quafadas) in [#3255](https://github.com/VirtusLab/scala-cli/pull/3255) + +### Deprecations +* Deprecate the `--source` command line option for the package sub-command by [@Gedochao](https://github.com/Gedochao) in [#3257](https://github.com/VirtusLab/scala-cli/pull/3257) + +### Fixes +* Fix `--watch` to work correctly with changing `using` directives & sources requiring code generation (scripts, markdown, etc) by [@Gedochao](https://github.com/Gedochao) in [#3218](https://github.com/VirtusLab/scala-cli/pull/3218) +* Ensure resource directories passed via a using directive aren't ignored in `--watch` mode by [@Gedochao](https://github.com/Gedochao) in [#3221](https://github.com/VirtusLab/scala-cli/pull/3221) +* Ensure consecutive `-Wconf:*` flags are not ignored by [@Gedochao](https://github.com/Gedochao) in [#3245](https://github.com/VirtusLab/scala-cli/pull/3245) + +### Documentation changes +* Mention the `Fix` command in the `Using directives` guide by [@dabrowski-adam](https://github.com/dabrowski-adam) in [#3239](https://github.com/VirtusLab/scala-cli/pull/3239) +* Back port of documentation changes to main by [@github-actions](https://github.com/github-actions) in [#3242](https://github.com/VirtusLab/scala-cli/pull/3242) + +### Updates +* Update scala-cli.sh launcher for 1.5.1 by [@github-actions](https://github.com/github-actions) in [#3217](https://github.com/VirtusLab/scala-cli/pull/3217) +* Update sttp to 3.10.0 by [@scala-steward](https://github.com/scala-steward) in [#3219](https://github.com/VirtusLab/scala-cli/pull/3219) +* Update asm to 9.7.1 by [@scala-steward](https://github.com/scala-steward) in [#3223](https://github.com/VirtusLab/scala-cli/pull/3223) +* Update bloop-rifle_2.13 to 2.0.3 by [@scala-steward](https://github.com/scala-steward) in [#3225](https://github.com/VirtusLab/scala-cli/pull/3225) +* Update bloop-config_2.13 to 2.1.0 by [@scala-steward](https://github.com/scala-steward) in [#3228](https://github.com/VirtusLab/scala-cli/pull/3228) +* chore: Update next to 3.5.2-RC2 by [@tgodzik](https://github.com/tgodzik) in [#3224](https://github.com/VirtusLab/scala-cli/pull/3224) +* Update `coursier` to 2.1.14 by [@scala-steward](https://github.com/scala-steward) in [#3226](https://github.com/VirtusLab/scala-cli/pull/3226) +* Update core_2.13 to 3.10.1 by [@scala-steward](https://github.com/scala-steward) in [#3229](https://github.com/VirtusLab/scala-cli/pull/3229) +* Update `os-lib` to 0.11.2 by [@Gedochao](https://github.com/Gedochao) in [#3232](https://github.com/VirtusLab/scala-cli/pull/3232) +* Update sbt, scripted-plugin to 1.10.3 by [@scala-steward](https://github.com/scala-steward) in [#3235](https://github.com/VirtusLab/scala-cli/pull/3235) +* Update dependency to 0.2.4 by [@scala-steward](https://github.com/scala-steward) in [#3234](https://github.com/VirtusLab/scala-cli/pull/3234) +* Bump Scala Next to 3.5.2 by [@Gedochao](https://github.com/Gedochao) in [#3230](https://github.com/VirtusLab/scala-cli/pull/3230) +* Update os-lib to 0.11.3 by [@scala-steward](https://github.com/scala-steward) in [#3240](https://github.com/VirtusLab/scala-cli/pull/3240) +* Set Scala 3.5.2 as the latest announced Scala Next version by [@Gedochao](https://github.com/Gedochao) in [#3243](https://github.com/VirtusLab/scala-cli/pull/3243) +* Set Scala 3.6.1 as the Next RC version (which it effectively is) by [@Gedochao](https://github.com/Gedochao) in [#3244](https://github.com/VirtusLab/scala-cli/pull/3244) +* Update dependencies in `gh-action.md` examples by [@kubukoz](https://github.com/kubukoz) in [#3249](https://github.com/VirtusLab/scala-cli/pull/3249) +* Bump `scala-js-cli` to 1.17.0.1 by [@Gedochao](https://github.com/Gedochao) in [#3252](https://github.com/VirtusLab/scala-cli/pull/3252) + +## New Contributors +* [@dabrowski-adam](https://github.com/dabrowski-adam) made their first contribution in [#3239](https://github.com/VirtusLab/scala-cli/pull/3239) + +**Full Changelog**: https://github.com/VirtusLab/scala-cli/compare/v1.5.1...v1.5.2 + ## [v1.5.1](https://github.com/VirtusLab/scala-cli/releases/tag/v1.5.1) ### Support for Scala 3.5.1, 3.3.4, 2.13.15 and 2.12.20