forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a433f47
commit 14bbc37
Showing
9 changed files
with
83 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Readme | ||
|
||
Do not use this directory for testing sbt projects in general, add a test case to `dotty/sbt-test` | ||
|
||
This directory is for sbt tests that can not be reproduced with sbt scripted tests. | ||
|
||
Adding a test here will reduce the performance of running all tests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import java.util.Properties | ||
|
||
val packProperties = settingKey[Properties]("The properties of the dist/pack command") | ||
|
||
val prepareChanges = taskKey[Unit]("Copy changes to the src directory") | ||
val copyChanges = taskKey[Unit]("Copy changes to the src directory") | ||
|
||
packProperties := { | ||
val prop = new Properties() | ||
IO | ||
.read(new File(sys.props("pack.version.file"))) | ||
.linesIterator | ||
.foreach { line => | ||
val Array(key, value) = line.split(":=") | ||
prop.setProperty(key, value) | ||
} | ||
prop | ||
} | ||
|
||
prepareChanges := { | ||
val root = (ThisBuild / baseDirectory).value | ||
val src = root / "src" / "main" / "scala" | ||
val changes = root / "changes" | ||
println("copying changes/zz.original.scala to src/main/scala/a/zz.scala") | ||
IO.copyFile(changes / "zz.original.scala", src / "a" / "zz.scala") | ||
} | ||
|
||
copyChanges := { | ||
val root = (ThisBuild / baseDirectory).value | ||
val src = root / "src" / "main" / "scala" | ||
val changes = root / "changes" | ||
println("copying changes/zz1.scala to src/main/scala/a/zz.scala") | ||
IO.copyFile(changes / "zz1.scala", src / "a" / "zz.scala") | ||
} | ||
|
||
scalaVersion := packProperties.value.getProperty("version") | ||
|
||
(Compile / scalacOptions) ++= Seq( | ||
"-sourcepath", (Compile / sourceDirectories).value.map(_.getAbsolutePath).distinct.mkString(java.io.File.pathSeparator), | ||
) |
6 changes: 6 additions & 0 deletions
6
tests/cmdTest-sbt-tests/sourcepath-with-inline/changes/zz.original.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package a | ||
|
||
object Foo: // note that `Foo` is defined in `zz.scala` | ||
class Local | ||
inline def foo(using Local): Nothing = | ||
??? |
7 changes: 7 additions & 0 deletions
7
tests/cmdTest-sbt-tests/sourcepath-with-inline/changes/zz1.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package a | ||
|
||
object Foo: // note that `Foo` is defined in `zz.scala` | ||
class Local | ||
inline def foo(using Local): Nothing = | ||
??? | ||
??? |
1 change: 1 addition & 0 deletions
1
tests/cmdTest-sbt-tests/sourcepath-with-inline/project/build.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.5.5 |
5 changes: 5 additions & 0 deletions
5
tests/cmdTest-sbt-tests/sourcepath-with-inline/src/main/scala/a/Bar.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package a | ||
|
||
object Bar: | ||
given Foo.Local() | ||
def Bar = Foo.foo |
7 changes: 7 additions & 0 deletions
7
tests/cmdTest-sbt-tests/sourcepath-with-inline/src/main/scala/a/zz.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package a | ||
|
||
object Foo: // note that `Foo` is defined in `zz.scala` | ||
class Local | ||
inline def foo(using Local): Nothing = | ||
??? | ||
??? |