mirror of https://github.com/sbt/sbt.git
Add scripted scala3-scala-home
This commit is contained in:
parent
ccb63e9eaa
commit
3d863a59f8
|
|
@ -0,0 +1,9 @@
|
|||
scalaVersion := "3.0.0-M2"
|
||||
|
||||
val makeHome = taskKey[Unit]("Populates the 'home/lib' directory with Scala jars from the default ScalaInstance")
|
||||
|
||||
makeHome := {
|
||||
val lib = baseDirectory.value / "home" / "lib"
|
||||
for(jar <- scalaInstance.value.allJars)
|
||||
IO.copyFile(jar, lib / jar.getName)
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
scalaVersion := "3.0.0-M2"
|
||||
scalaHome := Some(baseDirectory.value / "home")
|
||||
|
||||
val checkUpdate = taskKey[Unit]("Ensures that resolved Scala artifacts are replaced with ones from the configured Scala home directory")
|
||||
|
||||
checkUpdate := {
|
||||
val report = update.value
|
||||
val lib = (scalaHome.value.get / "lib").getCanonicalFile
|
||||
for(f <- report.allFiles)
|
||||
assert(f.getParentFile == lib, "Artifact not in Scala home directory: " + f.getAbsolutePath)
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
> makeHome
|
||||
$ copy-file changes/real-build.sbt build.sbt
|
||||
> reload
|
||||
> checkUpdate
|
||||
Loading…
Reference in New Issue