From fdc7d42d390b3cc82bcb6f0f5eb7ca3e6da4a9f6 Mon Sep 17 00:00:00 2001 From: adamw Date: Wed, 8 Jan 2025 14:15:28 +0100 Subject: [PATCH] Scope docs generation --- build.sbt | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/build.sbt b/build.sbt index 939a8f143..9a118131e 100644 --- a/build.sbt +++ b/build.sbt @@ -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, @@ -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", @@ -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: _*)