This repository has been archived by the owner on Apr 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docs and commit files in release process (#174)
* Integrates the update docs task in the after ci process * Removes the commit files task and improve the update files task * Fixes scripted tests
- Loading branch information
Fede Fernández
authored
Apr 18, 2017
1 parent
56d68b6
commit ecbcd6d
Showing
14 changed files
with
95 additions
and
76 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
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
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 |
---|---|---|
@@ -1,38 +1,40 @@ | ||
scalaVersion := "2.12.1" | ||
|
||
version := "2.0.0" | ||
|
||
orgUpdateDocFilesCommitSetting := false | ||
|
||
val docsFiles = List(new File("docs/README.md"), new File("docs/src/main/resources/index.md")) | ||
val otherDocsFiles = List(new File("other-docs/README.md"), new File("other-docs/src/main/resources/index.md")) | ||
val nonDocsFiles = List(new File("non-docs/README.md")) | ||
|
||
def checkFiles(list: List[File]): Boolean = { | ||
def checkFiles(version: String, list: List[File]): Boolean = { | ||
list.foldLeft(true) { | ||
case (b, f) => | ||
val content = IO.readLines(f).mkString("\n") | ||
b && content.contains("2.0") && !content.contains("1.2.1") | ||
b && content.contains(version) && !content.contains("1.2.1") | ||
} && nonDocsFiles.foldLeft(true) { | ||
case (b, f) => | ||
val content = IO.readLines(f).mkString("\n") | ||
b && !content.contains("2.0") && content.contains("1.2.1") | ||
b && !content.contains(version) && content.contains("1.2.1") | ||
} | ||
} | ||
|
||
lazy val testCheckSettings = TaskKey[Unit]("testCheckSettings") | ||
lazy val testCheckSettings2 = TaskKey[Unit]("testCheckSettings2") | ||
|
||
testCheckSettings := Def.task { | ||
if (checkFiles(docsFiles)) { | ||
if (checkFiles(version.value, docsFiles)) { | ||
streams.value.log.info("Test succeeded.") | ||
} else { | ||
sys.error("Error validating docs files") | ||
} | ||
}.value | ||
|
||
testCheckSettings2 := Def.task { | ||
if (checkFiles(otherDocsFiles)) { | ||
if (checkFiles(version.value, otherDocsFiles)) { | ||
streams.value.log.info("Test succeeded.") | ||
} else { | ||
sys.error("Error validating other docs files") | ||
} | ||
}.value | ||
|
||
orgUpdateDocFilesReplacementsSetting := Map("1.2.1" -> "2.0") | ||
}.value |
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
2 changes: 1 addition & 1 deletion
2
src/sbt-test/sbtorgpolicies/update-doc-files/docs/src/main/resources/index.md
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
4 changes: 2 additions & 2 deletions
4
src/sbt-test/sbtorgpolicies/update-doc-files/non-docs/README.md
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
4 changes: 2 additions & 2 deletions
4
src/sbt-test/sbtorgpolicies/update-doc-files/other-docs/README.md
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
2 changes: 1 addition & 1 deletion
2
...sbt-test/sbtorgpolicies/update-doc-files/other-docs/src/main/resources/index.md
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