Skip to content

Commit

Permalink
Merge pull request #1 from alexarchambault/scala-js-1.10
Browse files Browse the repository at this point in the history
Add Scala.js 1.10.0 support
  • Loading branch information
alexarchambault authored Apr 5, 2022
2 parents 3a9a90c + e399739 commit 8f814c3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
35 changes: 26 additions & 9 deletions .github/workflows/launchers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2016, macos-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
scalaJsVersion: ["1.9.0", "1.10.0"]
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -23,16 +24,20 @@ jobs:
with:
jvm: 8
- run: |
./mill -i "native.writeNativeImageScript" generate.sh "" && \
./mill -i "native[$scalaJsVersion].writeNativeImageScript" generate.sh "" && \
./generate.sh && \
./mill -i "native.copyToArtifacts" artifacts/
./mill -i "native[$scalaJsVersion].copyToArtifacts" artifacts/
if: runner.os != 'Windows'
env:
scalaJsVersion: ${{ matrix.scalaJsVersion }}
- run: |
@call ./mill.bat -i "native.writeNativeImageScript" generate.bat ""
@call ./mill.bat -i "native[%scalaJsVersion%].writeNativeImageScript" generate.bat ""
@call generate.bat
@call ./mill.bat -i "native.copyToArtifacts" artifacts/
@call ./mill.bat -i "native[%scalaJsVersion%].copyToArtifacts" artifacts/
shell: cmd
if: runner.os == 'Windows'
env:
scalaJsVersion: ${{ matrix.scalaJsVersion }}
- uses: actions/[email protected]
with:
name: launcher-${{ matrix.os }}
Expand All @@ -46,6 +51,10 @@ jobs:

generate-static-launcher:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
scalaJsVersion: ["1.9.0", "1.10.0"]
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -56,9 +65,11 @@ jobs:
with:
jvm: 8
- run: |
./mill -i "native-static.writeNativeImageScript" generate.sh "" && \
./mill -i "native-static[$scalaJsVersion].writeNativeImageScript" generate.sh "" && \
./generate.sh && \
./mill -i "native-static.copyToArtifacts" artifacts/
./mill -i "native-static[$scalaJsVersion].copyToArtifacts" artifacts/
env:
scalaJsVersion: ${{ matrix.scalaJsVersion }}
- uses: actions/[email protected]
with:
name: launcher-${{ matrix.os }}-static
Expand All @@ -72,6 +83,10 @@ jobs:

generate-mostly-static-launcher:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
scalaJsVersion: ["1.9.0", "1.10.0"]
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -82,9 +97,11 @@ jobs:
with:
jvm: 8
- run: |
./mill -i "native-mostly-static.writeNativeImageScript" generate.sh "" && \
./mill -i "native-mostly-static[$scalaJsVersion].writeNativeImageScript" generate.sh "" && \
./generate.sh && \
./mill -i "native-mostly-static.copyToArtifacts" artifacts/
./mill -i "native-mostly-static[$scalaJsVersion].copyToArtifacts" artifacts/
env:
scalaJsVersion: ${{ matrix.scalaJsVersion }}
- uses: actions/[email protected]
with:
name: launcher-${{ matrix.os }}-mostly-static
Expand Down
13 changes: 8 additions & 5 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import mill._
import mill.scalalib._

def scalaJsCliVersion = "1.1.1-sc1"
def scalaJsVersions = Seq("1.9.0", "1.10.0")

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

def nativeImageClassPath = T{
runClasspath()
Expand Down Expand Up @@ -44,11 +45,11 @@ trait ScalaJsCliNativeImage extends ScalaModule with NativeImage {
}
}

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

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

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

object `native-mostly-static` extends ScalaJsCliNativeImage {
class ScalaJsCliMostlyStaticNativeImage(scalaJsVersion0: String) extends ScalaJsCliNativeImage(scalaJsVersion0) {
def nameSuffix = "-mostly-static"
def nativeImageDockerParams = Some(
NativeImage.linuxMostlyStaticParams(
Expand All @@ -79,6 +81,7 @@ object `native-mostly-static` extends ScalaJsCliNativeImage {
)
)
}
object `native-mostly-static` extends Cross[ScalaJsCliMostlyStaticNativeImage](scalaJsVersions: _*)


def publishVersion = T{
Expand Down

0 comments on commit 8f814c3

Please sign in to comment.