mirror of https://github.com/sbt/sbt.git
enable some scripted tests
This commit is contained in:
parent
9713b7c112
commit
a62ee86b2b
|
|
@ -150,7 +150,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
# ./sbt -v "repoOverrideTest:scripted dependency-management/*"
|
# ./sbt -v "repoOverrideTest:scripted dependency-management/*"
|
||||||
./sbt -v "scripted source-dependencies/*"
|
./sbt -v "scripted source-dependencies/*"
|
||||||
# ./sbt -v "scripted project/*"
|
./sbt -v "scripted project/*"
|
||||||
- name: Build and test (5)
|
- name: Build and test (5)
|
||||||
if: ${{ matrix.jobtype == 5 }}
|
if: ${{ matrix.jobtype == 5 }}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
|
|
||||||
|
name := "clean-symlinks-test"
|
||||||
|
|
||||||
|
scalaVersion := "3.7.3"
|
||||||
|
|
||||||
TaskKey[Unit]("createSymlinkedDirectory") := {
|
TaskKey[Unit]("createSymlinkedDirectory") := {
|
||||||
|
IO.createDirectory(target.value)
|
||||||
Files.createSymbolicLink(target.value.toPath / "foo", baseDirectory.value.toPath / "foo")
|
Files.createSymbolicLink(target.value.toPath / "foo", baseDirectory.value.toPath / "foo")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
> createSymlinkedDirectory
|
|
||||||
|
|
||||||
$ exists target/foo/bar
|
|
||||||
$ exists foo/bar
|
|
||||||
|
|
||||||
> clean
|
|
||||||
|
|
||||||
$ absent target/foo
|
|
||||||
$ exists foo/bar
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
> createSymlinkedDirectory
|
||||||
|
|
||||||
|
$ exists target/out/jvm/scala-3.7.3/clean-symlinks-test/foo/bar
|
||||||
|
$ exists foo/bar
|
||||||
|
|
||||||
|
> clean
|
||||||
|
|
||||||
|
$ absent target/out/jvm/scala-3.7.3/clean-symlinks-test/foo
|
||||||
|
$ exists foo/bar
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import java.nio.file.{ Path, Paths }
|
import java.nio.file.{ Path, Paths }
|
||||||
|
import sbt.internal.FileChangesMacro.inputFiles
|
||||||
|
|
||||||
val foo = taskKey[Seq[Path]]("Copy files")
|
val foo = taskKey[Seq[Path]]("Copy files")
|
||||||
foo / fileInputs += baseDirectory.value.toGlob / "base" / "*.txt"
|
foo / fileInputs += baseDirectory.value.toGlob / "base" / "*.txt"
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
scalaVersion := "2.12.20"
|
||||||
val generateSourceFile = taskKey[Unit]("generate source file")
|
val generateSourceFile = taskKey[Unit]("generate source file")
|
||||||
generateSourceFile := {
|
generateSourceFile := {
|
||||||
val testDir = ((Test / scalaSource).value.toPath / "Foo.scala").toString
|
val testDir = ((Test / scalaSource).value.toPath / "Foo.scala").toString
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import sbt.internal.FileChangesMacro.inputFiles
|
||||||
// The project contains two files: { Foo.txt, Bar.md } in the subdirector base/subdir/nested-subdir
|
// The project contains two files: { Foo.txt, Bar.md } in the subdirector base/subdir/nested-subdir
|
||||||
|
|
||||||
// Check that we can correctly extract Foo.txt with a recursive source
|
// Check that we can correctly extract Foo.txt with a recursive source
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
import java.nio.file.{ Files, Path }
|
import java.nio.file.{ Files, Path }
|
||||||
|
import sbt.internal.FileChangesMacro.inputFiles
|
||||||
|
import sbt.internal.FileChangesMacro.outputFiles
|
||||||
|
|
||||||
val copyPaths = taskKey[Seq[Path]]("Copy paths")
|
val copyPaths = taskKey[Seq[Path]]("Copy paths")
|
||||||
copyPaths / fileInputs += baseDirectory.value.toGlob / "inputs" / *
|
copyPaths / fileInputs += baseDirectory.value.toGlob / "inputs" / *
|
||||||
|
|
@ -25,7 +27,7 @@ newFilter := HiddenFileFilter.toNio || "**/bar.txt"
|
||||||
val fooFilter = settingKey[PathFilter]("A filter for the bar.txt file")
|
val fooFilter = settingKey[PathFilter]("A filter for the bar.txt file")
|
||||||
fooFilter := ** / ".foo.txt"
|
fooFilter := ** / ".foo.txt"
|
||||||
|
|
||||||
Global / onLoad := { s: State =>
|
Global / onLoad := { (s: State) =>
|
||||||
if (scala.util.Properties.isWin) {
|
if (scala.util.Properties.isWin) {
|
||||||
val path = s.baseDir.toPath / "inputs" / ".foo.txt"
|
val path = s.baseDir.toPath / "inputs" / ".foo.txt"
|
||||||
Files.setAttribute(path, "dos:hidden", true)
|
Files.setAttribute(path, "dos:hidden", true)
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,11 @@ object Build {
|
||||||
val cached = settingKey[Unit]("")
|
val cached = settingKey[Unit]("")
|
||||||
val newInputs = settingKey[Unit]("")
|
val newInputs = settingKey[Unit]("")
|
||||||
|
|
||||||
|
@transient
|
||||||
val checkCompile = taskKey[Unit]("check compile inputs")
|
val checkCompile = taskKey[Unit]("check compile inputs")
|
||||||
|
@transient
|
||||||
val checkRun = taskKey[Unit]("check runtime inputs")
|
val checkRun = taskKey[Unit]("check runtime inputs")
|
||||||
|
@transient
|
||||||
val checkTest = taskKey[Unit]("check test inputs")
|
val checkTest = taskKey[Unit]("check test inputs")
|
||||||
|
|
||||||
val root = (project in file(".")).settings(
|
val root = (project in file(".")).settings(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue