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

Drop Java 8 #207

Merged
merged 8 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ 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
scala: 2.13.8, 2.12.16
java: 17, 11
scala: 2.13.9, 2.12.17
cmd: sbt ++$MATRIX_SCALA publishLocal # Check that we can actually build and package the library

finish:
name: Finish
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
15 changes: 15 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
target
.idea/
.bsp/
41 changes: 14 additions & 27 deletions project/OmnidocBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import sbt.Keys._
import interplay._
import interplay.PlayBuildBase.autoImport._
import xerial.sbt.Sonatype.autoImport.sonatypeProfileName
import sbtrelease.ReleasePlugin.autoImport._
import sbtdynver.DynVerPlugin.autoImport._

object OmnidocBuild {

Expand Down Expand Up @@ -99,14 +99,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 ++
Expand All @@ -118,13 +117,17 @@ object OmnidocBuild {

def projectSettings: Seq[Setting[_]] = Seq(
name := "play-omnidoc",
version := playVersion,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching to sbt-ci-release/sbt-dynver

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
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(
Expand All @@ -138,24 +141,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
Expand Down Expand Up @@ -195,12 +180,14 @@ object OmnidocBuild {

def compilerReporterSettings = Seq(
compile / compilerReporter := {
new sbt.internal.server.LanguageServerReporter(
new sbt.internal.inc.LoggedReporter(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the below tastyFiles / bspReporter hack allows us to finally upgrade to latest sbt version

maxErrors.value,
streams.value.log,
foldMappers(sourcePositionMappers.value)
)
},
tastyFiles := (Compile / compile / tastyFiles).value, // not 100% sure but it seems to work
bspReporter := (Compile / compile / bspReporter).value, // same
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to fix (because of sbt upgrade)

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)

Actually these two settings does not really matter in this context IMHO, bsp is for build server protocol and tastyFiles for Scala 3, but even if we use Scala 3 here, it should not really matter as well. I keep the comment here in case someone stumples over it and thinks this should be changed.

)

private def foldMappers[A](mappers: Seq[A => Option[A]]): A => A =
Expand Down Expand Up @@ -321,7 +308,7 @@ object OmnidocBuild {
"-encoding",
"UTF-8",
"-source",
"8",
"11",

)
}
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.3.13
sbt.version=1.7.1
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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"))