Skip to content

Commit 087927e

Browse files
committed
chore: add tests for scala3-sbt-bridge (non-bootstrapped and bootstrapped)
1 parent dca8e95 commit 087927e

File tree

2 files changed

+67
-6
lines changed

2 files changed

+67
-6
lines changed

.github/workflows/stdlib.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,41 @@ jobs:
182182
- uses: sbt/setup-sbt@v1
183183
- name: Compile `scala3-sbt-bridge-bootstrapped`
184184
run: ./project/scripts/sbt scala3-sbt-bridge-bootstrapped/compile
185+
186+
#################################################################################################
187+
########################################### TEST JOBS ###########################################
188+
#################################################################################################
189+
190+
test-tasty-core-nonbootstrapped:
191+
runs-on: ubuntu-latest
192+
##needs: [tasty-core-nonbootstrapped] Add when we add support for caching here
193+
steps:
194+
- name: Git Checkout
195+
uses: actions/checkout@v4
196+
197+
- name: Set up JDK 17
198+
uses: actions/setup-java@v4
199+
with:
200+
distribution: 'temurin'
201+
java-version: 17
202+
cache: 'sbt'
203+
- uses: sbt/setup-sbt@v1
204+
- name: Test `tasty-core-nonbootstrapped`
205+
run: ./project/scripts/sbt tasty-core-nonbootstrapped/test
206+
207+
test-tasty-core-bootstrapped:
208+
runs-on: ubuntu-latest
209+
##needs: [tasty-core-bootstrapped] Add when we add support for caching here
210+
steps:
211+
- name: Git Checkout
212+
uses: actions/checkout@v4
213+
214+
- name: Set up JDK 17
215+
uses: actions/setup-java@v4
216+
with:
217+
distribution: 'temurin'
218+
java-version: 17
219+
cache: 'sbt'
220+
- uses: sbt/setup-sbt@v1
221+
- name: Test `tasty-core-bootstrapped`
222+
run: ./project/scripts/sbt tasty-core-bootstrapped/test

project/Build.scala

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,14 +1396,25 @@ object Build {
13961396
scalaVersion := referenceVersion, // nonbootstrapped artifacts are compiled with the reference compiler (already officially published)
13971397
crossPaths := false, // org.scala-lang:scala3-sbt-bridge doesn't have a crosspath
13981398
autoScalaLibrary := false, // do not add a dependency to stdlib, we depend transitively on the stdlib from `scala3-compiler-nonbootstrapped`
1399-
// Add the source directories for the stdlib (non-boostrapped)
1399+
// Add the source directories for the sbt-bridge (non-boostrapped)
14001400
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
1401+
Test / unmanagedSourceDirectories := Seq(baseDirectory.value / "test"),
14011402
Compile / resourceDirectory := baseDirectory.value / "resources",
14021403
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
14031404
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
14041405
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
14051406
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
14061407
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
1408+
// Add all the project's external dependencies
1409+
libraryDependencies ++= Seq(
1410+
("org.scala-sbt" %% "zinc-apiinfo" % "1.8.0" % Test).cross(CrossVersion.for3Use2_13),
1411+
"com.github.sbt" % "junit-interface" % "0.13.3" % Test,
1412+
),
1413+
// Exclude the transitive dependencies from `zinc-apiinfo` that causes issues at the moment
1414+
excludeDependencies ++= Seq(
1415+
"org.scala-lang" % "scala-reflect",
1416+
"org.scala-lang" % "scala-compiler",
1417+
),
14071418
// Packaging configuration of the stdlib
14081419
Compile / packageBin / publishArtifact := true,
14091420
Compile / packageDoc / publishArtifact := false,
@@ -1455,7 +1466,7 @@ object Build {
14551466

14561467
/* Configuration of the org.scala-lang:scala3-sbt-bridge:*.**.**-bootstrapped project */
14571468
lazy val `scala3-sbt-bridge-bootstrapped` = project.in(file("sbt-bridge"))
1458-
.dependsOn(`scala3-compiler-bootstrapped`) // TODO: Would this actually evict the reference compiler in scala-tool?
1469+
.dependsOn(`scala3-compiler-bootstrapped-new`) // TODO: Would this actually evict the reference compiler in scala-tool?
14591470
.settings(
14601471
name := "scala3-sbt-bridge-bootstrapped",
14611472
moduleName := "scala3-sbt-bridge",
@@ -1464,15 +1475,27 @@ object Build {
14641475
scalaVersion := referenceVersion, // nonbootstrapped artifacts are compiled with the reference compiler (already officially published)
14651476
crossPaths := false, // org.scala-lang:scala3-sbt-bridge doesn't have a crosspath
14661477
autoScalaLibrary := false, // do not add a dependency to stdlib, we depend transitively on the stdlib from `scala3-compiler-nonbootstrapped`
1467-
// Add the source directories for the stdlib (non-boostrapped)
1478+
// Add the source directories for the sbt-bridge (boostrapped)
14681479
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
1480+
Test / unmanagedSourceDirectories := Seq(baseDirectory.value / "test"),
14691481
Compile / resourceDirectory := baseDirectory.value / "resources",
14701482
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
14711483
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
14721484
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
14731485
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
14741486
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
1475-
// Packaging configuration of the stdlib
1487+
// Add all the project's external dependencies
1488+
libraryDependencies ++= Seq(
1489+
("org.scala-sbt" %% "zinc-apiinfo" % "1.8.0" % Test).cross(CrossVersion.for3Use2_13),
1490+
"com.github.sbt" % "junit-interface" % "0.13.3" % Test,
1491+
),
1492+
// Exclude the transitive dependencies from `zinc-apiinfo` that causes issues at the moment
1493+
excludeDependencies ++= Seq(
1494+
"org.scala-lang" % "scala-reflect",
1495+
"org.scala-lang" % "scala-compiler",
1496+
),
1497+
//
1498+
// Packaging configuration of `scala3-sbt-bridge`
14761499
Compile / packageBin / publishArtifact := true,
14771500
Compile / packageDoc / publishArtifact := false,
14781501
Compile / packageSrc / publishArtifact := true,
@@ -1749,7 +1772,7 @@ object Build {
17491772

17501773
/* Configuration of the org.scala-lang:tasty-core_3:*.**.**-bootstrapped project */
17511774
lazy val `tasty-core-bootstrapped-new` = project.in(file("tasty"))
1752-
.dependsOn(`scala3-library-bootstrapped`)
1775+
.dependsOn(`scala3-library-bootstrapped-new`)
17531776
.settings(
17541777
name := "tasty-core-bootstrapped",
17551778
moduleName := "tasty-core",
@@ -1930,7 +1953,7 @@ object Build {
19301953

19311954
/* Configuration of the org.scala-lang:scala3-compiler_3:*.**.**-bootstrapped project */
19321955
lazy val `scala3-compiler-bootstrapped-new` = project.in(file("compiler"))
1933-
.dependsOn(`scala3-interfaces`, `tasty-core-bootstrapped`, `scala3-library-bootstrapped`)
1956+
.dependsOn(`scala3-interfaces`, `tasty-core-bootstrapped-new`, `scala3-library-bootstrapped-new`)
19341957
.settings(
19351958
name := "scala3-compiler-bootstrapped",
19361959
moduleName := "scala3-compiler",

0 commit comments

Comments
 (0)