enable some scripted tests

This commit is contained in:
xuwei-k 2025-09-24 07:12:40 +09:00
parent 9713b7c112
commit a62ee86b2b
15 changed files with 24 additions and 11 deletions

View File

@ -150,7 +150,7 @@ jobs:
run: |
# ./sbt -v "repoOverrideTest:scripted dependency-management/*"
./sbt -v "scripted source-dependencies/*"
# ./sbt -v "scripted project/*"
./sbt -v "scripted project/*"
- name: Build and test (5)
if: ${{ matrix.jobtype == 5 }}
shell: bash

View File

@ -1,5 +1,10 @@
import java.nio.file.Files
name := "clean-symlinks-test"
scalaVersion := "3.7.3"
TaskKey[Unit]("createSymlinkedDirectory") := {
IO.createDirectory(target.value)
Files.createSymbolicLink(target.value.toPath / "foo", baseDirectory.value.toPath / "foo")
}

View File

@ -1,9 +0,0 @@
> createSymlinkedDirectory
$ exists target/foo/bar
$ exists foo/bar
> clean
$ absent target/foo
$ exists foo/bar

View File

@ -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

View File

@ -1,4 +1,5 @@
import java.nio.file.{ Path, Paths }
import sbt.internal.FileChangesMacro.inputFiles
val foo = taskKey[Seq[Path]]("Copy files")
foo / fileInputs += baseDirectory.value.toGlob / "base" / "*.txt"

View File

@ -1,3 +1,4 @@
scalaVersion := "2.12.20"
val generateSourceFile = taskKey[Unit]("generate source file")
generateSourceFile := {
val testDir = ((Test / scalaSource).value.toPath / "Foo.scala").toString

View File

@ -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
// Check that we can correctly extract Foo.txt with a recursive source

View File

@ -1,4 +1,6 @@
import java.nio.file.{ Files, Path }
import sbt.internal.FileChangesMacro.inputFiles
import sbt.internal.FileChangesMacro.outputFiles
val copyPaths = taskKey[Seq[Path]]("Copy paths")
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")
fooFilter := ** / ".foo.txt"
Global / onLoad := { s: State =>
Global / onLoad := { (s: State) =>
if (scala.util.Properties.isWin) {
val path = s.baseDir.toPath / "inputs" / ".foo.txt"
Files.setAttribute(path, "dos:hidden", true)

View File

@ -12,8 +12,11 @@ object Build {
val cached = settingKey[Unit]("")
val newInputs = settingKey[Unit]("")
@transient
val checkCompile = taskKey[Unit]("check compile inputs")
@transient
val checkRun = taskKey[Unit]("check runtime inputs")
@transient
val checkTest = taskKey[Unit]("check test inputs")
val root = (project in file(".")).settings(