Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ jobs:
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true

- name: Test sbt
run: ./project/scripts/sbt "sbt-test/scripted; sbt-community-build/scripted"
run: ./project/scripts/sbt sbt-community-build/scripted

publish_release:
permissions:
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/stdlib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -462,3 +462,26 @@ jobs:
- uses: sbt/setup-sbt@v1
- name: Test `tasty-core-bootstrapped`
run: ./project/scripts/sbt tasty-core-bootstrapped-new/test

sbt-test:
runs-on: ubuntu-latest
##needs: [scala3-sbt-bridge-bootstrapped,
## scala3-library-bootstrapped,
## scala3-compiler-bootstrapped,
## tasty-core-bootstrapped,
## scala3-library-sjs,
## scala3-tasty-inspector,
## scala3-staging] Add when we add support for caching here
steps:
- name: Git Checkout
uses: actions/checkout@v5

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@v1
- name: Run `sbt-test`
run: ./project/scripts/sbt sbt-test-new/scripted
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ val sjsSandbox = Build.sjsSandbox
val sjsJUnitTests = Build.sjsJUnitTests
val sjsCompilerTests = Build.sjsCompilerTests

val `sbt-test` = Build.`sbt-test`
val `sbt-test-new` = Build.`sbt-test-new`

inThisBuild(Build.thisBuildSettings)
inScope(Global)(Build.globalSettings)
75 changes: 34 additions & 41 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2445,6 +2445,40 @@ object Build {
},
)

// ==============================================================================================
// ========================================= TEST SUITE =========================================
// ==============================================================================================

lazy val `sbt-test-new` = project.in(file("sbt-test"))
.enablePlugins(ScriptedPlugin)
.settings(
sbtTestDirectory := baseDirectory.value,
// The batch mode accidentally became the default with no way to disable
// it in sbt 1.4 (https://github.com/sbt/sbt/issues/5913#issuecomment-716003195).
// We enable it explicitly here to make it clear that we're using it.
scriptedBatchExecution := true,
scriptedLaunchOpts ++= Seq(
s"-Dplugin.scalaVersion=${dottyVersion}",
s"-Dplugin.scala2Version=${stdlibVersion(Bootstrapped)}",
s"-Dplugin.scalaJSVersion=${scalaJSVersion}",
),
scriptedBufferLog := true,
scripted := scripted.dependsOn(
(`scala3-sbt-bridge-bootstrapped` / publishLocalBin),
(`scala3-interfaces` / publishLocalBin),
(`scala3-compiler-bootstrapped-new` / publishLocalBin),
(`scala3-library-bootstrapped-new` / publishLocalBin),
(`scala-library-bootstrapped` / publishLocalBin),
(`scala-library-sjs` / publishLocalBin),
(`scala3-library-sjs` / publishLocalBin),
(`tasty-core-bootstrapped-new` / publishLocalBin),
(`scala3-staging-new` / publishLocalBin),
(`scala3-tasty-inspector-new` / publishLocalBin),
(`scaladoc-new` / publishLocalBin),
(`scala3-bootstrapped-new` / publishLocalBin),
).evaluated,
)

def dottyLibrary(implicit mode: Mode): Project = mode match {
case NonBootstrapped => `scala3-library`
case Bootstrapped => `scala3-library-bootstrapped`
Expand Down Expand Up @@ -3155,47 +3189,6 @@ object Build {
BuildInfoPlugin.buildInfoScopedSettings(Test),
)

// various scripted sbt tests
lazy val `sbt-test` = project.in(file("sbt-test")).
enablePlugins(ScriptedPlugin).
settings(commonSettings).
settings(
sbtTestDirectory := baseDirectory.value,
target := baseDirectory.value / ".." / "out" / name.value,

// The batch mode accidentally became the default with no way to disable
// it in sbt 1.4 (https://github.com/sbt/sbt/issues/5913#issuecomment-716003195).
// We enable it explicitly here to make it clear that we're using it.
scriptedBatchExecution := true,

scriptedLaunchOpts ++= Seq(
"-Dplugin.version=" + version.value,
"-Dplugin.scalaVersion=" + dottyVersion,
"-Dplugin.scala2Version=" + stdlibVersion(Bootstrapped),
"-Dplugin.scalaJSVersion=" + scalaJSVersion,
"-Dsbt.boot.directory=" + ((ThisBuild / baseDirectory).value / ".sbt-scripted").getAbsolutePath // Workaround sbt/sbt#3469
),
// Pass along ivy home and repositories settings to sbt instances run from the tests
scriptedLaunchOpts ++= {
val repositoryPath = (io.Path.userHome / ".sbt" / "repositories").absolutePath
s"-Dsbt.repository.config=$repositoryPath" ::
ivyPaths.value.ivyHome.map("-Dsbt.ivy.home=" + _.getAbsolutePath).toList
},
scriptedBufferLog := true,
scripted := scripted.dependsOn(
(`scala3-sbt-bridge` / publishLocalBin),
(`scala3-interfaces` / publishLocalBin),
(`scala3-compiler-bootstrapped` / publishLocalBin),
(`scala3-library-bootstrapped` / publishLocalBin),
(`scala3-library-bootstrappedJS` / publishLocalBin),
(`tasty-core-bootstrapped` / publishLocalBin),
(`scala3-staging` / publishLocalBin),
(`scala3-tasty-inspector` / publishLocalBin),
(`scaladoc` / publishLocalBin),
(`scala3-bootstrapped` / publishLocalBin) // Needed because sbt currently hardcodes the dotty artifact
).evaluated
)

lazy val `sbt-community-build` = project.in(file("sbt-community-build")).
enablePlugins(SbtPlugin).
settings(commonSettings).
Expand Down
Loading