-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 f4d8965
Showing
11 changed files
with
90 additions
and
9 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
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,17 @@ | ||
import java.util.Properties | ||
|
||
val prepareSources = taskKey[Unit]("Copy changes to the src directory") | ||
val copyChanges = taskKey[Unit]("Copy changes to the src directory") | ||
|
||
val srcDir = settingKey[File]("The directory to copy changes to") | ||
val changesDir = settingKey[File]("The directory to copy changes from") | ||
|
||
srcDir := (ThisBuild / baseDirectory).value / "src" / "main" / "scala" | ||
changesDir := (ThisBuild / baseDirectory).value / "changes" | ||
|
||
prepareSources := IO.copyFile(changesDir.value / "zz.original.scala", srcDir.value / "a" / "zz.scala") | ||
copyChanges := IO.copyFile(changesDir.value / "zz.new.scala", srcDir.value / "a" / "zz.scala") | ||
|
||
(Compile / scalacOptions) ++= Seq( | ||
"-sourcepath", (Compile / sourceDirectories).value.map(_.getAbsolutePath).distinct.mkString(java.io.File.pathSeparator), | ||
) |
7 changes: 7 additions & 0 deletions
7
tests/cmdTest-sbt-tests/sourcepath-with-inline/changes/zz.new.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 = | ||
??? | ||
??? |
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 = | ||
??? |
27 changes: 27 additions & 0 deletions
27
tests/cmdTest-sbt-tests/sourcepath-with-inline/project/DottyInjectedPlugin.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,27 @@ | ||
import sbt._ | ||
import Keys._ | ||
|
||
import java.util.Properties | ||
import java.io.File | ||
|
||
object DottyInjectedPlugin extends AutoPlugin { | ||
override def requires = plugins.JvmPlugin | ||
override def trigger = allRequirements | ||
|
||
private val packProperties = settingKey[Properties]("The properties of the dist/pack command") | ||
|
||
override val projectSettings = Seq( | ||
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 | ||
}, | ||
scalaVersion := packProperties.value.getProperty("version") | ||
) | ||
} |
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 |