This repository has been archived by the owner on May 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
48 lines (40 loc) · 1.61 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import org.apache.commons.io.FileUtils
ThisBuild / scalaVersion := "2.12.10"
ThisBuild / version := "0.1.9-SNAPSHOT"
ThisBuild / organization := "lambda"
ThisBuild / organizationName := "Lambdacademy"
githubOwner := "lambdacademy-dev"
resolvers += Resolver.githubPackages("lambdacademy-dev")
githubRepository := "course-library"
lazy val root = (project in file("."))
.settings(
name := "course-library",
libraryDependencies ++= Seq(
"lambda" %% "course-dsl" % "0.2.8",
"org.scalatest" %% "scalatest" % "3.0.8" % Test
),
scalacOptions ~= { _.filterNot(Set("-Xlint:missing-interpolator")) },
compile in Compile := (compile in Compile).dependsOn(bundleExamples).value,
githubTokenSource := TokenSource.GitConfig("github.token") || TokenSource.Environment("GITHUB_TOKEN")
)
lazy val scalaCodeExamples = (project in file("scala-code-examples"))
.settings(
libraryDependencies ++= Seq(
"lambda" %% "scala-utils" % "0.2.3",
"org.scalatest" %% "scalatest" % "3.0.8" % Test
),
githubTokenSource := TokenSource.GitConfig("github.token") || TokenSource.Environment("GITHUB_TOKEN")
)
lazy val bundleExamples = TaskKey[Unit]("bundleExamples", "Copies examples in the resources folder")
ThisBuild / bundleExamples := {
val log = streams.value.log
val resources = resourceDirectory.in(root).in(Compile).value
val examplesFolders = List(
scalaSource.in(scalaCodeExamples).in(Compile).value / "lambda"
)
FileUtils.deleteQuietly(resources / "examples")
examplesFolders.foreach(f => {
FileUtils.copyDirectory(f, resources)
log.info(s"Copied $f to $resources")
})
}