mirror of https://github.com/sbt/sbt.git
[2.x] test: Move back the project scripted tests (#8660)
**Problem** "project" scripted tests are commented out into "project1" directory. **Solution** This brings them back, while some remain pending.
This commit is contained in:
parent
1ad6b88742
commit
9388c140fa
|
|
@ -162,12 +162,12 @@ jobs:
|
|||
run: |
|
||||
# ./sbt -v "repoOverrideTest:scripted dependency-management/*"
|
||||
./sbt -v "scripted source-dependencies/*"
|
||||
./sbt -v "scripted project/*"
|
||||
- name: Build and test (5)
|
||||
if: ${{ matrix.jobtype == 5 }}
|
||||
shell: bash
|
||||
run: |
|
||||
./sbt -v --client test
|
||||
./sbt -v "scripted project/*"
|
||||
./sbt -v "scripted project1/*"
|
||||
# - name: Build and test (6)
|
||||
# if: ${{ matrix.jobtype == 6 }}
|
||||
# shell: bash
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
scalaVersion := "3.8.1"
|
||||
crossPaths := false
|
||||
|
||||
name := "definition-lib-forname-test"
|
||||
|
||||
version := "1.0"
|
||||
version := "1.0"
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
> package
|
||||
|
||||
$ delete build.sbt
|
||||
$ copy-file target/definition-lib-forname-test-1.0.jar project/lib/test.jar
|
||||
$ copy-file target/out/jvm/u/definition-lib-forname-test/definition-lib-forname-test-1.0.jar project/lib/test.jar
|
||||
$ copy-file changes/build2.sbt build.sbt
|
||||
|
||||
# the copied project definition depends on the Test module in test.jar and will
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
> compile
|
||||
$ exists target/**/classes/A.class
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
val root = (project in file("."))
|
||||
|
||||
TaskKey[Unit]("checkScalaVersion", "test") := {
|
||||
TaskKey[Unit]("checkScalaVersion", "test") := Def.uncached {
|
||||
val sv = scalaVersion.value
|
||||
assert(sv startsWith "3.", s"Found $sv!")
|
||||
}
|
||||
|
||||
TaskKey[Unit]("checkArtifacts", "test") := {
|
||||
TaskKey[Unit]("checkArtifacts", "test") := Def.uncached {
|
||||
val arts = packagedArtifacts.value
|
||||
assert(arts.nonEmpty, "Packaged artifacts must not be empty!")
|
||||
}
|
||||
|
|
@ -10,8 +10,8 @@ lazy val x = now + 1
|
|||
val n = "Demo"
|
||||
val descr = "Description"
|
||||
|
||||
name := n
|
||||
LocalRootProject / name := n
|
||||
|
||||
version := v
|
||||
LocalRootProject / version := v
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
LocalRootProject / description := descr
|
||||
|
|
@ -1,13 +1,30 @@
|
|||
lazy val explicit = "explicit"
|
||||
|
||||
@transient
|
||||
lazy val check = taskKey[Unit]("check")
|
||||
|
||||
@transient
|
||||
lazy val checkEvery = taskKey[Unit]("check every")
|
||||
|
||||
@transient
|
||||
lazy val customA = taskKey[String]("custom A")
|
||||
|
||||
@transient
|
||||
lazy val customB = taskKey[String]("custom B")
|
||||
|
||||
@transient
|
||||
lazy val customC = taskKey[String]("custom C")
|
||||
|
||||
@transient
|
||||
lazy val customD = taskKey[String]("custom D")
|
||||
|
||||
@transient
|
||||
lazy val customE = taskKey[String]("custom E")
|
||||
|
||||
@transient
|
||||
lazy val globalDepE = taskKey[String]("globally defined dependency of E")
|
||||
|
||||
@transient
|
||||
lazy val projectDepE = taskKey[String]("per-project dependency of E")
|
||||
|
||||
(Global / organization) := "org.example"
|
||||
|
|
@ -10,14 +10,17 @@ lazy val root = (project in file("."))
|
|||
unmanagedSources / includeFilter := "*.java" | "*.scala"
|
||||
)
|
||||
|
||||
def forConfig(conf: Configuration, name: String) = inConfig(conf)( unpackageSettings(name) )
|
||||
def forConfig(conf: Configuration, name: String) =
|
||||
inConfig(conf)( unpackageSettings(name) )
|
||||
|
||||
def unpackageSettings(name: String) = Seq(
|
||||
unmanagedSourceDirectories := (baseDirectory.value / name) :: Nil,
|
||||
unmanagedResources / excludeFilter := (unmanagedSources / includeFilter).value,
|
||||
unmanagedResourceDirectories := unmanagedSourceDirectories.value,
|
||||
unpackage := {
|
||||
IO.unzip((packageSrc / artifactPath).value, baseDirectory.value / name)
|
||||
unpackage := Def.uncached {
|
||||
val conv = fileConverter.value
|
||||
IO.unzip(conv.toPath((packageSrc / artifactPath).value).toFile(),
|
||||
baseDirectory.value / name)
|
||||
IO.delete(baseDirectory.value / name / "META-INF")
|
||||
}
|
||||
)
|
||||
|
|
@ -6,11 +6,11 @@ val commonSettings = Seq(
|
|||
version := "0.1.0",
|
||||
ivyPaths := IvyPaths(
|
||||
(LocalRootProject / baseDirectory).value.toString,
|
||||
Some(((LocalRootProject / target).value / "ivy-cache").toString)
|
||||
Some(((LocalRootProject / baseDirectory).value / "ivy-cache").toString)
|
||||
)
|
||||
)
|
||||
|
||||
lazy val app = (project in file("app")).settings(commonSettings: _*)
|
||||
lazy val app = (project in file("app")).settings(commonSettings*)
|
||||
|
||||
name := "generated-root-no-publish"
|
||||
LocalRootProject / name := "generated-root-no-publish"
|
||||
commonSettings
|
||||
|
|
@ -5,5 +5,6 @@ organization := "com.example"
|
|||
version := "0.1.0"
|
||||
ivyPaths := IvyPaths(
|
||||
(LocalRootProject / baseDirectory).value.toString,
|
||||
Some(((LocalRootProject / target).value / "ivy-cache").toString)
|
||||
Some(((LocalRootProject / baseDirectory).value / "ivy-cache").toString)
|
||||
)
|
||||
LocalRootProject / name := "generated-root-no-publish"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue