@@ -45,23 +45,37 @@ sealed trait CommunityProject:
45
45
val project : String
46
46
val testCommand : String
47
47
val publishCommand : String
48
+ val docCommand : String
48
49
val dependencies : List [CommunityProject ]
49
50
val binaryName : String
50
51
val runCommandsArgs : List [String ] = Nil
51
52
52
53
final val projectDir = communitybuildDir.resolve(" community-projects" ).resolve(project)
53
54
55
+ final def publishDependencies (): Unit =
56
+ dependencies.foreach(_.publish())
57
+
54
58
/** Publish this project to the local Maven repository */
55
59
final def publish (): Unit =
56
60
if ! published then
57
- dependencies.foreach(_.publish() )
61
+ publishDependencies( )
58
62
log(s " Publishing $project" )
59
63
if publishCommand eq null then
60
64
throw RuntimeException (s " Publish command is not specified for $project. Project details: \n $this" )
61
65
val exitCode = exec(projectDir, binaryName, (runCommandsArgs :+ publishCommand): _* )
62
66
if exitCode != 0 then
63
67
throw RuntimeException (s " Publish command exited with code $exitCode for project $project. Project details: \n $this" )
64
68
published = true
69
+
70
+ final def doc (): Unit =
71
+ publishDependencies()
72
+ log(s " Documenting $project" )
73
+ if docCommand eq null then
74
+ throw RuntimeException (s " Doc command is not specified for $project. Project details: \n $this" )
75
+ val exitCode = exec(projectDir, binaryName, (runCommandsArgs :+ docCommand): _* )
76
+ if exitCode != 0 then
77
+ throw RuntimeException (s " Doc command exited with code $exitCode for project $project. Project details: \n $this" )
78
+
65
79
end CommunityProject
66
80
67
81
final case class MillCommunityProject (
@@ -71,14 +85,17 @@ final case class MillCommunityProject(
71
85
override val binaryName : String = " ./mill"
72
86
override val testCommand = s " $baseCommand.test "
73
87
override val publishCommand = s " $baseCommand.publishLocal "
88
+ override val docCommand = null
74
89
override val runCommandsArgs = List (" -i" , " -D" , s " dottyVersion= $compilerVersion" )
75
90
76
91
final case class SbtCommunityProject (
77
92
project : String ,
78
93
sbtTestCommand : String ,
79
94
extraSbtArgs : List [String ] = Nil ,
80
95
dependencies : List [CommunityProject ] = Nil ,
81
- sbtPublishCommand : String = null ) extends CommunityProject :
96
+ sbtPublishCommand : String = null ,
97
+ sbtDocCommand : String = null
98
+ ) extends CommunityProject :
82
99
override val binaryName : String = " sbt"
83
100
84
101
// A project in the community build can depend on an arbitrary version of
@@ -105,7 +122,10 @@ final case class SbtCommunityProject(
105
122
++ s " ++ $compilerVersion!; "
106
123
107
124
override val testCommand = s " $baseCommand$sbtTestCommand"
108
- override val publishCommand = s " $baseCommand$sbtPublishCommand"
125
+ override val publishCommand = if sbtPublishCommand eq null then null else s " $baseCommand$sbtPublishCommand"
126
+ override val docCommand =
127
+ if sbtDocCommand eq null then null else
128
+ s " $baseCommand;set every useScala3doc := true $sbtDocCommand"
109
129
110
130
override val runCommandsArgs : List [String ] =
111
131
// Run the sbt command with the compiler version and sbt plugin set in the build
@@ -119,6 +139,7 @@ final case class SbtCommunityProject(
119
139
)
120
140
121
141
object projects :
142
+
122
143
lazy val utest = MillCommunityProject (
123
144
project = " utest" ,
124
145
baseCommand = s " utest.jvm[ $compilerVersion] " ,
@@ -230,6 +251,7 @@ object projects:
230
251
lazy val betterfiles = SbtCommunityProject (
231
252
project = " betterfiles" ,
232
253
sbtTestCommand = " dotty-community-build/compile" ,
254
+ sbtDocCommand = " ;core/doc ;akka/doc ;shapelessScanner/doc"
233
255
)
234
256
235
257
lazy val ScalaPB = SbtCommunityProject (
@@ -331,6 +353,7 @@ object projects:
331
353
lazy val scalaz = SbtCommunityProject (
332
354
project = " scalaz" ,
333
355
sbtTestCommand = " rootJVM/test" ,
356
+ // has doc/sources set to Nil
334
357
dependencies = List (scalacheck)
335
358
)
336
359
@@ -360,4 +383,49 @@ object projects:
360
383
sbtTestCommand = " compat30/test" ,
361
384
)
362
385
386
+ val projectMap = Map (
387
+ " utest" -> utest,
388
+ " sourcecode" -> sourcecode,
389
+ " oslib" -> oslib,
390
+ " oslibWatch" -> oslibWatch,
391
+ " ujson" -> ujson,
392
+ " upickle" -> upickle,
393
+ " upickleCore" -> upickleCore,
394
+ " geny" -> geny,
395
+ " fansi" -> fansi,
396
+ " pprint" -> pprint,
397
+ " requests" -> requests,
398
+ " scas" -> scas,
399
+ " intent" -> intent,
400
+ " algebra" -> algebra,
401
+ " scalacheck" -> scalacheck,
402
+ " scalatest" -> scalatest,
403
+ " scalatestplusScalacheck" -> scalatestplusScalacheck,
404
+ " scalaXml" -> scalaXml,
405
+ " scopt" -> scopt,
406
+ " scalap" -> scalap,
407
+ " squants" -> squants,
408
+ " betterfiles" -> betterfiles,
409
+ " ScalaPB" -> ScalaPB ,
410
+ " minitest" -> minitest,
411
+ " fastparse" -> fastparse,
412
+ " stdLib213" -> stdLib213,
413
+ " shapeless" -> shapeless,
414
+ " xmlInterpolator" -> xmlInterpolator,
415
+ " effpi" -> effpi,
416
+ " sconfig" -> sconfig,
417
+ " zio" -> zio,
418
+ " munit" -> munit,
419
+ " scodecBits" -> scodecBits,
420
+ " scodec" -> scodec,
421
+ " scalaParserCombinators" -> scalaParserCombinators,
422
+ " dottyCpsAsync" -> dottyCpsAsync,
423
+ " scalaz" -> scalaz,
424
+ " endpoints4s" -> endpoints4s,
425
+ " catsEffect2" -> catsEffect2,
426
+ " catsEffect3" -> catsEffect3,
427
+ " scalaCollectionCompat" -> scalaCollectionCompat
428
+ )
429
+ def apply (key : String ) = projectMap(key)
430
+
363
431
end projects
0 commit comments