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

Attempt at adding Native support for core #368

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
42 changes: 39 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@ jobs:
os: [ubuntu-latest]
scala: [2.12, 2.13, 3]
java: [temurin@8, temurin@17]
project: [rootJS, rootJVM, plugin]
project: [rootJS, rootJVM, rootNative, plugin]
exclude:
- scala: 2.13
java: temurin@17
- scala: 3
java: temurin@17
- project: rootJS
java: temurin@17
- project: rootNative
java: temurin@17
- project: plugin
java: temurin@17
- project: plugin
Expand Down Expand Up @@ -89,6 +91,10 @@ jobs:
if: matrix.project == 'rootJS'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult

- name: nativeLink
if: matrix.project == 'rootNative'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/nativeLink

- name: Test
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test

Expand All @@ -110,11 +116,11 @@ jobs:

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: mkdir -p sbt/target pdf/target preview/target core/js/target io/target unidoc/target core/jvm/target project/target
run: mkdir -p sbt/target pdf/target preview/target core/native/target core/js/target io/target unidoc/target core/jvm/target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: tar cf targets.tar sbt/target pdf/target preview/target core/js/target io/target unidoc/target core/jvm/target project/target
run: tar cf targets.tar sbt/target pdf/target preview/target core/native/target core/js/target io/target unidoc/target core/jvm/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
Expand Down Expand Up @@ -184,6 +190,16 @@ jobs:
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.12, rootNative)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootNative

- name: Inflate target directories (2.12, rootNative)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.12, plugin)
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -214,6 +230,16 @@ jobs:
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.13, rootNative)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootNative

- name: Inflate target directories (2.13, rootNative)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (3, rootJS)
uses: actions/download-artifact@v3
with:
Expand All @@ -234,6 +260,16 @@ jobs:
tar xf targets.tar
rm targets.tar

- name: Download target directories (3, rootNative)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootNative

- name: Inflate target directories (3, rootNative)
run: |
tar xf targets.tar
rm targets.tar

- name: Import signing key
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
env:
Expand Down
13 changes: 8 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ def disableUnusedWarningsForMdoc(options: Seq[String]): Seq[String] =
val munit = "org.scalameta" %% "munit" % versions.munit % "test"
val jTidy = "net.sf.jtidy" % "jtidy" % versions.jTidy % "test"

val catsEffect = "org.typelevel" %% "cats-effect" % versions.catsEffect
val fs2IO = "co.fs2" %% "fs2-io" % versions.fs2
val munitCE3 = "org.typelevel" %% "munit-cats-effect-3" % versions.munitCE3 % "test"
val catsEffect = "org.typelevel" %% "cats-effect" % versions.catsEffect
val fs2IO = "co.fs2" %% "fs2-io" % versions.fs2
val munitCE = "org.typelevel" %% "munit-cats-effect" % versions.munitCE % "test"

val fop = "org.apache.xmlgraphics" % "fop" % versions.fop

Expand Down Expand Up @@ -115,7 +115,7 @@ lazy val api = project
)
)

lazy val core = crossProject(JSPlatform, JVMPlatform)
lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(CrossType.Full)
.in(file("core"))
Expand All @@ -135,12 +135,15 @@ lazy val core = crossProject(JSPlatform, JVMPlatform)
_.withModuleKind(ModuleKind.CommonJSModule).withESFeatures(_.withESVersion(ESVersion.ES2018))
}
)
.nativeSettings(
libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % versions.scalaJavaTime
)

lazy val io = project.in(file("io"))
.dependsOn(core.jvm % "compile->compile;test->test")
.settings(
name := "laika-io",
libraryDependencies ++= Seq(catsEffect, fs2IO, munit, munitCE3),
libraryDependencies ++= Seq(catsEffect, fs2IO, munit, munitCE),
Test / scalacOptions ~= disableMissingInterpolatorWarning
)

Expand Down
10 changes: 6 additions & 4 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ object Dependencies {
val fs2 = "3.9.2"
val http4s = "0.23.23"

val munit = "0.7.29"
val munitCE3 = "1.0.7"
val jTidy = "r938"
val fop = "2.9"
val munit = "1.0.0-M10"
val munitCE = "2.0.0-M3"
val jTidy = "r938"
val fop = "2.9"

val scalaJavaTime = "2.5.0"
}

}
Loading