Skip to content

Commit

Permalink
Merge pull request #20 from lightbend/wip/npe
Browse files Browse the repository at this point in the history
Fixes around NPE
  • Loading branch information
eed3si9n authored Sep 6, 2016
2 parents 090a1e9 + 57fc6ca commit 04d6c49
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 11 deletions.
11 changes: 8 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ lazy val core = project
Library.st4,
Library.scalatest % "test",
Library.jtidy % "test"
)
),
parallelExecution in Test := false
)

lazy val plugin = project
Expand All @@ -57,9 +58,13 @@ lazy val plugin = project
addSbtPlugin(Library.sbtWeb),
scriptedSettings,
scriptedLaunchOpts += ("-Dproject.version=" + version.value),
scriptedLaunchOpts ++= sys.process.javaVmArguments.filter(
a => Seq("-Xmx", "-Xms", "-XX").exists(a.startsWith)
),
scriptedDependencies := {
(publishLocal in core).value
publishLocal.value
val p1 = (publishLocal in core).value
val p2 = publishLocal.value
val p3 = (publishLocal in genericTheme).value
},
test in Test := {
(test in Test).value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ class PageTemplate(directory: File, startDelimiter: Char = '$', stopDelimiter: C
* Write a templated page to the target file.
*/
def write(contents: PageTemplate.Contents, target: File, errorListener: STErrorListener): File = {
val template = templates.getInstanceOf(name).add("page", contents)
val template = Option(templates.getInstanceOf(name)) match {
case Some(t) => t.add("page", contents)
case None => sys.error(s"StringTemplate '$name' was not found for '$target'. Create a template or set a theme that contains one.")
}
template.write(target, errorListener)
target
}
Expand Down
11 changes: 11 additions & 0 deletions notes/0.2.0.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Initial public release of Paradox.

Features include:

- Static site generation
- GFM powered by Pegdown
- StringTemplate using ST4
- @ref link
- @@index container
- @@toc block
- @@snip block
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object ParadoxPlugin extends AutoPlugin {
paradoxTargetSuffix := ".html",
paradoxNavigationDepth := 2,
paradoxProperties := Map.empty,
paradoxTheme := None,
paradoxTheme := Some(builtinParadoxTheme("generic")),
paradoxLeadingBreadcrumbs := Nil,
libraryDependencies ++= paradoxTheme.value.toSeq
)
Expand Down
5 changes: 5 additions & 0 deletions plugin/src/sbt-test/paradox/error/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
lazy val docs = (project in file(".")).
enablePlugins(ParadoxPlugin).
settings(
paradoxTheme := None
)
1 change: 1 addition & 0 deletions plugin/src/sbt-test/paradox/error/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % sys.props("project.version"))
1 change: 1 addition & 0 deletions plugin/src/sbt-test/paradox/error/src/main/paradox/a.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# A
1 change: 1 addition & 0 deletions plugin/src/sbt-test/paradox/error/test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-> paradox
3 changes: 2 additions & 1 deletion plugin/src/sbt-test/paradox/site/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ lazy val docs = project
.enablePlugins(ParadoxPlugin)
.settings(
name := "Paradox Test",
paradoxLeadingBreadcrumbs := List("Alphabet" -> "https://abc.xyz/", "Google" -> "https://www.google.com")
paradoxLeadingBreadcrumbs := List("Alphabet" -> "https://abc.xyz/", "Google" -> "https://www.google.com"),
paradoxTheme := None
)
1 change: 0 additions & 1 deletion plugin/src/sbt-test/paradox/site/project/build.properties

This file was deleted.

8 changes: 5 additions & 3 deletions plugin/src/sbt-test/paradox/snippets/build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
lazy val docs = project
.in(file("."))
.enablePlugins(ParadoxPlugin)
lazy val docs = (project in file(".")).
enablePlugins(ParadoxPlugin).
settings(
paradoxTheme := None
)

This file was deleted.

0 comments on commit 04d6c49

Please sign in to comment.