diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e9fd1f..272660a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,6 @@ jobs: java-version: ${{ matrix.java }} cache: sbt - name: Compile Docs - run: JAVA_OPTS="--add-opens java.base/java.lang=ALL-UNNAMED" sbt "++ ${{ matrix.scala }} mdoc" + run: JAVA_OPTS="--add-opens java.base/java.lang=ALL-UNNAMED" sbt "++ ${{ matrix.scala }} docs/mdoc" - name: Run tests run: JAVA_OPTS="--add-opens java.base/java.lang=ALL-UNNAMED" sbt -DflinkVersion=${{ matrix.flink }} "++ ${{ matrix.scala }} test" diff --git a/build.sbt b/build.sbt index 2690562..1135f72 100644 --- a/build.sbt +++ b/build.sbt @@ -4,6 +4,7 @@ Global / onChangedBuildSource := ReloadOnSourceChanges Global / excludeLintKeys := Set(git.useGitDescribe) lazy val rootScalaVersion = "3.3.4" +lazy val crossVersions = Seq("2.13.15", rootScalaVersion) lazy val flinkVersion = System.getProperty("flinkVersion", "1.18.1") lazy val root = (project in file(".")) @@ -18,10 +19,10 @@ lazy val `scala-api` = (project in file("modules/scala-api")) .settings( name := "flink-scala-api", scalaVersion := rootScalaVersion, - crossScalaVersions := Seq("2.13.15", rootScalaVersion), + crossScalaVersions := crossVersions, libraryDependencies ++= Seq( - "org.apache.flink" % "flink-streaming-java" % flinkVersion, - "org.apache.flink" % "flink-java" % flinkVersion, + "org.apache.flink" % "flink-streaming-java" % flinkVersion % Provided, + "org.apache.flink" % "flink-java" % flinkVersion % Provided, "org.apache.flink" % "flink-test-utils" % flinkVersion % Test, ("org.apache.flink" % "flink-streaming-java" % flinkVersion % Test).classifier("tests"), "org.typelevel" %% "cats-core" % "2.12.0" % Test, @@ -32,12 +33,12 @@ lazy val `scala-api` = (project in file("modules/scala-api")) if (scalaBinaryVersion.value.startsWith("2")) { Seq( "com.softwaremill.magnolia1_2" %% "magnolia" % "1.1.10", - "org.scala-lang" % "scala-reflect" % scalaVersion.value + "org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided ) } else { Seq( "com.softwaremill.magnolia1_3" %% "magnolia" % "1.3.8", - "org.scala-lang" %% "scala3-compiler" % scalaVersion.value + "org.scala-lang" %% "scala3-compiler" % scalaVersion.value % Provided ) } }, @@ -111,9 +112,21 @@ lazy val `scala-api` = (project in file("modules/scala-api")) commitNextVersion, pushChanges ) - else Seq.empty[ReleaseStep]), - mdocIn := new File("README.md") + else Seq.empty[ReleaseStep]) + ) + +lazy val docs = project // new documentation project + .in(file("modules/docs")) // important: it must not be docs/ + .settings( + scalaVersion := rootScalaVersion, + crossScalaVersions := crossVersions, + mdocIn := new File("README.md"), + publish / skip := true, + libraryDependencies ++= Seq( + "org.apache.flink" % "flink-streaming-java" % flinkVersion + ) ) + .dependsOn(`scala-api`) .enablePlugins(MdocPlugin) val flinkMajorAndMinorVersion =