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

sbt 1.5.6 (was 1.3.13) #131

Merged
merged 9 commits into from
Jan 2, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ project/project
project/target
target
.idea
.bsp/
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ env:
- TRAVIS_JDK=11

scala:
- 2.12.10
- 2.13.1
- 2.13.7

script: sbt ++$TRAVIS_SCALA_VERSION test publishLocal scalafmtCheckAll scalafmtSbtCheck

Expand Down
17 changes: 5 additions & 12 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import interplay.ScalaVersions
import interplay.ScalaVersions._

// Customise sbt-dynver's behaviour to make it work with tags which aren't v-prefixed
dynverVTagPrefix in ThisBuild := false
(ThisBuild / dynverVTagPrefix) := false

// Sanity-check: assert that version comes from a tag (e.g. not a too-shallow clone)
// https://github.com/dwijnand/sbt-dynver/#sanity-checking-the-version
Global / onLoad := (Global / onLoad).value.andThen { s =>
val v = version.value
if (dynverGitDescribeOutput.value.hasNoTags)
throw new MessageOnlyException(
s"Failed to derive version from git tags. Maybe run `git fetch --unshallow`? Version: $v"
)
dynverAssertTagVersion.value
s
}

Expand All @@ -35,8 +28,8 @@ lazy val `play-doc` = (project in file("."))

libraryDependencies ++= Seq(
"org.pegdown" % "pegdown" % "1.6.0",
"commons-io" % "commons-io" % "2.8.0",
"org.specs2" %% "specs2-core" % "4.10.5" % Test
"commons-io" % "commons-io" % "2.11.0",
"org.specs2" %% "specs2-core" % "4.13.1" % Test
)

javacOptions ++= Seq(
Expand All @@ -61,4 +54,4 @@ scalacOptions ++= Seq(
"-Ywarn-dead-code",
)

playBuildRepoName in ThisBuild := "play-doc"
(ThisBuild / playBuildRepoName) := "play-doc"
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.5.8
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
addSbtPlugin("com.typesafe.play" % "interplay" % "3.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.5.0")
addSbtPlugin("com.typesafe.play" % "interplay" % "3.0.4")
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.5.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
33 changes: 0 additions & 33 deletions src/main/scala/play/doc/PlayDoc.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,39 +42,6 @@ class PlayDoc(
templates: PlayDocTemplates,
pageExtension: Option[String]
) {
@deprecated("Use the primary constructor", "1.3.0")
def this(
markdownRepository: FileRepository,
codeRepository: FileRepository,
resources: String,
playVersion: String,
pageIndex: Option[PageIndex],
nextText: String
) =
this(
markdownRepository,
codeRepository,
resources,
playVersion,
pageIndex,
new TranslatedPlayDocTemplates(nextText),
None
)

@deprecated("Use the primary constructor", "1.3.0")
def this(markdownRepository: FileRepository, codeRepository: FileRepository, resources: String, playVersion: String) =
this(markdownRepository, codeRepository, resources, playVersion, None, PlayDocTemplates, None)

@deprecated("Use the primary constructor", "1.4.0")
def this(
markdownRepository: FileRepository,
codeRepository: FileRepository,
resources: String,
playVersion: String,
pageIndex: Option[PageIndex],
templates: PlayDocTemplates
) =
this(markdownRepository, codeRepository, resources, playVersion, pageIndex, templates, None)

val PlayVersionVariableName = "%PLAY_VERSION%"

Expand Down
12 changes: 10 additions & 2 deletions src/test/scala/play/doc/PlayDocSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ import java.io.File
class PlayDocSpec extends Specification {
def fileFromClasspath(name: String) = new File(Thread.currentThread.getContextClassLoader.getResource(name).toURI)
val repo = new FilesystemRepository(fileFromClasspath("file-placeholder").getParentFile)
val oldRenderer = new PlayDoc(repo, repo, "resources", "2.1.3", None, "Next")
val oldRenderer = new PlayDoc(repo, repo, "resources", "2.1.3", None, new TranslatedPlayDocTemplates("Next"), None)

val renderer =
new PlayDoc(repo, repo, "resources", "2.4.0", PageIndex.parseFrom(repo, "Home", Some("example")), "Next")
new PlayDoc(
repo,
repo,
"resources",
"2.4.0",
PageIndex.parseFrom(repo, "Home", Some("example")),
new TranslatedPlayDocTemplates("Next"),
None
)

"code snippet handling" should {
def test(label: String, rendered: String, file: String = "code/sample.txt") = {
Expand Down