-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow general search and replace in Preprocess (#139)
Allow general search and replace in Preprocess
- Loading branch information
Showing
13 changed files
with
669 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.2.3 | ||
sbt.version=1.2.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
|
||
Version: @VERSION@ | ||
Date: @DATE@ | ||
Author: me |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
scalacOptions in (Compile, doc) ++= Seq( | ||
"-sourcepath", baseDirectory.value.toString, | ||
"-doc-source-url", { | ||
val branch = if (isSnapshot.value) "master" else s"v${version.value}" | ||
s"https://github.com/sbt/sbt-site/tree/${branch}/src/sbt-test/preprocess/transform-scaladoc€{FILE_PATH}.scala#L1" | ||
} | ||
) | ||
|
||
enablePlugins(PreprocessPlugin) | ||
|
||
sourceDirectory in Preprocess := (target in (Compile, doc)).value | ||
siteSubdirName in Preprocess := "api" | ||
makeSite := makeSite.dependsOn(doc in Compile).value | ||
|
||
//#preprocessRules | ||
preprocessRules in Preprocess := Seq( | ||
("\\.java\\.scala".r, _ => ".java") | ||
) | ||
//#preprocessRules | ||
|
||
TaskKey[Unit]("checkContent") := { | ||
val dest = (target in makeSite).value / (siteSubdirName in Preprocess).value | ||
val app = dest / "App.html" | ||
assert(app.exists, s"${app.getAbsolutePath} did not exist") | ||
val content = IO.readLines(app) | ||
assert(!content.exists(_.contains(".java.scala")), s"Found not replaced file suffix in:\n${content.mkString("\n")}") | ||
} |
Oops, something went wrong.