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

[DO-NOT-MERGE] Latest paradox deps test #67

Closed
wants to merge 1 commit into from
Closed
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
45 changes: 45 additions & 0 deletions plugin/src/sbt-test/paradox/latest-paradox-deps/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name := "test"

//#enable-plugin
enablePlugins(ParadoxMaterialThemePlugin)
//#enable-plugin

Compile / paradoxProperties ++= Map(
"github.base_url" -> "https://github.com/sbt/sbt-paradox-material-theme"
)

Compile / paradoxMaterialTheme ~= {
_.withCopyright("test-copyright")
.withLogo("test-logo")
.withFavicon("test-favicon")
}

def fileContains(file: File, texts: String*) = {
assert(file.exists, s"${file.getAbsolutePath} did not exist")
val content = IO.readLines(file)
for (text <- texts)
assert(
content.exists(_.contains(text)),
s"Did not find '$text' in ${file.getName}:\n${content.mkString("\n")}"
)
}

TaskKey[Unit]("checkContent") := {
val dest = (Compile / paradox / target).value

fileContains(
dest / "index.html",
"Paradox Site",
"Nicely themed",
"mkdocs-material",
"test-copyright",
"test-logo",
"test-favicon"
)

fileContains(
dest / "search" / "search_index.json",
"Paradox Site",
"Nicely themed"
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.10.6")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the important part, as you can see we are loading the most recent version of sbt-paradox/sbt-paradox-theme

addSbtPlugin("com.lightbend.paradox" % "sbt-paradox-theme" % "0.10.6")

sys.props.get("project.version") match {
case Some(x) => addSbtPlugin("com.github.sbt" % "sbt-paradox-material-theme" % x)
case _ => sys.error("""|The system property 'project.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Paradox Site

Nicely themed.
2 changes: 2 additions & 0 deletions plugin/src/sbt-test/paradox/latest-paradox-deps/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> paradox
> checkContent
Loading