diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7a617328809e..47561c01d78a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -97,7 +97,7 @@ jobs: - name: Cmd Tests run: | ./project/scripts/buildScalaBinary - ./project/scripts/sbt ";scala3-bootstrapped/compile ;sbt-test/scripted scala2-compat/* ;scala3-compiler-bootstrapped/scala3CompilerCoursierTest:test" + ./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-compiler-bootstrapped/scala3CompilerCoursierTest:test" ./project/scripts/cmdTests ./project/scripts/bootstrappedOnlyCmdTests @@ -339,51 +339,6 @@ jobs: if: ${{ always() }} run: cat community-build/dotty-community-build-deps || true - test_sbt: - runs-on: [self-hosted, Linux] - container: - image: lampepfl/dotty:2024-10-18 - options: --cpu-shares 4096 - volumes: - - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - - ${{ github.workspace }}/../../cache/general:/root/.cache - if: "github.event_name == 'schedule' && github.repository == 'scala/scala3' - || github.event_name == 'push' - || ( - github.event_name == 'pull_request' - && !contains(github.event.pull_request.body, '[skip ci]') - && !contains(github.event.pull_request.body, '[skip test_sbt]') - ) - || ( - github.event_name == 'workflow_dispatch' - && github.repository == 'scala/scala3' - )" - - steps: - - name: Set JDK 17 as default - run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH - - - name: Reset existing repo - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true - - - name: Checkout cleanup script - uses: actions/checkout@v5 - - - name: Cleanup - run: .github/workflows/cleanup.sh - - - name: Git Checkout - uses: actions/checkout@v5 - - - name: Add SBT proxy repositories - run: cp -vf .github/workflows/repositories /root/.sbt/ ; true - - - name: Test sbt - run: ./project/scripts/sbt "sbt-test/scripted" - publish_release: permissions: contents: write # for GH CLI to create a release @@ -395,7 +350,7 @@ jobs: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - needs: [test, community_build_a, community_build_b, community_build_c, test_sbt, build-sdk-package, build-msi-package] + needs: [test, community_build_a, community_build_b, community_build_c, build-sdk-package, build-msi-package] if: "github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')" diff --git a/.github/workflows/scaladoc.yaml b/.github/workflows/scaladoc.yaml index a09058377e48..0482a0845650 100644 --- a/.github/workflows/scaladoc.yaml +++ b/.github/workflows/scaladoc.yaml @@ -62,9 +62,6 @@ jobs: - name: Generate Scala 3 documentation run: ./project/scripts/sbt scaladoc/generateScalaDocumentation - - name: Generate documentation for example project using dotty-sbt - run: ./project/scripts/sbt "sbt-test/scripted sbt-dotty/scaladoc" - stdlib-sourcelinks-test: runs-on: ubuntu-latest # if false - disable flaky test diff --git a/.github/workflows/stdlib.yaml b/.github/workflows/stdlib.yaml index cce7bab92f3c..c6ca9e2d86a8 100644 --- a/.github/workflows/stdlib.yaml +++ b/.github/workflows/stdlib.yaml @@ -539,3 +539,20 @@ jobs: - name: Scala.js JUnit tests run: ./project/scripts/sbt ";sjsJUnitTests/test ;set sjsJUnitTests/scalaJSLinkerConfig ~= switchToESModules ;sjsJUnitTests/test" # TODO Scala.js on Windows + + scripted-tests: + runs-on: ubuntu-latest + needs: [scala3-compiler-bootstrapped, tasty-core-bootstrapped, scala3-staging, scala3-tasty-inspector, scala-library-sjs, scaladoc] + steps: + - name: Git Checkout + uses: actions/checkout@v5 + + - name: Set up JDK 17 + uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: 17 + cache: 'sbt' + - uses: sbt/setup-sbt@v1 + - name: Run SBT scripted tests + run: ./project/scripts/sbt scala3-bootstrapped-new/scripted diff --git a/build.sbt b/build.sbt index 3af7481b4467..bde1cbe76cce 100644 --- a/build.sbt +++ b/build.sbt @@ -54,7 +54,5 @@ val sjsSandbox = Build.sjsSandbox val sjsJUnitTests = Build.sjsJUnitTests val sjsCompilerTests = Build.sjsCompilerTests -val `sbt-test` = Build.`sbt-test` - inThisBuild(Build.thisBuildSettings) inScope(Global)(Build.globalSettings) diff --git a/project/Build.scala b/project/Build.scala index 7064adf4f8fe..49da04aba61c 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1471,6 +1471,7 @@ object Build { // ============================================================================================== lazy val `scala3-bootstrapped-new` = project + .enablePlugins(ScriptedPlugin) .aggregate(`scala3-interfaces`, `scala3-library-bootstrapped-new` , `scala-library-bootstrapped`, `tasty-core-bootstrapped-new`, `scala3-compiler-bootstrapped-new`, `scala3-sbt-bridge-bootstrapped`, `scala3-staging-new`, `scala3-tasty-inspector-new`, `scala-library-sjs`, `scala3-library-sjs`, `scaladoc-new`) @@ -1557,7 +1558,33 @@ object Build { (if (args1.nonEmpty) " -Ddotty.tests.filter=" + args1.mkString(" ") else "") (`scala3-compiler-bootstrapped-new` / Test / testOnly).toTask(cmd) } - }.evaluated + }.evaluated, + // ================================ SBT SCRIPT TEST SETTINGS ================================ + sbtTestDirectory := (ThisBuild / baseDirectory).value / "sbt-test", + // 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), + publishLocalBin, + ).evaluated, ) /* Configuration of the org.scala-lang:scala3-sbt-bridge:*.**.**-bootstrapped project */ @@ -3507,47 +3534,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 - ) - val prepareCommunityBuild = taskKey[Unit]("Publish local the compiler and the sbt plugin. Also store the versions of the published local artefacts in two files, community-build/{scala3-bootstrapped.version,sbt-injected-plugins}.") lazy val `community-build` = project.in(file("community-build")).