Skip to content

Commit 019d800

Browse files
committed
Update Scala Native to 0.5
1 parent bd661c3 commit 019d800

12 files changed

Lines changed: 1380 additions & 700 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
os: [ubuntu-22.04]
3131
scala: [2.13, 3]
3232
java: [temurin@17]
33-
project: [rootJS, rootJVM]
33+
project: [rootJS, rootJVM, rootNative]
3434
runs-on: ${{ matrix.os }}
3535
timeout-minutes: 60
3636
steps:
@@ -55,6 +55,10 @@ jobs:
5555
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
5656
run: sbt +update
5757

58+
- name: Install brew formulae (ubuntu)
59+
if: (matrix.project == 'rootNative') && startsWith(matrix.os, 'ubuntu')
60+
run: /home/linuxbrew/.linuxbrew/bin/brew install openssl
61+
5862
- name: Check that workflows are up to date
5963
run: sbt githubWorkflowCheck
6064

@@ -70,6 +74,10 @@ jobs:
7074
if: matrix.project == 'rootJS'
7175
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult
7276

77+
- name: nativeLink
78+
if: matrix.project == 'rootNative'
79+
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/nativeLink
80+
7381
- name: Test
7482
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test
7583

@@ -83,11 +91,11 @@ jobs:
8391

8492
- name: Make target directories
8593
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
86-
run: mkdir -p modules/s3/jvm/target modules/core/js/target modules/core/jvm/target modules/s3/js/target project/target
94+
run: mkdir -p modules/s3/jvm/target modules/core/native/target modules/core/js/target modules/core/jvm/target modules/s3/native/target modules/s3/js/target project/target
8795

8896
- name: Compress target directories
8997
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
90-
run: tar cf targets.tar modules/s3/jvm/target modules/core/js/target modules/core/jvm/target modules/s3/js/target project/target
98+
run: tar cf targets.tar modules/s3/jvm/target modules/core/native/target modules/core/js/target modules/core/jvm/target modules/s3/native/target modules/s3/js/target project/target
9199

92100
- name: Upload target directories
93101
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
@@ -147,6 +155,16 @@ jobs:
147155
tar xf targets.tar
148156
rm targets.tar
149157
158+
- name: Download target directories (2.13, rootNative)
159+
uses: actions/download-artifact@v6
160+
with:
161+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootNative
162+
163+
- name: Inflate target directories (2.13, rootNative)
164+
run: |
165+
tar xf targets.tar
166+
rm targets.tar
167+
150168
- name: Download target directories (3, rootJS)
151169
uses: actions/download-artifact@v6
152170
with:
@@ -167,6 +185,16 @@ jobs:
167185
tar xf targets.tar
168186
rm targets.tar
169187
188+
- name: Download target directories (3, rootNative)
189+
uses: actions/download-artifact@v6
190+
with:
191+
name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootNative
192+
193+
- name: Inflate target directories (3, rootNative)
194+
run: |
195+
tar xf targets.tar
196+
rm targets.tar
197+
170198
- name: Import signing key
171199
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
172200
env:

.jvmopts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-Dfile.encoding=UTF8
2+
-Xms2G
3+
-Xmx8G
4+
-Xss4M
5+
-XX:MaxMetaspaceSize=512M
6+
-XX:+UseG1GC

build.sbt

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
val awsRegionsVersion = "1.0.1"
1+
val awsRegionsVersion = "1.1.0"
22
val caseInsensitiveVersion = "1.5.0"
33
val catsEffectVersion = "3.7.0"
44
val catsParseVersion = "1.1.0"
55
val catsVersion = "2.13.0"
66
val circeVersion = "0.14.15"
77
val fs2DataVersion = "1.13.0"
88
val fs2Version = "3.13.0"
9-
val http4sVersion = "0.23.33"
9+
val http4sVersion = "0.23.34"
1010
val literallyVersion = "1.2.0"
1111
val munitCatsEffectVersion = "2.2.0"
1212
val scala213Version = "2.13.18"
@@ -25,8 +25,10 @@ inThisBuild(
2525
tlGitHubDev("jesperoman", "Jesper Öman"),
2626
tlGitHubDev("vlovgr", "Viktor Rudebeck")
2727
),
28+
githubWorkflowBuildPreamble ++= nativeBrewInstallWorkflowSteps.value,
2829
githubWorkflowJavaVersions := Seq(JavaSpec.temurin("17")),
2930
githubWorkflowTargetBranches := Seq("**"),
31+
nativeBrewInstallCond := Some("matrix.project == 'rootNative'"),
3032
licenses := Seq(License.Apache2),
3133
mimaBinaryIssueFilters ++= {
3234
import com.typesafe.tools.mima.core._
@@ -65,7 +67,7 @@ inThisBuild(
6567
lazy val root = tlCrossRootProject
6668
.aggregate(core, s3)
6769

68-
lazy val core = crossProject(JVMPlatform, JSPlatform)
70+
lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
6971
.in(file("modules/core"))
7072
.settings(
7173
name := "http4s-aws",
@@ -96,8 +98,13 @@ lazy val core = crossProject(JVMPlatform, JSPlatform)
9698
tlVersionIntroduced := List("2.13", "3").map(_ -> "6.2.0").toMap,
9799
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule))
98100
)
101+
.nativeEnablePlugins(ScalaNativeBrewedConfigPlugin)
102+
.nativeSettings(
103+
tlVersionIntroduced := List("2.13", "3").map(_ -> "6.5.0").toMap,
104+
Test / nativeBrewFormulas += "openssl"
105+
)
99106

100-
lazy val s3 = crossProject(JVMPlatform, JSPlatform)
107+
lazy val s3 = crossProject(JVMPlatform, JSPlatform, NativePlatform)
101108
.in(file("modules/s3"))
102109
.dependsOn(core)
103110
.settings(
@@ -133,3 +140,8 @@ lazy val s3 = crossProject(JVMPlatform, JSPlatform)
133140
"org.testcontainers" % "testcontainers-localstack" % testcontainersVersion % Test
134141
)
135142
)
143+
.nativeEnablePlugins(ScalaNativeBrewedConfigPlugin)
144+
.nativeSettings(
145+
tlVersionIntroduced := List("2.13", "3").map(_ -> "6.5.0").toMap,
146+
Test / nativeBrewFormulas += "openssl"
147+
)

0 commit comments

Comments
 (0)