-
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.
Total makeover: split into modules per generator (#203)
- Loading branch information
Showing
221 changed files
with
301 additions
and
324 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ permissions: | |
jobs: | ||
release: | ||
name: Release to Sonatype | ||
if: github.repository == 'sbt/sbt-site' | ||
if: github.event.repository.fork == false | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
|
@@ -35,30 +35,31 @@ jobs: | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
|
||
documentation: | ||
name: Release Documentation | ||
if: github.repository == 'sbt/sbt-site' | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Cache Coursier cache | ||
uses: coursier/[email protected] | ||
|
||
- name: Set up JDK 11 | ||
uses: coursier/[email protected] | ||
with: | ||
jvm: temurin:1.11.0.17 | ||
|
||
- name: sbt ghpages | ||
run: |- | ||
git config --global user.name "sbt-site bot" | ||
git config --global user.email "[email protected]" | ||
sbt ghpagesPushSite | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# https://github.com/sbt/sbt-site/issues/200 | ||
# documentation: | ||
# name: Release Documentation | ||
# if: github.event.repository.fork == false | ||
# runs-on: ubuntu-22.04 | ||
# permissions: | ||
# contents: write | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/[email protected] | ||
# with: | ||
# fetch-depth: 0 | ||
# | ||
# - name: Cache Coursier cache | ||
# uses: coursier/[email protected] | ||
# | ||
# - name: Set up JDK 11 | ||
# uses: coursier/[email protected] | ||
# with: | ||
# jvm: temurin:1.11.0.17 | ||
# | ||
# - name: sbt ghpages | ||
# run: |- | ||
# git config --global user.name "sbt-site bot" | ||
# git config --global user.email "[email protected]" | ||
# sbt ghpagesPushSite | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
asciidoctor/src/sbt-test/asciidoctor/asciidoctor-skips-frontmatter/project/plugins.sbt
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 @@ | ||
addSbtPlugin("com.github.sbt" % "sbt-site-asciidoctor" % sys.props("project.version")) |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...asciidoctor/can-use-asciidoctor/build.sbt → ...asciidoctor/can-use-asciidoctor/build.sbt
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
1 change: 1 addition & 0 deletions
1
asciidoctor/src/sbt-test/asciidoctor/can-use-asciidoctor/project/plugins.sbt
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 @@ | ||
addSbtPlugin("com.github.sbt" % "sbt-site-asciidoctor" % sys.props("project.version")) |
File renamed without changes.
File renamed without changes.
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,110 +1,148 @@ | ||
sbtPlugin := true | ||
enablePlugins(SbtPlugin) | ||
|
||
name := "sbt-site" | ||
|
||
organization := "com.github.sbt" | ||
organizationName := "sbt" | ||
organizationHomepage := Some(url("https://www.scala-sbt.org/")) | ||
|
||
homepage := Some(url("https://www.scala-sbt.org/sbt-site/")) | ||
|
||
crossSbtVersions := List("1.4.9") | ||
|
||
licenses += ("BSD 3-Clause", url("https://opensource.org/licenses/BSD-3-Clause")) | ||
//#scm-info | ||
scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt-site"), "scm:git:[email protected]:sbt/sbt-site.git")) | ||
//#scm-info | ||
|
||
developers += Developer( | ||
"contributors", | ||
"Contributors", | ||
"https://gitter.im/sbt/sbt-site", | ||
url("https://github.com/sbt/sbt-site/graphs/contributors") | ||
inThisBuild(Seq( | ||
organization := "com.github.sbt", | ||
organizationName := "sbt", | ||
organizationHomepage := Some(url("https://www.scala-sbt.org/")), | ||
|
||
homepage := Some(url("https://www.scala-sbt.org/sbt-site/")), | ||
licenses += ("BSD 3-Clause", url("https://opensource.org/licenses/BSD-3-Clause")), | ||
//#scm-info | ||
scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt-site"), "scm:git:[email protected]:sbt/sbt-site.git")), | ||
//#scm-info | ||
developers += Developer( | ||
"contributors", | ||
"Contributors", | ||
"https://gitter.im/sbt/sbt-site", | ||
url("https://github.com/sbt/sbt-site/graphs/contributors") | ||
), | ||
resolvers ++= Resolver.sonatypeOssRepos("releases") | ||
)) | ||
|
||
val pluginSettings = Seq( | ||
sbtPlugin := true, | ||
crossSbtVersions := List("1.4.9"), | ||
scriptedLaunchOpts += "-Dproject.version=" + version.value | ||
// scriptedBufferLog := false | ||
) | ||
|
||
scalacOptions ++= Seq( | ||
"-deprecation", | ||
"-unchecked", | ||
"-encoding", | ||
"UTF-8", | ||
"-release", | ||
"11") | ||
resolvers ++= Resolver.sonatypeOssRepos("releases") | ||
val commonSettings = Seq( | ||
scalacOptions ++= Seq( | ||
"-deprecation", | ||
"-unchecked", | ||
"-encoding", | ||
"UTF-8", | ||
"-release", | ||
"11" | ||
) | ||
) | ||
|
||
val unfilteredVersion = "0.10.4" | ||
|
||
libraryDependencies ++= Seq( | ||
"ws.unfiltered" %% "unfiltered-directives" % unfilteredVersion, | ||
"ws.unfiltered" %% "unfiltered-filter" % unfilteredVersion, | ||
"ws.unfiltered" %% "unfiltered-jetty" % unfilteredVersion, | ||
"ws.unfiltered" %% "unfiltered-specs2" % unfilteredVersion % Test, | ||
"org.foundweekends" %% "pamflet-library" % "0.10.0", | ||
).map( | ||
// Force sbt-site to Scala XML 2.1 | ||
_.exclude("org.scala-lang.modules", "scala-xml_2.12") | ||
) ++ Seq( | ||
"org.scala-lang.modules" %% "scala-xml" % "2.1.0", | ||
"org.yaml" % "snakeyaml" % "1.33", | ||
"com.typesafe" % "config" % "1.4.2", | ||
"org.asciidoctor" % "asciidoctorj" % "2.1.0", | ||
"org.asciidoctor" % "asciidoctorj-diagram" % "1.5.18" | ||
) | ||
|
||
addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.10.3") | ||
lazy val root = project | ||
.in(file(".")) | ||
.settings( | ||
publish / skip := true, | ||
Compile / publishArtifact := false | ||
) | ||
.settings( | ||
name := "sbt-site-root", | ||
publishTo := Some(Resolver.file("Unused transient repository", file("target/unusedrepo"))), | ||
Compile / paradoxMaterialTheme ~= { | ||
_.withFavicon("img/favicon.png") | ||
.withLogo("img/sbt-logo.svg") | ||
.withRepository(uri("https://github.com/sbt/sbt-site")) | ||
} | ||
) | ||
.aggregate(core, asciidoctor, gitbook, paradox) | ||
.enablePlugins(SitePreviewPlugin, ParadoxSitePlugin, ParadoxMaterialThemePlugin) | ||
|
||
lazy val core = project | ||
.in(file("core")) | ||
.enablePlugins(SbtPlugin) | ||
.settings(pluginSettings) | ||
.settings(commonSettings) | ||
.settings( | ||
name := "sbt-site", | ||
libraryDependencies ++= Seq( | ||
"ws.unfiltered" %% "unfiltered-directives" % unfilteredVersion, | ||
"ws.unfiltered" %% "unfiltered-filter" % unfilteredVersion, | ||
"ws.unfiltered" %% "unfiltered-jetty" % unfilteredVersion, | ||
"ws.unfiltered" %% "unfiltered-specs2" % unfilteredVersion % Test, | ||
).map( | ||
// Force sbt-site to Scala XML 2.1 | ||
_.exclude("org.scala-lang.modules", "scala-xml_2.12") | ||
) ++ Seq( | ||
"org.scala-lang.modules" %% "scala-xml" % "2.1.0" | ||
) | ||
) | ||
|
||
libraryDependencies += | ||
Defaults.sbtPluginExtra( | ||
"org.planet42" % "laika-sbt" % "0.8.0", | ||
(pluginCrossBuild / sbtBinaryVersion).value, | ||
(pluginCrossBuild / scalaBinaryVersion).value | ||
lazy val asciidoctor = project | ||
.in(file("asciidoctor")) | ||
.settings( | ||
name := "sbt-site-asciidoctor", | ||
libraryDependencies ++= Seq( | ||
"org.asciidoctor" % "asciidoctorj" % "2.1.0", | ||
"org.asciidoctor" % "asciidoctorj-diagram" % "1.5.18" | ||
) | ||
) | ||
.dependsOn(core) | ||
.enablePlugins(SbtPlugin) | ||
.settings(pluginSettings) | ||
.settings(commonSettings) | ||
|
||
lazy val gitbook = project | ||
.in(file("gitbook")) | ||
.settings( | ||
name := "sbt-site-gitbook", | ||
libraryDependencies ++= Seq( | ||
"com.typesafe" % "config" % "1.4.2" | ||
) | ||
) | ||
.dependsOn(core) | ||
.enablePlugins(SbtPlugin) | ||
.settings(pluginSettings) | ||
.settings(commonSettings) | ||
|
||
// https://github.com/sbt/sbt-site/issues/182 | ||
// lazy val hugo = project... | ||
|
||
// https://github.com/sbt/sbt-site/issues/183 | ||
// lazy val jekyll = project... | ||
|
||
// https://github.com/sbt/sbt-site/issues/204 | ||
// lazy val laika = project... | ||
//libraryDependencies += | ||
// Defaults.sbtPluginExtra( | ||
// "org.planet42" % "laika-sbt" % "0.8.0", | ||
// (pluginCrossBuild / sbtBinaryVersion).value, | ||
// (pluginCrossBuild / scalaBinaryVersion).value | ||
// ) | ||
|
||
// https://github.com/sbt/sbt-site/issues/205 | ||
// lazy val nanoc = project... | ||
|
||
// https://github.com/sbt/sbt-site/issues/206 | ||
// lazy val pamflet = project... | ||
//val pamfletDependencies = Seq( | ||
// "org.foundweekends" %% "pamflet-library" % "0.10.0", | ||
// "org.scala-lang.modules" %% "scala-xml" % "2.1.0", | ||
// "org.yaml" % "snakeyaml" % "1.33", | ||
//) | ||
|
||
lazy val paradox = project | ||
.in(file("paradox")) | ||
.settings( | ||
name := "sbt-site-paradox", | ||
addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.10.3") | ||
) | ||
.dependsOn(core) | ||
.enablePlugins(SbtPlugin) | ||
.settings(pluginSettings) | ||
.settings(commonSettings) | ||
|
||
enablePlugins(ParadoxSitePlugin, ParadoxMaterialThemePlugin) | ||
Compile / paradoxMaterialTheme ~= { | ||
_.withFavicon("img/favicon.png") | ||
.withLogo("img/sbt-logo.svg") | ||
.withRepository(uri("https://github.com/sbt/sbt-site")) | ||
} | ||
// https://github.com/sbt/sbt-site/issues/186 | ||
//lazy val sphinx = project... | ||
|
||
//#ghpages-publish | ||
enablePlugins(GhpagesPlugin) | ||
git.remoteRepo := scmInfo.value.get.connection.replace("scm:git:", "") | ||
//#ghpages-publish | ||
|
||
TaskKey[Unit]("runScriptedTest") := Def.taskDyn { | ||
val sbtBinVersion = (pluginCrossBuild / sbtBinaryVersion).value | ||
val base = sbtTestDirectory.value | ||
|
||
def isCompatible(directory: File): Boolean = { | ||
val buildProps = new java.util.Properties() | ||
IO.load(buildProps, directory / "project" / "build.properties") | ||
Option(buildProps.getProperty("sbt.version")) | ||
.map { version => | ||
val requiredBinVersion = CrossVersion.binarySbtVersion(version) | ||
val compatible = requiredBinVersion == sbtBinVersion | ||
if (!compatible) { | ||
val testName = directory.relativeTo(base).getOrElse(directory) | ||
streams.value.log.warn(s"Skipping $testName since it requires sbt $requiredBinVersion") | ||
} | ||
compatible | ||
} | ||
.getOrElse(true) | ||
} | ||
|
||
val testDirectoryFinder = base * AllPassFilter * AllPassFilter filter { _.isDirectory } | ||
val tests = for { | ||
test <- testDirectoryFinder.get | ||
if isCompatible(test) | ||
path <- Path.relativeTo(base)(test) | ||
} yield path.replace('\\', '/') | ||
|
||
if (tests.nonEmpty) | ||
Def.task(scripted.toTask(tests.mkString(" ", " ", "")).value) | ||
else | ||
Def.task(streams.value.log.warn("No tests can be run for this sbt version")) | ||
}.value | ||
|
||
scriptedLaunchOpts += "-Dproject.version="+version.value | ||
|
||
// scriptedBufferLog := false |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
core/src/sbt-test/site/can-run-generator-twice/project/plugins.sbt
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 @@ | ||
addSbtPlugin("com.github.sbt" % "sbt-site-paradox" % sys.props("project.version")) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ | ||
addSbtPlugin("com.github.sbt" % "sbt-site-paradox" % sys.props("project.version")) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
core/src/sbt-test/site/plays-nice-with-ghpages/project/plugins.sbt
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,9 @@ | ||
addSbtPlugin("com.github.sbt" % "sbt-site" % sys.props("project.version")) | ||
|
||
resolvers += "jgit-repo" at "https://download.eclipse.org/jgit/maven" | ||
|
||
addSbtPlugin( | ||
("com.github.sbt" % "sbt-ghpages" % "0.7.0") | ||
// sbt-ghpages depends on sbt-site 1.4.1, which pulls Scala XML 1.x | ||
.exclude("org.scala-lang.modules", "scala-xml_2.12") | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
gitbook/src/sbt-test/gitbook/can-manage-installation/project/plugins.sbt
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 @@ | ||
addSbtPlugin("com.github.sbt" % "sbt-site-gitbook" % sys.props("project.version")) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
gitbook/src/sbt-test/gitbook/can-use-gitbook/project/plugins.sbt
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 @@ | ||
addSbtPlugin("com.github.sbt" % "sbt-site-gitbook" % sys.props("project.version")) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...t-test/gitbook/ignore-dot-files/build.sbt → ...t-test/gitbook/ignore-dot-files/build.sbt
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
1 change: 1 addition & 0 deletions
1
gitbook/src/sbt-test/gitbook/ignore-dot-files/project/plugins.sbt
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 @@ | ||
addSbtPlugin("com.github.sbt" % "sbt-site-gitbook" % sys.props("project.version")) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Oops, something went wrong.