diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11f7faba2..48653386d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,12 +23,6 @@ jobs: scala-version: [ "2.12", "2.13", "3" ] target-platform: [ "JVM", "JS", "Native" ] java: [ "11", "21" ] - exclude: - - java: "21" - include: # Restricted to build only specific Loom-based modules - - scala-version: "3" - target-platform: "JVM" - java: "21" steps: - name: Checkout uses: actions/checkout@v2 @@ -50,8 +44,11 @@ jobs: uses: VirtusLab/scala-cli-setup@77834b5926f3eb70869d8009530c65585f7a039b # main, specifically v1.9.1 with: jvm: '' # needed because scala-cli-setup otherwise forces the installation of their default JVM (17) - - name: Enable Loom-specific modules + - name: Enable ZIO-specific modules if: matrix.java == '21' + run: echo "WITH_ZIO=1" >> $GITHUB_ENV + - name: Enable Loom-specific modules + if: matrix.target-platform == 'JVM' && matrix.java == '21' && matrix.scala-version == '3' run: echo "ONLY_LOOM=1" >> $GITHUB_ENV - name: Compile run: sbt -v "compileScoped ${{ matrix.scala-version }} ${{ matrix.target-platform }}" @@ -100,10 +97,13 @@ jobs: sudo apt-get update sudo apt-get install libidn2-dev libcurl3-dev - name: Enable Native-specific modules - if: matrix.java == '11' + if: matrix.target-platform == 'Native' run: echo "STTP_NATIVE=1" >> $GITHUB_ENV - - name: Enable Loom-specific modules + - name: Enable ZIO-specific modules if: matrix.java == '21' + run: echo "WITH_ZIO=1" >> $GITHUB_ENV + - name: Enable Loom-specific modules + if: matrix.target-platform == 'JVM' && matrix.java == '21' && matrix.scala-version == '3' run: echo "ONLY_LOOM=1" >> $GITHUB_ENV - name: Compile run: sbt compile diff --git a/build.sbt b/build.sbt index 90bd8dd4d..f1863588f 100644 --- a/build.sbt +++ b/build.sbt @@ -176,7 +176,8 @@ val slf4jVersion = "1.7.36" val compileAndTest = "compile->compile;test->test" -lazy val loomProjects: Seq[String] = Seq(ox, examples).flatMap(_.projectRefs).flatMap(projectId) +lazy val loomProjects: Seq[String] = Seq(ox, examples, zioJson).flatMap(_.projectRefs).flatMap(projectId) +lazy val zioProjects: Seq[String] = Seq(zioJson).flatMap(_.projectRefs).flatMap(projectId) def projectId(projectRef: ProjectReference): Option[String] = projectRef match { @@ -193,15 +194,24 @@ lazy val allAggregates: Seq[ProjectReference] = { println("[info] STTP_NATIVE *not* defined, *not* including native in the aggregate projects") rawAllAggregates.filterNot(_.toString.contains("Native")) } + + val filteredByZio = if (sys.env.isDefinedAt("WITH_ZIO")) { + println("[info] WITH_ZIO defined, including zio projects in the aggregate projects") + filteredByNative + } else { + println("[info] WITH_ZIO *not* defined, *not* including zio-json in the aggregate projects") + filteredByNative.filterNot(p => projectId(p).forall(zioProjects.contains)) + } + if (sys.env.isDefinedAt("ONLY_LOOM")) { println("[info] ONLY_LOOM defined, including only loom-based projects") - filteredByNative.filter(p => projectId(p).forall(loomProjects.contains)) + filteredByZio.filter(p => projectId(p).forall(loomProjects.contains)) } else if (sys.env.isDefinedAt("ALSO_LOOM")) { println("[info] ALSO_LOOM defined, including also loom-based projects") - filteredByNative + filteredByZio } else { println("[info] ONLY_LOOM *not* defined, *not* including loom-based-projects") - filteredByNative.filterNot(p => projectId(p).forall(loomProjects.contains)) + filteredByZio.filterNot(p => projectId(p).forall(loomProjects.contains)) } } @@ -789,7 +799,7 @@ lazy val zioJson = (projectMatrix in file("json/zio-json")) .settings( name := "zio-json", libraryDependencies ++= Seq( - "dev.zio" %%% "zio-json" % "0.7.44", + "dev.zio" %%% "zio-json" % "0.9.0", "com.softwaremill.sttp.shared" %%% "zio" % sttpSharedVersion ), scalaTest @@ -799,6 +809,7 @@ lazy val zioJson = (projectMatrix in file("json/zio-json")) settings = commonJvmSettings ) .jsPlatform(scalaVersions = scala2And3, settings = commonJsSettings) + .nativePlatform(scalaVersions = scala2And3, settings = commonNativeSettings) .dependsOn(core, jsonCommon % compileAndTest) lazy val zio1Json = (projectMatrix in file("json/zio1-json"))