@@ -141,6 +141,16 @@ final case class SbtCommunityProject(
141141
142142object projects :
143143
144+ private def forceDoc (projects : String * ) =
145+ projects.map(project =>
146+ s """ ;set $project/Compile/doc/sources ++= file("a.scala") +: ( $project/Compile/doc/tastyFiles).value ; $project/doc """
147+ ).mkString(" " )
148+
149+ private def aggregateDoc (in : String )(projects : String * ) =
150+ val tastyFiles =
151+ (in +: projects).map(p => s " ( $p/Compile/doc/tastyFiles).value " ).mkString(" ++ " )
152+ s """ ;set $in/Compile/doc/sources ++= file("a.scala") +: ( $tastyFiles) ; $in/doc """
153+
144154 lazy val utest = MillCommunityProject (
145155 project = " utest" ,
146156 baseCommand = s " utest.jvm[ $compilerVersion] " ,
@@ -219,14 +229,14 @@ object projects:
219229 lazy val algebra = SbtCommunityProject (
220230 project = " algebra" ,
221231 sbtTestCommand = " coreJVM/compile" ,
222- sbtDocCommand = " coreJVM/doc "
232+ sbtDocCommand = forceDoc( " coreJVM" )
223233 )
224234
225235 lazy val scalacheck = SbtCommunityProject (
226236 project = " scalacheck" ,
227237 sbtTestCommand = " jvm/test;js/test" ,
228238 sbtPublishCommand = " jvm/publishLocal;js/publishLocal" ,
229- sbtDocCommand = " jvm/doc "
239+ sbtDocCommand = forceDoc( " jvm" )
230240 )
231241
232242 lazy val scalatest = SbtCommunityProject (
@@ -269,13 +279,17 @@ object projects:
269279 lazy val ScalaPB = SbtCommunityProject (
270280 project = " ScalaPB" ,
271281 sbtTestCommand = " dotty-community-build/compile" ,
272- sbtDocCommand = " dotty-community-build/doc"
282+ // aggregateDoc("runtimeJVM")("scalapbc", "grpcRuntime", "compilerPlugin") fails with
283+ // module class ScalaPbCodeGenerator$ has non-class parent: TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),module protocbridge),ProtocCodeGenerator)
284+ // Also it seems that we do not handle correctly aggreagation projects
285+ // sbtDocCommand = "dotty-community-build/doc"
286+ sbtDocCommand = forceDoc(" scalapbc" , " grpcRuntime" ," runtimeJVM" , " compilerPlugin" )
273287 )
274288
275289 lazy val minitest = SbtCommunityProject (
276290 project = " minitest" ,
277291 sbtTestCommand = " test" ,
278- sbtDocCommand = " dotty-community-build/doc " ,
292+ sbtDocCommand = aggregateDoc( " lawsJVM " )( " minitestJVM " ) ,
279293 dependencies = List (scalacheck)
280294 )
281295
@@ -298,7 +312,7 @@ object projects:
298312 lazy val shapeless = SbtCommunityProject (
299313 project = " shapeless" ,
300314 sbtTestCommand = " test" ,
301- sbtDocCommand = " doc "
315+ sbtDocCommand = forceDoc( " typeable " , " deriving " , " data " )
302316 )
303317
304318 lazy val xmlInterpolator = SbtCommunityProject (
@@ -332,13 +346,15 @@ object projects:
332346 lazy val sconfig = SbtCommunityProject (
333347 project = " sconfig" ,
334348 sbtTestCommand = " sconfigJVM/test" ,
335- sbtDocCommand = " sconfigJVM/doc" ,
349+ // sbtDocCommand = "sconfigJVM/doc", // Fails with:
350+ // Problem parsing sconfig/sharedScala3/src/main/scala/org/ekrich/config/ConfigSyntax.scala:[73..92..1340], documentation may not be generated.
351+ // scala.MatchError: ValDef(JSON,TypeTree[TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class ekrich)),module config),class ConfigSyntax)],Apply(Ident($new),List(Literal(Constant(0)), Literal(Constant(JSON))))) (of class dotty.tools.dotc.ast.Trees$ValDef)
336352 )
337353
338354 lazy val zio = SbtCommunityProject (
339355 project = " zio" ,
340356 sbtTestCommand = " testJVMDotty" ,
341- // sbtDocCommand = "coreJVM/doc" ,
357+ // sbtDocCommand = forceDoc( "coreJVM") ,
342358 // Fails on tasty unpickling https://github.com/lampepfl/dotty/issues/10499
343359 )
344360
@@ -368,19 +384,33 @@ object projects:
368384 lazy val scalaParserCombinators = SbtCommunityProject (
369385 project = " scala-parser-combinators" ,
370386 sbtTestCommand = " parserCombinatorsJVM/test" ,
371- sbtDocCommand = " parserCombinatorsJVM/doc " ,
387+ sbtDocCommand = forceDoc( " parserCombinatorsJVM" ) ,
372388 )
373389
374390 lazy val dottyCpsAsync = SbtCommunityProject (
375391 project = " dotty-cps-async" ,
376392 sbtTestCommand = " test" ,
377- sbtDocCommand = " doc" ,
393+ // Does not compile (before reaches doc)
394+ // sbtDocCommand = "cpsJVM/doc",
378395 )
379396
380397 lazy val scalaz = SbtCommunityProject (
381398 project = " scalaz" ,
382399 sbtTestCommand = " rootJVM/test" ,
383- sbtDocCommand = " rootJVM/doc" ,
400+
401+ // sbtDocCommand = forceDoc("coreJVM"), // Fails with:
402+ // [error] class scalaz.Conts cannot be unpickled because no class file was found
403+ // [error] class scalaz.ContsT cannot be unpickled because no class file was found
404+ // [error] class scalaz.IndexedCont cannot be unpickled because no class file was found
405+
406+ // aggregateDoc("rootJVM")("effectJVM", "iterateeJVM"), // Fails With
407+ // [error] Caused by: java.lang.AssertionError: assertion failed:
408+ // trait MonadIO has non-class parent: AppliedType(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),module scalaz),Monad),List(TypeRef(ThisType(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class scalaz)),module effect),trait MonadIO)),type F)))
409+
410+ // sbtDocCommand = forceDoc("iterateeJVM"), // Fails with
411+ // [error] class scalaz.iteratee.Iteratee cannot be unpickled because no class file was found
412+
413+ sbtDocCommand = forceDoc(" effectJVM" ),
384414 dependencies = List (scalacheck)
385415 )
386416
@@ -393,7 +423,8 @@ object projects:
393423 lazy val catsEffect2 = SbtCommunityProject (
394424 project = " cats-effect-2" ,
395425 sbtTestCommand = " test" ,
396- sbtDocCommand = " ;coreJVM/doc ;lawsJVM/doc" ,
426+ // Currently is excluded from community build
427+ // sbtDocCommand = ";coreJVM/doc ;lawsJVM/doc",
397428 )
398429
399430 lazy val catsEffect3 = SbtCommunityProject (
@@ -406,8 +437,8 @@ object projects:
406437 lazy val scalaParallelCollections = SbtCommunityProject (
407438 project = " scala-parallel-collections" ,
408439 sbtTestCommand = " test" ,
409- sbtDocCommand = " doc " ,
410- dependencies = List (scalacheck)
440+ sbtDocCommand = forceDoc( " core " ) ,
441+ dependencies = List (scalacheck)
411442 )
412443
413444 lazy val scalaCollectionCompat = SbtCommunityProject (
0 commit comments