Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scala-library to 2.13.12 #64

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
9f9646c
Merge pull request #5 from scala-cli/main
Gedochao Feb 2, 2023
1a55e8f
Merge remote-tracking branch 'origin/main' into merge-upstream
lwronski Mar 3, 2023
b14c5cd
Merge pull request #6 from VirtusLab/merge-upstream
lwronski Mar 6, 2023
890d672
Build scalajs-cli only for the latest version of scalajs
lwronski Mar 1, 2023
b285d50
Merge pull request #7 from VirtusLab/publish-latest-scalajs
lwronski Mar 7, 2023
eca3f51
Adjust publish org to org.virtuslab.scala-cli
lwronski Mar 7, 2023
bf1aac4
Fix - allow to run CI on main branch
lwronski Mar 7, 2023
0cb7e27
Upload native launcher of scalajs-cli into tag with the same version …
lwronski Mar 7, 2023
23df0a8
Merge pull request #8 from VirtusLab/publish-virtuslab
lwronski Mar 8, 2023
5f3bd2b
Adjust ghOrg to virtuslab
lwronski Mar 8, 2023
7ac418e
Merge pull request #10 from VirtusLab/fix-publish
lwronski Mar 8, 2023
c238dd3
Skip uploading native launchers to stable Scala.js tag when publishin…
lwronski Mar 8, 2023
eb9561c
Remove Scala.js version from native launcher name
lwronski Mar 8, 2023
ad60df3
Merge pull request #11 from VirtusLab/fix-publish
lwronski Mar 8, 2023
b33bd7e
Update os-lib to 0.9.1 (#9)
scala-steward Mar 23, 2023
c0e78e4
Update mill-main to 0.10.12 (#12)
scala-steward Mar 23, 2023
9f1569a
Update scalajs to 1.13.1 (#13)
lwronski Apr 12, 2023
bbdaaa5
Update svm to 22.3.2
scala-steward Apr 20, 2023
9e592ba
Update scala-library to 2.13.11
scala-steward Jun 10, 2023
42692b9
Merge branch 'main' into update/svm-22.3.2
lwronski Jun 11, 2023
da6d1ce
Merge branch 'main' into update/scala-library-2.13.11
lwronski Jun 11, 2023
84c485a
Update mill-main to 0.11.0
lwronski Jun 11, 2023
106ae12
Update mill-native-image to 0.1.25
lwronski Jun 11, 2023
47bea15
Update mill-vcs-version to 0.4.0
lwronski Jun 11, 2023
5b7cfa2
Merge pull request #14 from scala-steward/update/svm-22.3.2
lwronski Jun 11, 2023
0da1946
Merge branch 'main' into update/scala-library-2.13.11
lwronski Jun 11, 2023
689a55e
Fix after update mill to 0.11.0 - rename Tests to ScalaTests after br…
lwronski Jun 11, 2023
b4e2b71
Merge pull request #18 from scala-steward/update/scala-library-2.13.11
lwronski Jun 11, 2023
23a18b6
Merge pull request #20 from VirtusLab/updates
lwronski Jun 13, 2023
a460670
Update mill-main to 0.11.1
scala-steward Jun 30, 2023
01f48d0
Update scalajs-linker to 1.13.2
lwronski Jul 2, 2023
d5826d2
Merge branch 'main' into update/mill-main-0.11.1
lwronski Jul 2, 2023
1c07120
Merge pull request #21 from scala-steward/update/mill-main-0.11.1
lwronski Jul 2, 2023
c91a2fb
Merge pull request #23 from VirtusLab/scalajs-linker-1.13.2
lwronski Jul 3, 2023
f7ccde7
Add support for parsing es version
lwronski Aug 14, 2023
fc94cdf
Merge pull request #25 from VirtusLab/es-version
lwronski Aug 16, 2023
16ee8d2
Update scala-library to 2.13.12
scala-steward Sep 17, 2023
859d7e6
Merge branch 'main' into update/scala-library-2.13.12
lwronski Sep 21, 2023
cee6f42
Update scala-library to 2.13.12
lwronski Sep 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 14 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI
on:
push:
branches:
- master
- main
tags:
- "v*"
pull_request:
Expand All @@ -21,7 +21,7 @@ jobs:
with:
jvm: "temurin:17"
- name: Test CLI
run: ./mill -i 'tests[_].test'
run: ./mill -i 'tests.test'

publish:
needs: test
Expand Down Expand Up @@ -51,7 +51,6 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
scalaJsVersion: ["1.9.0", "1.10.0", "1.10.1", "1.11.0", "1.12.0", "1.13.1"]
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -62,22 +61,18 @@ jobs:
with:
jvm: temurin:17
- run: |
./mill -i "native[$scalaJsVersion].writeNativeImageScript" generate.sh "" && \
./mill -i "native.writeNativeImageScript" generate.sh "" && \
./generate.sh && \
./mill -i "tests[$scalaJsVersion].test.native" && \
./mill -i "native[$scalaJsVersion].copyToArtifacts" artifacts/
./mill -i "tests.test.native" && \
./mill -i "native.copyToArtifacts" artifacts/
if: runner.os != 'Windows'
env:
scalaJsVersion: ${{ matrix.scalaJsVersion }}
- run: |
@call ./mill.bat -i "native[%scalaJsVersion%].writeNativeImageScript" generate.bat ""
@call ./mill.bat -i "native.writeNativeImageScript" generate.bat ""
@call generate.bat
@call ./mill.bat -i "tests[%scalaJsVersion%].test.native"
@call ./mill.bat -i "native[%scalaJsVersion%].copyToArtifacts" artifacts/
@call ./mill.bat -i "tests.test.native"
@call ./mill.bat -i "native.copyToArtifacts" artifacts/
shell: cmd
if: runner.os == 'Windows'
env:
scalaJsVersion: ${{ matrix.scalaJsVersion }}
- uses: actions/upload-artifact@v3.1.2
with:
name: launcher-${{ matrix.os }}
Expand All @@ -94,8 +89,6 @@ jobs:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
scalaJsVersion: ["1.9.0", "1.10.0", "1.10.1", "1.11.0", "1.12.0", "1.13.1"]
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -106,12 +99,10 @@ jobs:
with:
jvm: temurin:17
- run: |
./mill -i "native-static[$scalaJsVersion].writeNativeImageScript" generate.sh "" && \
./mill -i "native-static.writeNativeImageScript" generate.sh "" && \
./generate.sh && \
./mill -i "tests[$scalaJsVersion].test.nativeStatic" && \
./mill -i "native-static[$scalaJsVersion].copyToArtifacts" artifacts/
env:
scalaJsVersion: ${{ matrix.scalaJsVersion }}
./mill -i "tests.test.nativeStatic" && \
./mill -i "native-static.copyToArtifacts" artifacts/
- uses: actions/upload-artifact@v3.1.2
with:
name: launcher-${{ matrix.os }}-static
Expand All @@ -128,8 +119,6 @@ jobs:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
scalaJsVersion: ["1.9.0", "1.10.0", "1.10.1", "1.11.0", "1.12.0", "1.13.1"]
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -140,12 +129,10 @@ jobs:
with:
jvm: temurin:17
- run: |
./mill -i "native-mostly-static[$scalaJsVersion].writeNativeImageScript" generate.sh "" && \
./mill -i "native-mostly-static.writeNativeImageScript" generate.sh "" && \
./generate.sh && \
./mill -i "tests[$scalaJsVersion].test.nativeStatic" && \
./mill -i "native-mostly-static[$scalaJsVersion].copyToArtifacts" artifacts/
env:
scalaJsVersion: ${{ matrix.scalaJsVersion }}
./mill -i "tests.test.nativeStatic" && \
./mill -i "native-mostly-static.copyToArtifacts" artifacts/
- uses: actions/upload-artifact@v3.1.2
with:
name: launcher-${{ matrix.os }}-mostly-static
Expand Down
2 changes: 1 addition & 1 deletion .mill-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.12
0.11.1
93 changes: 31 additions & 62 deletions build.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.3.0`
import $ivy.`io.github.alexarchambault.mill::mill-native-image::0.1.23`
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0`
import $ivy.`io.github.alexarchambault.mill::mill-native-image::0.1.25`
import $ivy.`io.github.alexarchambault.mill::mill-native-image-upload:0.1.19`
import $ivy.`io.get-coursier::coursier-launcher:2.1.0-M2`

Expand All @@ -17,30 +17,18 @@ import scala.util.Properties.isWin


def scalaJsCliVersion = "1.1.1-sc5"
def scala213 = "2.13.10"
def latestScalaJsVersion = "1.13.1"
def scalaJsVersions = Seq("1.9.0", "1.10.0", "1.10.1", "1.11.0", "1.12.0", latestScalaJsVersion)

object cli extends Cross[Cli](scalaJsVersions: _*)

class Cli(val scalaJsVersion0: String) extends ScalaModule with ScalaJsCliPublishModule {
def scala213 = "2.13.12"
def scalaJsVersion = "1.13.2"
object cli extends Cli
trait Cli extends ScalaModule with ScalaJsCliPublishModule {
def scalaVersion = scala213
def artifactName = "scalajs" + super.artifactName()
def ivyDeps = super.ivyDeps() ++ Seq(
ivy"org.scala-js::scalajs-linker:$scalaJsVersion0",
ivy"org.scala-js::scalajs-linker:$scalaJsVersion",
ivy"com.github.scopt::scopt:4.1.0"
)
def millSourcePath = super.millSourcePath / os.up

def mainClass = Some("org.scalajs.cli.Scalajsld")

def sources = T.sources {
val extra =
if (Version(scalaJsVersion0) == Version("1.9.0")) millSourcePath / "scala-js-1.9"
else millSourcePath / "scala-js-1.10+"
super.sources() ++ Seq(PathRef(extra))
}

def transitiveJars: T[Agg[PathRef]] = {

def allModuleDeps(todo: List[JavaModule]): List[JavaModule] = {
Expand Down Expand Up @@ -73,7 +61,6 @@ class Cli(val scalaJsVersion0: String) extends ScalaModule with ScalaJsCliPublis
else None

import coursier.launcher.{
AssemblyGenerator,
BootstrapGenerator,
ClassPathEntry,
Parameters,
Expand Down Expand Up @@ -107,9 +94,8 @@ class Cli(val scalaJsVersion0: String) extends ScalaModule with ScalaJsCliPublis
}
}

class ScalaJsCliNativeImage(val scalaJsVersion0: String) extends ScalaModule with NativeImage {
trait ScalaJsCliNativeImage extends ScalaModule with NativeImage {
def scalaVersion = scala213
def scalaJsVersion = scalaJsVersion0

def nativeImageClassPath = T{
runClasspath()
Expand All @@ -123,11 +109,11 @@ class ScalaJsCliNativeImage(val scalaJsVersion0: String) extends ScalaModule wit
)
}
def nativeImagePersist = System.getenv("CI") != null
def graalVmVersion = "22.3.1"
def graalVmVersion = "22.3.2"
def nativeImageGraalVmJvmId = s"graalvm-java17:$graalVmVersion"
def nativeImageName = "scala-js-ld"
def moduleDeps() = Seq(
cli(scalaJsVersion0)
cli
)
def compileIvyDeps = super.compileIvyDeps() ++ Seq(
ivy"org.graalvm.nativeimage:svm:$graalVmVersion"
Expand All @@ -139,20 +125,20 @@ class ScalaJsCliNativeImage(val scalaJsVersion0: String) extends ScalaModule wit
val _ = Upload.copyLauncher(
nativeImage().path,
directory,
s"scala-js-ld-$scalaJsVersion",
s"scala-js-ld",
compress = true,
suffix = nameSuffix
)
}
}

object native extends Cross[ScalaJsCliNativeImage](scalaJsVersions: _*)
object native extends ScalaJsCliNativeImage

def native0 = native

def csDockerVersion = "2.1.0-M5-18-gfebf9838c"

class ScalaJsCliStaticNativeImage(scalaJsVersion0: String) extends ScalaJsCliNativeImage(scalaJsVersion0) {
trait ScalaJsCliStaticNativeImage extends ScalaJsCliNativeImage {
def nameSuffix = "-static"
def buildHelperImage = T {
os.proc("docker", "build", "-t", "scala-cli-base-musl:latest", ".")
Expand All @@ -173,9 +159,9 @@ class ScalaJsCliStaticNativeImage(scalaJsVersion0: String) extends ScalaJsCliNat
super.writeNativeImageScript(scriptDest, imageDest)()
}
}
object `native-static` extends Cross[ScalaJsCliStaticNativeImage](scalaJsVersions: _*)
object `native-static` extends ScalaJsCliStaticNativeImage

class ScalaJsCliMostlyStaticNativeImage(scalaJsVersion0: String) extends ScalaJsCliNativeImage(scalaJsVersion0) {
trait ScalaJsCliMostlyStaticNativeImage extends ScalaJsCliNativeImage {
def nameSuffix = "-mostly-static"
def nativeImageDockerParams = Some(
NativeImage.linuxMostlyStaticParams(
Expand All @@ -184,16 +170,15 @@ class ScalaJsCliMostlyStaticNativeImage(scalaJsVersion0: String) extends ScalaJs
)
)
}
object `native-mostly-static` extends Cross[ScalaJsCliMostlyStaticNativeImage](scalaJsVersions: _*)
object `native-mostly-static` extends ScalaJsCliMostlyStaticNativeImage

object tests extends Cross[Tests](scalaJsVersions: _*)
class Tests(val scalaJsVersion0: String) extends ScalaModule {
object tests extends ScalaModule {
def scalaVersion = scala213

object test extends Tests {
object test extends ScalaTests {
def ivyDeps = super.ivyDeps() ++ Seq(
ivy"org.scalameta::munit:0.7.29",
ivy"com.lihaoyi::os-lib:0.9.0",
ivy"com.lihaoyi::os-lib:0.9.1",
ivy"com.lihaoyi::pprint:0.8.1"
)
def testFramework = "munit.Framework"
Expand All @@ -206,7 +191,7 @@ class Tests(val scalaJsVersion0: String) extends ScalaModule {
val launcher = launcherTask().path
val extraArgs = Seq(
s"-Dtest.scala-js-cli.path=$launcher",
s"-Dtest.scala-js-cli.scala-js-version=$scalaJsVersion0"
s"-Dtest.scala-js-cli.scala-js-version=$scalaJsVersion"
)
args ++ extraArgs
}
Expand All @@ -219,41 +204,23 @@ class Tests(val scalaJsVersion0: String) extends ScalaModule {
def test(args: String*) =
jvm(args: _*)
def jvm(args: String*) =
new TestHelper(cli(scalaJsVersion0).standaloneLauncher).test(args: _*)
new TestHelper(cli.standaloneLauncher).test(args: _*)
def native(args: String*) =
new TestHelper(native0(scalaJsVersion0).nativeImage).test(args: _*)
new TestHelper(native0.nativeImage).test(args: _*)
def nativeStatic(args: String*) =
new TestHelper(`native-static`(scalaJsVersion0).nativeImage).test(args: _*)
new TestHelper(`native-static`.nativeImage).test(args: _*)
def nativeMostlyStatic(args: String*) =
new TestHelper(`native-mostly-static`(scalaJsVersion0).nativeImage).test(args: _*)

private def updateRef(ref: PathRef): PathRef = {
val rawPath = ref.path.toString.replace(
File.separator + scalaJsVersion0 + File.separator,
File.separator
)
PathRef(os.Path(rawPath))
}
def sources = T.sources {
super.sources().flatMap { ref =>
Seq(updateRef(ref), ref)
}
}
def resources = T.sources {
super.resources().flatMap { ref =>
Seq(updateRef(ref), ref)
}
}
new TestHelper(`native-mostly-static`.nativeImage).test(args: _*)
}
}

def ghOrg = "scala-cli"
def ghOrg = "virtuslab"
def ghName = "scala-js-cli"
trait ScalaJsCliPublishModule extends PublishModule {
import mill.scalalib.publish._
def pomSettings = PomSettings(
description = artifactName(),
organization = "io.github.alexarchambault.tmp",
organization = "org.virtuslab.scala-cli",
url = s"https://github.com/$ghOrg/$ghName",
licenses = Seq(License.`BSD-3-Clause`),
versionControl = VersionControl.github(ghOrg, ghName),
Expand Down Expand Up @@ -357,8 +324,8 @@ object ci extends Module {
set.head
}
val publisher = new scalalib.publish.SonatypePublisher(
uri = "https://s01.oss.sonatype.org/service/local",
snapshotUri = "https://s01.oss.sonatype.org/content/repositories/snapshots",
uri = "https://oss.sonatype.org/service/local",
snapshotUri = "https://oss.sonatype.org/content/repositories/snapshots",
credentials = credentials,
signed = true,
// format: off
Expand Down Expand Up @@ -395,7 +362,9 @@ object ci extends Module {
if (version.endsWith("-SNAPSHOT")) ("launchers", true)
else ("v" + version, false)

Upload.upload("scala-cli", "scala-js-cli", ghToken, tag, dryRun = false, overwrite = overwriteAssets)(launchers: _*)
Upload.upload(ghOrg, ghName, ghToken, tag, dryRun = false, overwrite = overwriteAssets)(launchers: _*)
if(version != scalaJsVersion && !version.endsWith("-SNAPSHOT")) // when we release `0.13.0.1` we should also update native launchers in tag `0.13.0`
Upload.upload(ghOrg, ghName, ghToken, s"v$scalaJsVersion", dryRun = false, overwrite = true)(launchers: _*)
}
}

Expand Down

This file was deleted.

5 changes: 4 additions & 1 deletion cli/src/org/scalajs/cli/Scalajsld.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import java.io.File
import java.net.URI
import java.nio.file.Path
import java.lang.NoClassDefFoundError
import org.scalajs.cli.internal.ModuleSplitStyleParser
import org.scalajs.cli.internal.{EsVersionParser, ModuleSplitStyleParser}

object Scalajsld {

Expand Down Expand Up @@ -153,6 +153,9 @@ object Scalajsld {
opt[Unit]("es2015")
.action { (_, c) => c.copy(esFeatures = c.esFeatures.withESVersion(ESVersion.ES2015)) }
.text("Use ECMAScript 2015")
opt[String]("esVersion")
.action { (esV, c) => c.copy(esFeatures = c.esFeatures.withESVersion(EsVersionParser.parse(esV))) }
.text("EsVersion " + EsVersionParser.All.mkString("(", ", ", ")"))
opt[ModuleKind]('k', "moduleKind")
.action { (kind, c) => c.copy(moduleKind = kind) }
.text("Module kind " + ModuleKind.All.mkString("(", ", ", ")"))
Expand Down
23 changes: 23 additions & 0 deletions cli/src/org/scalajs/cli/internal/EsVersionParser.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.scalajs.cli.internal

import org.scalajs.linker.interface.ESVersion

import java.util.Locale

object EsVersionParser {
def parse(esVersion: String): ESVersion =
esVersion.trim.toLowerCase(Locale.ROOT) match {
case "es5_1" => ESVersion.ES5_1
case "es2015" => ESVersion.ES2015
case "es2016" => ESVersion.ES2016
case "es2017" => ESVersion.ES2017
case "es2018" => ESVersion.ES2018
case "es2019" => ESVersion.ES2019
case "es2020" => ESVersion.ES2020
case "es2021" => ESVersion.ES2021
case unknown => throw new IllegalArgumentException(s"Warning: unrecognized argument: $unknown for --esVersion parameter")
}

val All: List[ESVersion] =
List(ESVersion.ES5_1, ESVersion.ES2015, ESVersion.ES2016, ESVersion.ES2017, ESVersion.ES2018, ESVersion.ES2019, ESVersion.ES2020, ESVersion.ES2021)
}
Loading