From 85ddd961b03d79e572580dde727e4161dfa50b1d Mon Sep 17 00:00:00 2001 From: Yichen Xu Date: Wed, 13 Mar 2024 12:41:36 +0100 Subject: [PATCH] Add sbt test for `scala2-library-cc-tasty` --- project/Build.scala | 1 + sbt-test/sbt-dotty/scala2-library-cc-tasty/build.sbt | 4 ++++ .../scala2-library-cc-tasty/src/main/scala/hello/Hello.scala | 4 ++++ sbt-test/sbt-dotty/scala2-library-cc-tasty/test | 1 + 4 files changed, 10 insertions(+) create mode 100644 sbt-test/sbt-dotty/scala2-library-cc-tasty/build.sbt create mode 100644 sbt-test/sbt-dotty/scala2-library-cc-tasty/src/main/scala/hello/Hello.scala create mode 100644 sbt-test/sbt-dotty/scala2-library-cc-tasty/test diff --git a/project/Build.scala b/project/Build.scala index 2b24746e4ca4..ea56039fa401 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1920,6 +1920,7 @@ object Build { (`scala3-compiler-bootstrapped` / publishLocalBin), (`scala3-library-bootstrapped` / publishLocalBin), (`scala2-library-tasty` / publishLocal), + (`scala2-library-cc-tasty` / publishLocal), (`scala3-library-bootstrappedJS` / publishLocalBin), (`tasty-core-bootstrapped` / publishLocalBin), (`scala3-staging` / publishLocalBin), diff --git a/sbt-test/sbt-dotty/scala2-library-cc-tasty/build.sbt b/sbt-test/sbt-dotty/scala2-library-cc-tasty/build.sbt new file mode 100644 index 000000000000..db059b501d77 --- /dev/null +++ b/sbt-test/sbt-dotty/scala2-library-cc-tasty/build.sbt @@ -0,0 +1,4 @@ +scalaVersion := sys.props("plugin.scalaVersion") + +libraryDependencies += "org.scala-lang" %% "scala2-library-cc-tasty-experimental" % scalaVersion.value +scalacOptions += "-Yscala2-unpickler:never" // check that we do not load symbol from the Scala 2 library classfiles (use TASTy) diff --git a/sbt-test/sbt-dotty/scala2-library-cc-tasty/src/main/scala/hello/Hello.scala b/sbt-test/sbt-dotty/scala2-library-cc-tasty/src/main/scala/hello/Hello.scala new file mode 100644 index 000000000000..87277631f69b --- /dev/null +++ b/sbt-test/sbt-dotty/scala2-library-cc-tasty/src/main/scala/hello/Hello.scala @@ -0,0 +1,4 @@ +package hello + +@main def hello: Unit = + println(Some("Hello world!")) // load Some form the Scala 2 library TASTy diff --git a/sbt-test/sbt-dotty/scala2-library-cc-tasty/test b/sbt-test/sbt-dotty/scala2-library-cc-tasty/test new file mode 100644 index 000000000000..62ea636c177f --- /dev/null +++ b/sbt-test/sbt-dotty/scala2-library-cc-tasty/test @@ -0,0 +1 @@ +> run