Skip to content

Commit deeda71

Browse files
Merge cli / cli-core and integration / integration-core
Now that we don't depend on metabrowse any more, we should have less memory issues.
1 parent d2d31a3 commit deeda71

File tree

103 files changed

+41
-123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+41
-123
lines changed

.github/scripts/generate-docker-images-ubuntu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -eu
33

4-
launcherMillCommand="cli-core.nativeImageMostlyStatic"
4+
launcherMillCommand="cli.nativeImageMostlyStatic"
55
launcherName="scala"
66
mill="./mill"
77

.github/scripts/generate-os-packages.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,9 @@ packager() {
1515
}
1616

1717
launcher() {
18-
local launcherMillCommand
18+
local launcherMillCommand="cli.nativeImage"
1919
local launcherName
2020

21-
if [[ "$OSTYPE" == "linux-gnu"* || "$OSTYPE" == "msys" ]]; then
22-
# requires less memory - to be used when memory is tight on the CI
23-
launcherMillCommand="cli-core.nativeImage"
24-
else
25-
launcherMillCommand="cli.nativeImage"
26-
fi
27-
2821
if [[ "$OSTYPE" == "msys" ]]; then
2922
launcherName="scala.exe"
3023
else

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
with:
102102
jvm: 8
103103
- name: Generate native launcher
104-
run: ./mill -i show cli-core.nativeImageMostlyStatic
104+
run: ./mill -i show cli.nativeImageMostlyStatic
105105
- name: Build docker image
106106
run: .github/scripts/generate-docker-images-ubuntu.sh
107107
- name: Copy artifacts
@@ -113,7 +113,7 @@ jobs:
113113
if-no-files-found: error
114114
retention-days: 2
115115
- name: Native integration tests
116-
run: ./mill -i integration-core.native-mostly-static.test
116+
run: ./mill -i integration.native-mostly-static.test
117117
- name: Docker integration tests
118118
run: ./mill integration.docker.test
119119
- name: Login to GitHub Container Registry
@@ -141,7 +141,7 @@ jobs:
141141
with:
142142
jvm: 8
143143
- name: Generate native launcher
144-
run: ./mill -i show cli-core.nativeImageStatic
144+
run: ./mill -i show cli.nativeImageStatic
145145
- name: Copy artifacts
146146
run: ./mill -i copyStaticLauncher artifacts/
147147
- uses: actions/[email protected]
@@ -151,7 +151,7 @@ jobs:
151151
if-no-files-found: error
152152
retention-days: 2
153153
- name: Native integration tests
154-
run: ./mill -i integration-core.native-static.test
154+
run: ./mill -i integration.native-static.test
155155

156156
checks:
157157
runs-on: ubuntu-latest

build.sc

Lines changed: 35 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -21,64 +21,44 @@ implicit def millModuleBasePath: define.BasePath =
2121

2222

2323
object cli extends Cli
24-
object `cli-core` extends CliCore
2524
object build extends Cross[Build] (Scala.defaultInternal)
2625
object stubs extends JavaModule with ScalaCliPublishModule
2726
object runner extends Cross[Runner] (Scala.all: _*)
2827
object `test-runner` extends Cross[TestRunner] (Scala.all: _*)
2928
object `bloop-rifle` extends Cross[BloopRifle] (Scala.allScala2: _*)
3029
object `tasty-lib` extends Cross[TastyLib] (Scala.all: _*)
3130

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 {
3440
object test extends Tests
3541
}
36-
object native extends NativeIntegrationCore with Bloop.Module {
42+
object native extends NativeIntegration with Bloop.Module {
3743
def skipBloop = true
3844
object test extends Tests with Bloop.Module {
3945
def skipBloop = true
4046
}
4147
}
42-
object `native-static` extends NativeIntegrationCoreStatic with Bloop.Module {
48+
object `native-static` extends NativeIntegrationStatic with Bloop.Module {
4349
def skipBloop = true
4450
object test extends Tests with Bloop.Module {
4551
def skipBloop = true
4652
}
4753
}
48-
object `native-mostly-static` extends NativeIntegrationCoreMostlyStatic with Bloop.Module {
54+
object `native-mostly-static` extends NativeIntegrationMostlyStatic with Bloop.Module {
4955
def skipBloop = true
5056
object test extends Tests with Bloop.Module {
5157
def skipBloop = true
5258
}
5359
}
5460
}
5561

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-
8262
object packager extends ScalaModule with Bloop.Module {
8363
def skipBloop = true
8464
def scalaVersion = Scala.scala213
@@ -216,23 +196,7 @@ class Build(val crossScalaVersion: String) extends CrossSbtModule with ScalaCliP
216196
}
217197
}
218198

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 {
236200
def scalaVersion = Scala.defaultInternal
237201
def moduleDeps = Seq(
238202
build(Scala.defaultInternal),
@@ -251,10 +215,12 @@ trait CliCore extends SbtModule with CliLaunchers with ScalaCliPublishModule wit
251215
def compileIvyDeps = super.compileIvyDeps() ++ Agg(
252216
Deps.svm
253217
)
254-
def mainClass = Some("scala.cli.ScalaCliCore")
218+
def mainClass = Some("scala.cli.ScalaCli")
255219

256220
def localRepoJar = `local-repo`.localRepoJar()
257221
def graalVmVersion = deps.graalVmVersion
222+
223+
object test extends Tests
258224
}
259225

260226
trait CliIntegrationBase extends SbtModule with ScalaCliPublishModule with HasTests {
@@ -270,7 +236,7 @@ trait CliIntegrationBase extends SbtModule with ScalaCliPublishModule with HasTe
270236
val name = mainArtifactName().stripPrefix(prefix)
271237
val baseIntegrationPath = os.Path(millSourcePath.toString.stripSuffix(name))
272238
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")
274240
super.sources() ++ Seq(mainPath)
275241
}
276242

@@ -330,7 +296,7 @@ trait CliIntegrationBase extends SbtModule with ScalaCliPublishModule with HasTe
330296
}
331297
}
332298

333-
trait CliIntegrationDockerCore extends SbtModule with ScalaCliPublishModule with HasTests {
299+
trait CliIntegrationDocker extends SbtModule with ScalaCliPublishModule with HasTests {
334300
def scalaVersion = Scala.scala213
335301
def ivyDeps = super.ivyDeps() ++ Agg(
336302
Deps.osLib
@@ -341,37 +307,23 @@ trait CliIntegration extends CliIntegrationBase {
341307
def prefix = "integration-"
342308
}
343309

344-
trait CliIntegrationCore extends CliIntegration {
345-
def prefix = "integration-core-"
346-
}
347-
348310
trait NativeIntegration extends CliIntegration {
349311
def testLauncher = cli.nativeImage()
350312
def cliKind = "native"
351313
}
352314

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()
365317
def cliKind = "native-static"
366318
}
367319

368-
trait NativeIntegrationCoreMostlyStatic extends CliIntegrationCore {
369-
def testLauncher = `cli-core`.nativeImageMostlyStatic()
320+
trait NativeIntegrationMostlyStatic extends CliIntegration {
321+
def testLauncher = cli.nativeImageMostlyStatic()
370322
def cliKind = "native-mostly-static"
371323
}
372324

373-
trait JvmIntegrationCore extends CliIntegrationCore {
374-
def testLauncher = `cli-core`.launcher()
325+
trait JvmIntegration extends CliIntegration {
326+
def testLauncher = cli.launcher()
375327
def cliKind = "jvm"
376328
}
377329

@@ -498,16 +450,6 @@ def copyLauncher(directory: String = "artifacts") = T.command {
498450
)
499451
}
500452

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-
511453
def copyJvmLauncher(directory: String = "artifacts") = T.command {
512454
val launcher = cli.standaloneLauncher().path
513455
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 {
538480
cli.run(args: _*)()
539481
}
540482

541-
def tightMemory = Properties.isLinux || Properties.isWin
542-
543483
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+
}
552487

553488
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+
}
562492

563493
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+
}
572497

573498
def copyMostlyStaticLauncher(directory: String = "artifacts") = T.command {
574-
val nativeLauncher = `cli-core`.nativeImageMostlyStatic().path
499+
val nativeLauncher = cli.nativeImageMostlyStatic().path
575500
Upload.copyLauncher(
576501
nativeLauncher,
577502
directory,
@@ -582,7 +507,7 @@ def copyMostlyStaticLauncher(directory: String = "artifacts") = T.command {
582507
}
583508

584509
def copyStaticLauncher(directory: String = "artifacts") = T.command {
585-
val nativeLauncher = `cli-core`.nativeImageStatic().path
510+
val nativeLauncher = cli.nativeImageStatic().path
586511
Upload.copyLauncher(
587512
nativeLauncher,
588513
directory,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)