From fa255a41598167c9910abe81adff44f6cc8e2ae8 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Wed, 15 Nov 2023 10:08:39 +0100 Subject: [PATCH] Fix publishing on Scala 3 --- .github/workflows/actions.yml | 15 +++++++++++++-- build.sc | 10 ++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 852f57cfc..63daaae1d 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: java-version: [8, 11] - scala-version: [2.12.18, 2.13.12, 3.3.1] + scala-version: [2.12.18, 2.13.12, 3.2.2, 3.3.1] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -24,12 +24,13 @@ jobs: with: java-version: ${{ matrix.java-version }} - run: ./mill -i unitTest "${{ matrix.scala-version }}" + - run: ./mill -i unitTest "${{ matrix.scala-version }}" itest: strategy: fail-fast: false matrix: java-version: [8, 11] - scala-version: [2.12.18, 2.13.12, 3.3.1] + scala-version: [2.12.18, 2.13.12, 3.2.2, 3.3.1] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -39,3 +40,13 @@ jobs: with: java-version: ${{ matrix.java-version }} - run: ./mill -i integrationTest ${{ matrix.scala-version }} + publishLocal: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: ./mill -i __.publishLocal diff --git a/build.sc b/build.sc index c5698d7d2..cbfcd785e 100644 --- a/build.sc +++ b/build.sc @@ -365,6 +365,12 @@ object amm extends Cross[MainModule](fullCrossScalaVersions:_*){ def ivyDeps = Agg( Deps.coursierInterface ) + override def docJar = if (isScala3(crossScalaVersion)) T { + val outDir = T.ctx().dest + val javadocDir = outDir / "javadoc" + os.makeDir.all(javadocDir) + mill.api.Result.Success(mill.modules.Jvm.createJar(Agg(javadocDir))(outDir)) + } else super.docJar def constantsSourceDir = T { val dir = T.dest / "src" val dest = dir / "Constants.scala" @@ -698,14 +704,14 @@ class SshdModule(val crossScalaVersion: String) extends AmmModule{ } } -def unitTest(scalaVersion: String = sys.env("TRAVIS_SCALA_VERSION")) = T.command{ +def unitTest(scalaVersion: String) = T.command{ terminal(scalaVersion).test.test()() amm.repl(scalaVersion).test.test()() amm(scalaVersion).test.test()() sshd(scalaVersion).test.test()() } -def integrationTest(scalaVersion: String = sys.env("TRAVIS_SCALA_VERSION")) = T.command{ +def integrationTest(scalaVersion: String) = T.command{ integration(scalaVersion).test.test()() }