@@ -29,30 +29,43 @@ def exec(projectDir: Path, binary: String, arguments: String*): Int =
29
29
val exitCode = process.waitFor()
30
30
exitCode
31
31
32
-
33
32
sealed trait CommunityProject :
34
33
private var published = false
35
34
36
35
val project : String
37
36
val testCommand : String
38
37
val publishCommand : String
38
+ val docCommand : String
39
39
val dependencies : List [CommunityProject ]
40
40
val binaryName : String
41
41
val runCommandsArgs : List [String ] = Nil
42
42
43
43
final val projectDir = communitybuildDir.resolve(" community-projects" ).resolve(project)
44
44
45
+ final def publishDependencies (): Unit =
46
+ dependencies.foreach(_.publish())
47
+
45
48
/** Publish this project to the local Maven repository */
46
49
final def publish (): Unit =
47
50
if ! published then
48
- dependencies.foreach(_.publish() )
51
+ publishDependencies( )
49
52
log(s " Publishing $project" )
50
53
if publishCommand eq null then
51
54
throw RuntimeException (s " Publish command is not specified for $project. Project details: \n $this" )
52
55
val exitCode = exec(projectDir, binaryName, (runCommandsArgs :+ publishCommand): _* )
53
56
if exitCode != 0 then
54
57
throw RuntimeException (s " Publish command exited with code $exitCode for project $project. Project details: \n $this" )
55
58
published = true
59
+
60
+ final def doc (): Unit =
61
+ publishDependencies()
62
+ log(s " Documenting $project" )
63
+ if docCommand eq null then
64
+ throw RuntimeException (s " Doc command is not specified for $project. Project details: \n $this" )
65
+ val exitCode = exec(projectDir, binaryName, (runCommandsArgs :+ docCommand): _* )
66
+ if exitCode != 0 then
67
+ throw RuntimeException (s " Doc command exited with code $exitCode for project $project. Project details: \n $this" )
68
+
56
69
end CommunityProject
57
70
58
71
final case class MillCommunityProject (
@@ -62,6 +75,7 @@ final case class MillCommunityProject(
62
75
override val binaryName : String = " ./mill"
63
76
override val testCommand = s " $baseCommand.test "
64
77
override val publishCommand = s " $baseCommand.publishLocal "
78
+ override val docCommand = null
65
79
override val runCommandsArgs = List (" -i" , " -D" , s " dottyVersion= $compilerVersion" )
66
80
67
81
final case class SbtCommunityProject (
@@ -70,7 +84,9 @@ final case class SbtCommunityProject(
70
84
extraSbtArgs : List [String ] = Nil ,
71
85
forceUpgradeSbtScalajsPlugin : Boolean = false ,
72
86
dependencies : List [CommunityProject ] = Nil ,
73
- sbtPublishCommand : String = null ) extends CommunityProject :
87
+ sbtPublishCommand : String = null ,
88
+ sbtDocCommand : String = null
89
+ ) extends CommunityProject :
74
90
override val binaryName : String = " sbt"
75
91
76
92
val dependencyOverrides = List (
@@ -85,7 +101,10 @@ final case class SbtCommunityProject(
85
101
++ s " ++ $compilerVersion!; "
86
102
87
103
override val testCommand = s " $baseCommand$sbtTestCommand"
88
- override val publishCommand = s " $baseCommand$sbtPublishCommand"
104
+ override val publishCommand = if sbtPublishCommand eq null then null else s " $baseCommand$sbtPublishCommand"
105
+ override val docCommand =
106
+ if sbtDocCommand eq null then null else
107
+ s " $baseCommand;set every useScala3doc := true $sbtDocCommand"
89
108
90
109
override val runCommandsArgs : List [String ] =
91
110
// Run the sbt command with the compiler version and sbt plugin set in the build
@@ -102,6 +121,7 @@ final case class SbtCommunityProject(
102
121
) ++ scalaJSPluginArgs
103
122
104
123
object projects :
124
+
105
125
lazy val utest = MillCommunityProject (
106
126
project = " utest" ,
107
127
baseCommand = s " utest.jvm[ $compilerVersion] " ,
@@ -213,6 +233,7 @@ object projects:
213
233
lazy val betterfiles = SbtCommunityProject (
214
234
project = " betterfiles" ,
215
235
sbtTestCommand = " dotty-community-build/compile" ,
236
+ sbtDocCommand = " ;core/doc ;akka/doc ;shapelessScanner/doc"
216
237
)
217
238
218
239
lazy val ScalaPB = SbtCommunityProject (
@@ -310,6 +331,7 @@ object projects:
310
331
lazy val scalaz = SbtCommunityProject (
311
332
project = " scalaz" ,
312
333
sbtTestCommand = " rootJVM/test" ,
334
+ // has doc/sources set to Nil
313
335
dependencies = List (scalacheck)
314
336
)
315
337
@@ -339,5 +361,50 @@ object projects:
339
361
project = " scala-collection-compat" ,
340
362
sbtTestCommand = " compat30/test" ,
341
363
)
364
+
365
+ val projectMap = Map (
366
+ " utest" -> utest,
367
+ " sourcecode" -> sourcecode,
368
+ " oslib" -> oslib,
369
+ " oslibWatch" -> oslibWatch,
370
+ " ujson" -> ujson,
371
+ " upickle" -> upickle,
372
+ " upickleCore" -> upickleCore,
373
+ " geny" -> geny,
374
+ " fansi" -> fansi,
375
+ " pprint" -> pprint,
376
+ " requests" -> requests,
377
+ " scas" -> scas,
378
+ " intent" -> intent,
379
+ " algebra" -> algebra,
380
+ " scalacheck" -> scalacheck,
381
+ " scalatest" -> scalatest,
382
+ " scalatestplusScalacheck" -> scalatestplusScalacheck,
383
+ " scalaXml" -> scalaXml,
384
+ " scopt" -> scopt,
385
+ " scalap" -> scalap,
386
+ " squants" -> squants,
387
+ " betterfiles" -> betterfiles,
388
+ " ScalaPB" -> ScalaPB ,
389
+ " minitest" -> minitest,
390
+ " fastparse" -> fastparse,
391
+ " stdLib213" -> stdLib213,
392
+ " shapeless" -> shapeless,
393
+ " xmlInterpolator" -> xmlInterpolator,
394
+ " effpi" -> effpi,
395
+ " sconfig" -> sconfig,
396
+ " zio" -> zio,
397
+ " munit" -> munit,
398
+ " scodecBits" -> scodecBits,
399
+ " scodec" -> scodec,
400
+ " scalaParserCombinators" -> scalaParserCombinators,
401
+ " dottyCpsAsync" -> dottyCpsAsync,
402
+ " scalaz" -> scalaz,
403
+ " endpoints4s" -> endpoints4s,
404
+ " catsEffect2" -> catsEffect2,
405
+ " catsEffect3" -> catsEffect3,
406
+ " scalaCollectionCompat" -> scalaCollectionCompat
407
+ )
408
+ def apply (key : String ) = projectMap(key)
342
409
343
410
end projects
0 commit comments