Skip to content

Commit

Permalink
Merge pull request #207 from mkurz/dropJava8
Browse files Browse the repository at this point in the history
Drop Java 8
  • Loading branch information
mkurz authored Sep 30, 2022
2 parents c2532a9 + 05f89d0 commit 92f9d04
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 33 deletions.
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,
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(
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
)

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"))

0 comments on commit 92f9d04

Please sign in to comment.