Skip to content

Commit

Permalink
Scope docs generation
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw committed Jan 8, 2025
1 parent 7d83b17 commit fdc7d42
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,8 @@ val compileScoped =
val testScoped =
inputKey[Unit](s"Run tests in the given scope. Usage: testScoped [scala version] [platform]. $scopesDescription")

val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
val commonSettings = commonSmlBuildSettings ++ Seq(
organization := "com.softwaremill.sttp.client4",
updateDocs := Def.taskDyn {
val files1 = UpdateVersionInDocs(sLog.value, organization.value, version.value, List(file("README.md")))
Def.task {
(docs.jvm(scala3) / mdoc).toTask("").value
// Generating the list only after mdoc is done (as it overrides what's in generated_doc)
// For the root project the sourceDirectory points to src, so ../ will point to the root directory of the project
GenerateListOfExamples(sLog.value, sourceDirectory.value.getParentFile)
files1 ++ Seq(file("generated-docs/out"))
}
}.value,
ideSkipProject := (scalaVersion.value != ideScalaVersion)
|| thisProjectRef.value.project.contains("JS") || thisProjectRef.value.project.contains("Native"),
bspEnabled := !ideSkipProject.value,
Expand Down Expand Up @@ -274,7 +264,8 @@ def filterByVersionAndPlatform(scalaVersionFilter: String, platformFilter: Strin
}

lazy val rootProject = (project in file("."))
.settings(commonSettings: _*)
.settings(commonSettings)
.settings(ossPublishSettings)
.settings(
publish / skip := true,
name := "sttp",
Expand All @@ -287,7 +278,17 @@ lazy val rootProject = (project in file("."))
Def.taskDyn((Test / test).all(filterByVersionAndPlatform(args.head, args(1))))
}.evaluated,
ideSkipProject := false,
scalaVersion := scala2_13
scalaVersion := scala2_13,
updateDocs := Def.taskDyn {
val files1 = UpdateVersionInDocs(sLog.value, organization.value, version.value, List(file("README.md")))
Def.task {
(docs.jvm(scala3) / mdoc).toTask("").value
// Generating the list only after mdoc is done (as it overrides what's in generated_doc)
// For the root project the sourceDirectory points to src, so ../ will point to the root directory of the project
GenerateListOfExamples(sLog.value, sourceDirectory.value.getParentFile)
files1 ++ Seq(file("generated-docs/out"))
}
}.value
)
.aggregate(allAggregates: _*)

Expand Down

0 comments on commit fdc7d42

Please sign in to comment.