@@ -7,18 +7,19 @@ import org.junit.{Ignore, Test}
7
7
import org .junit .Assert .{assertEquals , fail }
8
8
import org .junit .experimental .categories .Category
9
9
10
- case class MillCommunityProject (project : String , testCommand : String ,
11
- publishCommand : String = " " , extraArgs : List [ String ] = Nil ,
12
- dependencies : List [MillCommunityProject ] = Nil )
10
+ final case class MillCommunityProject (project : String , testCommand : String ,
11
+ updateCommand : String , publishCommand : String = " " ,
12
+ extraArgs : List [ String ] = Nil , dependencies : List [MillCommunityProject ] = Nil )
13
13
import communityBuildCommons .{ log , exec , communitybuildDir }
14
14
15
15
private var published = false
16
16
17
- final def test ()(given suite : CommunityBuildTest ) =
18
- dependencies.foreach(_.publish())
19
- suite.test(project, " ./mill" , extraArgs :+ testCommand)
17
+ def test (update : Boolean )(given suite : CommunityBuildTest ) =
18
+ val millCmd = if update then updateCommand else testCommand
19
+ if ! update then dependencies.foreach(_.publish())
20
+ suite.test(project, " ./mill" , extraArgs :+ millCmd)
20
21
21
- final def publish () =
22
+ def publish () =
22
23
if ! published
23
24
log(s " Publishing $project" )
24
25
val projectDir = communitybuildDir.resolve(" community-projects" ).resolve(project)
@@ -58,26 +59,30 @@ object projects
58
59
project = " utest" ,
59
60
testCommand = s " utest.jvm[ $compilerVersion].test " ,
60
61
publishCommand = s " utest.jvm[ $compilerVersion].publishLocal " ,
62
+ updateCommand = " utest.jvm[$compilerVersion].compileClasspath" ,
61
63
extraArgs = List (" -i" , " -D" , s " dottyVersion= $compilerVersion" )
62
64
)
63
65
64
66
val sourcecode = MillCommunityProject (
65
67
project = " sourcecode" ,
66
68
testCommand = s " sourcecode.jvm[ $compilerVersion].test " ,
69
+ updateCommand = s " sourcecode.jvm[ $compilerVersion].compileClasspath " ,
67
70
publishCommand = s " sourcecode.jvm[ $compilerVersion].publishLocal " ,
68
71
extraArgs = List (" -i" , " -D" , s " dottyVersion= $compilerVersion" ),
69
72
)
70
73
71
74
val oslib = MillCommunityProject (
72
75
project = " os-lib" ,
73
76
testCommand = s " os[ $compilerVersion].test " ,
77
+ updateCommand = s " os[ $compilerVersion].compileClasspath " ,
74
78
extraArgs = List (" -i" , " -D" , s " dottyVersion= $compilerVersion" ),
75
79
dependencies = List (utest, sourcecode)
76
80
)
77
81
78
82
val oslibWatch = MillCommunityProject (
79
83
project = " os-lib" ,
80
84
testCommand = s " os.watch[ $compilerVersion].test " ,
85
+ updateCommand = s " os.watch[ $compilerVersion].compileClasspath " ,
81
86
extraArgs = List (" -i" , " -D" , s " dottyVersion= $compilerVersion" ),
82
87
dependencies = List (utest, sourcecode)
83
88
)
@@ -88,6 +93,7 @@ class CommunityBuildTest {
88
93
import communityBuildCommons ._
89
94
90
95
given CommunityBuildTest = this
96
+ val updateCacheRun = false
91
97
92
98
def testSbt (project : String , testCommand : String , updateCommand : String , extraSbtArgs : Seq [String ] = Nil ) = {
93
99
// Workaround for https://github.com/sbt/sbt/issues/4395
@@ -228,13 +234,13 @@ class CommunityBuildTest {
228
234
updateCommand = " dotty-community-build/update"
229
235
)
230
236
231
- @ Test def utest = projects.utest.test()
237
+ @ Test def utest = projects.utest.test(updateCacheRun )
232
238
233
- @ Test def sourcecode = projects.sourcecode.test()
239
+ @ Test def sourcecode = projects.sourcecode.test(updateCacheRun )
234
240
235
- @ Test def oslib = projects.oslib.test()
241
+ @ Test def oslib = projects.oslib.test(updateCacheRun )
236
242
237
- @ Test def oslibWatch = projects.oslibWatch.test()
243
+ @ Test def oslibWatch = projects.oslibWatch.test(updateCacheRun )
238
244
239
245
@ Test def stdLib213 = testSbt(
240
246
project = " stdLib213" ,
@@ -291,6 +297,8 @@ class UpdateCategory
291
297
292
298
@ Category (Array (classOf [UpdateCategory ]))
293
299
class CommunityBuildUpdate extends CommunityBuildTest {
300
+ override val updateCacheRun = true
301
+
294
302
override def testSbt (project : String , testCommand : String , updateCommand : String , extraSbtArgs : Seq [String ]): Unit =
295
303
super .testSbt(project, updateCommand, null , extraSbtArgs)
296
304
}
0 commit comments