From 10fb5a2ed5603a7731cdc653b18d1b51f8c34ca8 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Thu, 29 Sep 2022 21:45:41 +0200 Subject: [PATCH 1/8] Update gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index eb5a316..77c1d5d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ target +.idea/ +.bsp/ From fcf58f1ed375ae45a2f79e1b36195e33b99d6345 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Thu, 29 Sep 2022 21:35:53 +0200 Subject: [PATCH 2/8] Drop Java 8 --- .github/workflows/build-test.yml | 6 +++--- project/OmnidocBuild.scala | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 7e3f6b6..2cba8f2 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,9 +15,9 @@ concurrency: jobs: publish-local: name: Publish local - uses: playframework/.github/.github/workflows/cmd.yml@v2 + uses: playframework/.github/.github/workflows/cmd.yml@v3 with: - java: 11, 8 + java: 17, 11 scala: 2.13.8, 2.12.16 cmd: sbt ++$MATRIX_SCALA publishLocal # Check that we can actually build and package the library @@ -26,4 +26,4 @@ jobs: if: github.event_name == 'pull_request' needs: # Should be last - "publish-local" - uses: playframework/.github/.github/workflows/rtm.yml@v2 + uses: playframework/.github/.github/workflows/rtm.yml@v3 diff --git a/project/OmnidocBuild.scala b/project/OmnidocBuild.scala index 1521429..8680de3 100644 --- a/project/OmnidocBuild.scala +++ b/project/OmnidocBuild.scala @@ -321,7 +321,7 @@ object OmnidocBuild { "-encoding", "UTF-8", "-source", - "8", + "11", ) } From 2a695d274239911085679247f361004f822a3de3 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Thu, 29 Sep 2022 23:15:19 +0200 Subject: [PATCH 3/8] Upgrade interplay --- .github/workflows/build-test.yml | 2 +- project/OmnidocBuild.scala | 22 +--------------------- project/plugins.sbt | 2 +- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 2cba8f2..f2d1e73 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -18,7 +18,7 @@ jobs: uses: playframework/.github/.github/workflows/cmd.yml@v3 with: java: 17, 11 - scala: 2.13.8, 2.12.16 + scala: 2.13.9, 2.12.17 cmd: sbt ++$MATRIX_SCALA publishLocal # Check that we can actually build and package the library finish: diff --git a/project/OmnidocBuild.scala b/project/OmnidocBuild.scala index 8680de3..2f297b1 100644 --- a/project/OmnidocBuild.scala +++ b/project/OmnidocBuild.scala @@ -10,7 +10,6 @@ import sbt.Keys._ import interplay._ import interplay.PlayBuildBase.autoImport._ import xerial.sbt.Sonatype.autoImport.sonatypeProfileName -import sbtrelease.ReleasePlugin.autoImport._ object OmnidocBuild { @@ -99,14 +98,13 @@ object OmnidocBuild { lazy val omnidoc = project .in(file(".")) - .enablePlugins(PlayLibrary, PlayReleaseBase) + .enablePlugins(PlayLibrary) .settings(omnidocSettings) .configs(Omnidoc) def omnidocSettings: Seq[Setting[_]] = projectSettings ++ dependencySettings ++ - releaseSettings ++ inConfig(Omnidoc) { updateSettings ++ extractSettings ++ @@ -138,24 +136,6 @@ object OmnidocBuild { ) ) - def releaseSettings: Seq[Setting[_]] = Seq( - releaseTagName := playVersion, - sonatypeProfileName := "com.typesafe.play", - releaseProcess := { - import ReleaseTransformations._ - - // Since the version comes externally, we don't set or update it here. - Seq[ReleaseStep]( - checkSnapshotDependencies, - tagRelease, - publishArtifacts, - releaseStepCommand("sonatypeBundleRelease"), - pushChanges - ) - } - - ) - def updateSettings: Seq[Setting[_]] = Seq( transitiveClassifiers := Seq(SourceClassifier, PlaydocClassifier), updatePlaydocClassifiers := updatePlaydocClassifiersTask.value diff --git a/project/plugins.sbt b/project/plugins.sbt index 5bc31f5..adc698a 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1 +1 @@ -addSbtPlugin("com.typesafe.play" % "interplay" % sys.props.getOrElse("interplay.version", "3.0.5")) +addSbtPlugin("com.typesafe.play" % "interplay" % sys.props.getOrElse("interplay.version", "3.1.0-RC3")) From 3a4f6e8e598f114033d4c3206960bc1877df65fe Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Fri, 30 Sep 2022 00:48:56 +0200 Subject: [PATCH 4/8] Workaround for updateSbtClassifiers --- project/OmnidocBuild.scala | 3 ++- project/build.properties | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/project/OmnidocBuild.scala b/project/OmnidocBuild.scala index 2f297b1..9079161 100644 --- a/project/OmnidocBuild.scala +++ b/project/OmnidocBuild.scala @@ -123,6 +123,7 @@ object OmnidocBuild { Resolver.sonatypeRepo("snapshots"), Resolver.sonatypeRepo("releases")), useCoursier := false, // so updatePlaydocClassifiers isn't empty + updateSbtClassifiers / useCoursier := true, // https://github.com/sbt/sbt/issues/5263#issuecomment-626462593 ) def dependencySettings: Seq[Setting[_]] = Seq( @@ -175,7 +176,7 @@ object OmnidocBuild { def compilerReporterSettings = Seq( compile / compilerReporter := { - new sbt.internal.server.LanguageServerReporter( + new sbt.internal.inc.LoggedReporter( maxErrors.value, streams.value.log, foldMappers(sourcePositionMappers.value) diff --git a/project/build.properties b/project/build.properties index 0837f7a..22af262 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.3.13 +sbt.version=1.7.1 From 0f806f8a4af3f38214ea919cdbf57f1d4ac2ac85 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Fri, 30 Sep 2022 10:08:44 +0200 Subject: [PATCH 5/8] Fix resolver warnings --- project/OmnidocBuild.scala | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/project/OmnidocBuild.scala b/project/OmnidocBuild.scala index 9079161..ace9f0f 100644 --- a/project/OmnidocBuild.scala +++ b/project/OmnidocBuild.scala @@ -119,9 +119,8 @@ object OmnidocBuild { version := playVersion, ThisBuild / playBuildRepoName := "omnidoc", crossScalaVersions := Seq(ScalaVersions.scala212, ScalaVersions.scala213), - resolvers ++= Seq( - Resolver.sonatypeRepo("snapshots"), - Resolver.sonatypeRepo("releases")), + resolvers ++= Resolver.sonatypeOssRepos("snapshots") ++ + Resolver.sonatypeOssRepos("releases"), useCoursier := false, // so updatePlaydocClassifiers isn't empty updateSbtClassifiers / useCoursier := true, // https://github.com/sbt/sbt/issues/5263#issuecomment-626462593 ) From 259675281df4a3e45bff542ef2afb43641026da8 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Fri, 30 Sep 2022 11:09:05 +0200 Subject: [PATCH 6/8] Fixes "References to undefined settings" Omnidoc / javadoc / tastyFiles from Omnidoc / javadoc ((sbt.Defaults.docTaskSettings) Defaults.scala:2123) Omnidoc / compile / bspReporter from Omnidoc / javadoc ((sbt.Defaults.docTaskSettings) Defaults.scala:2123) Omnidoc / scaladoc / tastyFiles from Omnidoc / scaladoc ((sbt.Defaults.docTaskSettings) Defaults.scala:2123) Omnidoc / compile / bspReporter from Omnidoc / scaladoc ((sbt.Defaults.docTaskSettings) Defaults.scala:2123) --- project/OmnidocBuild.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project/OmnidocBuild.scala b/project/OmnidocBuild.scala index ace9f0f..3ea5de4 100644 --- a/project/OmnidocBuild.scala +++ b/project/OmnidocBuild.scala @@ -181,6 +181,8 @@ object OmnidocBuild { foldMappers(sourcePositionMappers.value) ) }, + tastyFiles := (Compile / compile / tastyFiles).value, // not 100% sure but it seems to work + bspReporter := (Compile / compile / bspReporter).value, // same ) private def foldMappers[A](mappers: Seq[A => Option[A]]): A => A = From 3be94561f64ff4d35f9421689568ce6acb11c7c4 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Fri, 30 Sep 2022 11:35:14 +0200 Subject: [PATCH 7/8] Correct version via sbt-dynver --- project/OmnidocBuild.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/project/OmnidocBuild.scala b/project/OmnidocBuild.scala index 3ea5de4..3fa16ce 100644 --- a/project/OmnidocBuild.scala +++ b/project/OmnidocBuild.scala @@ -10,6 +10,7 @@ import sbt.Keys._ import interplay._ import interplay.PlayBuildBase.autoImport._ import xerial.sbt.Sonatype.autoImport.sonatypeProfileName +import sbtdynver.DynVerPlugin.autoImport._ object OmnidocBuild { @@ -116,13 +117,17 @@ object OmnidocBuild { def projectSettings: Seq[Setting[_]] = Seq( name := "play-omnidoc", - version := playVersion, ThisBuild / playBuildRepoName := "omnidoc", crossScalaVersions := Seq(ScalaVersions.scala212, ScalaVersions.scala213), resolvers ++= Resolver.sonatypeOssRepos("snapshots") ++ Resolver.sonatypeOssRepos("releases"), useCoursier := false, // so updatePlaydocClassifiers isn't empty updateSbtClassifiers / useCoursier := true, // https://github.com/sbt/sbt/issues/5263#issuecomment-626462593 + ThisBuild / dynverVTagPrefix := false, // Customise sbt-dynver's behaviour to make it work with tags which aren't v-prefixed + Global / onLoad := (Global / onLoad).value.andThen { s => + dynverAssertTagVersion.value // Sanity-check: assert that version comes from a tag (e.g. not a too-shallow clone) + s // https://github.com/dwijnand/sbt-dynver/#sanity-checking-the-version + }, ) def dependencySettings: Seq[Setting[_]] = Seq( From 05f89d07fee772802e909ecc7246992625ff4923 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Fri, 30 Sep 2022 11:55:43 +0200 Subject: [PATCH 8/8] Add publish workflow (finally!) --- .github/workflows/publish.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..92e6f54 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,15 @@ +name: Publish + +on: + push: + branches: # Snapshots + - main + tags: ["**"] # Releases + release: + types: [published] + +jobs: + publish-artifacts: + name: Publish / Artifacts + uses: playframework/.github/.github/workflows/publish.yml@v3 + secrets: inherit