Skip to content

Commit f4909f4

Browse files
committed
feat: extract dependencies definition for the generated project to an isolated file*
*This allows to ensure test dependencies are only available in tests without having to repeat the `% Test` modifier reducing human error margin *This also allows to have more complex dependencies definitions, specially interesting for multi-project SBT setups
1 parent 06cfd25 commit f4909f4

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
lazy val root = (project in file("."))
22
.settings(
33
name := "Codely Scala Basic Skeleton",
4-
version := "1.5.0",
4+
version := "1.6.0",
55

66
organization := "com.codely",
77
organizationName := "Codely Enseña y Entretiene SL",

src/main/g8/build.sbt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
Settings.settings
22

3-
/** ********* PROD DEPENDENCIES *****************/
4-
libraryDependencies ++= Seq(
5-
"com.github.nscala-time" %% "nscala-time" % "$nscala-time_version$",
6-
"com.lihaoyi" %% "pprint" % "$pprint_version$"
7-
)
3+
libraryDependencies := Dependencies.all
84

9-
/** ********* TEST DEPENDENCIES *****************/
10-
libraryDependencies ++= Seq(
11-
"org.scalatest" %% "scalatest" % "$scalatest_version$" % Test,
12-
"org.scalamock" %% "scalamock" % "$scalamock_version$" % Test
13-
)
145

156
/** ********* COMMANDS ALIASES ******************/
167
addCommandAlias("t", "test")
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import sbt._
2+
3+
object Dependencies {
4+
private val prod = Seq(
5+
"com.github.nscala-time" %% "nscala-time" % "$nscala-time_version$",
6+
"com.lihaoyi" %% "pprint" % "$pprint_version$"
7+
)
8+
9+
private val test = Seq(
10+
"org.scalatest" %% "scalatest" % "$scalatest_version$",
11+
"org.scalamock" %% "scalamock" % "$scalamock_version$"
12+
).map(_ % Test)
13+
14+
val all = prod ++ test
15+
}

0 commit comments

Comments
 (0)