@@ -21,64 +21,44 @@ implicit def millModuleBasePath: define.BasePath =
21
21
22
22
23
23
object cli extends Cli
24
- object `cli-core` extends CliCore
25
24
object build extends Cross [Build ] (Scala .defaultInternal)
26
25
object stubs extends JavaModule with ScalaCliPublishModule
27
26
object runner extends Cross [Runner ] (Scala .all: _* )
28
27
object `test-runner` extends Cross [TestRunner ] (Scala .all: _* )
29
28
object `bloop-rifle` extends Cross [BloopRifle ] (Scala .allScala2: _* )
30
29
object `tasty-lib` extends Cross [TastyLib ] (Scala .all: _* )
31
30
32
- object `integration-core` extends Module {
33
- object jvm extends JvmIntegrationCore {
31
+ object integration extends Module {
32
+ object docker extends CliIntegrationDocker {
33
+ object test extends Tests {
34
+ def sources = T .sources {
35
+ super .sources() ++ integration.jvm.sources()
36
+ }
37
+ }
38
+ }
39
+ object jvm extends JvmIntegration {
34
40
object test extends Tests
35
41
}
36
- object native extends NativeIntegrationCore with Bloop .Module {
42
+ object native extends NativeIntegration with Bloop .Module {
37
43
def skipBloop = true
38
44
object test extends Tests with Bloop .Module {
39
45
def skipBloop = true
40
46
}
41
47
}
42
- object `native-static` extends NativeIntegrationCoreStatic with Bloop .Module {
48
+ object `native-static` extends NativeIntegrationStatic with Bloop .Module {
43
49
def skipBloop = true
44
50
object test extends Tests with Bloop .Module {
45
51
def skipBloop = true
46
52
}
47
53
}
48
- object `native-mostly-static` extends NativeIntegrationCoreMostlyStatic with Bloop .Module {
54
+ object `native-mostly-static` extends NativeIntegrationMostlyStatic with Bloop .Module {
49
55
def skipBloop = true
50
56
object test extends Tests with Bloop .Module {
51
57
def skipBloop = true
52
58
}
53
59
}
54
60
}
55
61
56
- object integration extends Module {
57
- object docker extends CliIntegrationDockerCore {
58
- object test extends Tests {
59
- def sources = T .sources {
60
- super .sources() ++ `integration-core`.jvm.sources()
61
- }
62
- }
63
- }
64
- object jvm extends JvmIntegration {
65
- object test extends Tests {
66
- def sources = T .sources {
67
- super .sources() ++ `integration-core`.jvm.test.sources()
68
- }
69
- }
70
- }
71
- object native extends NativeIntegration with Bloop .Module {
72
- def skipBloop = true
73
- object test extends Tests with Bloop .Module {
74
- def skipBloop = true
75
- def sources = T .sources {
76
- super .sources() ++ `integration-core`.native.test.sources()
77
- }
78
- }
79
- }
80
- }
81
-
82
62
object packager extends ScalaModule with Bloop .Module {
83
63
def skipBloop = true
84
64
def scalaVersion = Scala .scala213
@@ -216,23 +196,7 @@ class Build(val crossScalaVersion: String) extends CrossSbtModule with ScalaCliP
216
196
}
217
197
}
218
198
219
- trait Cli extends SbtModule with CliLaunchers with ScalaCliPublishModule with FormatNativeImageConf with HasTests {
220
- def scalaVersion = Scala .defaultInternal
221
- def moduleDeps = Seq (
222
- `cli-core`
223
- )
224
- def compileIvyDeps = super .compileIvyDeps() ++ Agg (
225
- Deps .svm
226
- )
227
- def mainClass = Some (" scala.cli.ScalaCli" )
228
-
229
- def localRepoJar = `local-repo`.localRepoJar()
230
- def graalVmVersion = deps.graalVmVersion
231
-
232
- object test extends Tests
233
- }
234
-
235
- trait CliCore extends SbtModule with CliLaunchers with ScalaCliPublishModule with FormatNativeImageConf with HasMacroAnnotations {
199
+ trait Cli extends SbtModule with CliLaunchers with ScalaCliPublishModule with FormatNativeImageConf with HasTests with HasMacroAnnotations {
236
200
def scalaVersion = Scala .defaultInternal
237
201
def moduleDeps = Seq (
238
202
build(Scala .defaultInternal),
@@ -251,10 +215,12 @@ trait CliCore extends SbtModule with CliLaunchers with ScalaCliPublishModule wit
251
215
def compileIvyDeps = super .compileIvyDeps() ++ Agg (
252
216
Deps .svm
253
217
)
254
- def mainClass = Some (" scala.cli.ScalaCliCore " )
218
+ def mainClass = Some (" scala.cli.ScalaCli " )
255
219
256
220
def localRepoJar = `local-repo`.localRepoJar()
257
221
def graalVmVersion = deps.graalVmVersion
222
+
223
+ object test extends Tests
258
224
}
259
225
260
226
trait CliIntegrationBase extends SbtModule with ScalaCliPublishModule with HasTests {
@@ -270,7 +236,7 @@ trait CliIntegrationBase extends SbtModule with ScalaCliPublishModule with HasTe
270
236
val name = mainArtifactName().stripPrefix(prefix)
271
237
val baseIntegrationPath = os.Path (millSourcePath.toString.stripSuffix(name))
272
238
val modulesPath = os.Path (baseIntegrationPath.toString.stripSuffix(baseIntegrationPath.baseName))
273
- val mainPath = PathRef (modulesPath / " integration-core " / " src" / " main" / " scala" )
239
+ val mainPath = PathRef (modulesPath / " integration" / " src" / " main" / " scala" )
274
240
super .sources() ++ Seq (mainPath)
275
241
}
276
242
@@ -330,7 +296,7 @@ trait CliIntegrationBase extends SbtModule with ScalaCliPublishModule with HasTe
330
296
}
331
297
}
332
298
333
- trait CliIntegrationDockerCore extends SbtModule with ScalaCliPublishModule with HasTests {
299
+ trait CliIntegrationDocker extends SbtModule with ScalaCliPublishModule with HasTests {
334
300
def scalaVersion = Scala .scala213
335
301
def ivyDeps = super .ivyDeps() ++ Agg (
336
302
Deps .osLib
@@ -341,37 +307,23 @@ trait CliIntegration extends CliIntegrationBase {
341
307
def prefix = " integration-"
342
308
}
343
309
344
- trait CliIntegrationCore extends CliIntegration {
345
- def prefix = " integration-core-"
346
- }
347
-
348
310
trait NativeIntegration extends CliIntegration {
349
311
def testLauncher = cli.nativeImage()
350
312
def cliKind = " native"
351
313
}
352
314
353
- trait JvmIntegration extends CliIntegration {
354
- def testLauncher = cli.launcher()
355
- def cliKind = " jvm"
356
- }
357
-
358
- trait NativeIntegrationCore extends CliIntegrationCore {
359
- def testLauncher = `cli-core`.nativeImage()
360
- def cliKind = " native"
361
- }
362
-
363
- trait NativeIntegrationCoreStatic extends CliIntegrationCore {
364
- def testLauncher = `cli-core`.nativeImageStatic()
315
+ trait NativeIntegrationStatic extends CliIntegration {
316
+ def testLauncher = cli.nativeImageStatic()
365
317
def cliKind = " native-static"
366
318
}
367
319
368
- trait NativeIntegrationCoreMostlyStatic extends CliIntegrationCore {
369
- def testLauncher = ` cli-core` .nativeImageMostlyStatic()
320
+ trait NativeIntegrationMostlyStatic extends CliIntegration {
321
+ def testLauncher = cli.nativeImageMostlyStatic()
370
322
def cliKind = " native-mostly-static"
371
323
}
372
324
373
- trait JvmIntegrationCore extends CliIntegrationCore {
374
- def testLauncher = ` cli-core` .launcher()
325
+ trait JvmIntegration extends CliIntegration {
326
+ def testLauncher = cli.launcher()
375
327
def cliKind = " jvm"
376
328
}
377
329
@@ -498,16 +450,6 @@ def copyLauncher(directory: String = "artifacts") = T.command {
498
450
)
499
451
}
500
452
501
- def copyCoreLauncher (directory : String = " artifacts" ) = T .command {
502
- val nativeLauncher = `cli-core`.nativeImage().path
503
- Upload .copyLauncher(
504
- nativeLauncher,
505
- directory,
506
- " scala-cli" ,
507
- compress = true
508
- )
509
- }
510
-
511
453
def copyJvmLauncher (directory : String = " artifacts" ) = T .command {
512
454
val launcher = cli.standaloneLauncher().path
513
455
os.copy(launcher, os.Path (directory, os.pwd) / s " scala-cli $platformExecutableJarExtension" , createFolders = true , replaceExisting = true )
@@ -538,40 +480,23 @@ def scala(args: String*) = T.command {
538
480
cli.run(args : _* )()
539
481
}
540
482
541
- def tightMemory = Properties .isLinux || Properties .isWin
542
-
543
483
def defaultNativeImage () =
544
- if (tightMemory)
545
- T .command {
546
- `cli-core`.nativeImage()
547
- }
548
- else
549
- T .command {
550
- cli.nativeImage()
551
- }
484
+ T .command {
485
+ cli.nativeImage()
486
+ }
552
487
553
488
def nativeIntegrationTests () =
554
- if (tightMemory)
555
- T .command {
556
- `integration-core`.native.test.test()()
557
- }
558
- else
559
- T .command {
560
- integration.native.test.test()()
561
- }
489
+ T .command {
490
+ integration.native.test.test()()
491
+ }
562
492
563
493
def copyDefaultLauncher (directory : String = " artifacts" ) =
564
- if (tightMemory)
565
- T .command {
566
- copyCoreLauncher(directory)()
567
- }
568
- else
569
- T .command {
570
- copyLauncher(directory)()
571
- }
494
+ T .command {
495
+ copyLauncher(directory)()
496
+ }
572
497
573
498
def copyMostlyStaticLauncher (directory : String = " artifacts" ) = T .command {
574
- val nativeLauncher = ` cli-core` .nativeImageMostlyStatic().path
499
+ val nativeLauncher = cli.nativeImageMostlyStatic().path
575
500
Upload .copyLauncher(
576
501
nativeLauncher,
577
502
directory,
@@ -582,7 +507,7 @@ def copyMostlyStaticLauncher(directory: String = "artifacts") = T.command {
582
507
}
583
508
584
509
def copyStaticLauncher (directory : String = " artifacts" ) = T .command {
585
- val nativeLauncher = ` cli-core` .nativeImageStatic().path
510
+ val nativeLauncher = cli.nativeImageStatic().path
586
511
Upload .copyLauncher(
587
512
nativeLauncher,
588
513
directory,
0 commit comments