Skip to content

Commit be9ccbb

Browse files
committed
feat: extract aliases definition for the generated project to an isolated file
1 parent f4909f4 commit be9ccbb

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
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.6.0",
4+
version := "1.7.0",
55

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

src/main/g8/build.sbt

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,6 @@ Settings.settings
22

33
libraryDependencies := Dependencies.all
44

5-
6-
/** ********* COMMANDS ALIASES ******************/
7-
addCommandAlias("t", "test")
8-
addCommandAlias("to", "testOnly")
9-
addCommandAlias("tq", "testQuick")
10-
addCommandAlias("tsf", "testShowFailed")
11-
12-
addCommandAlias("c", "compile")
13-
addCommandAlias("tc", "Test / compile")
14-
15-
addCommandAlias("f", "scalafmt") // Format production files according to ScalaFmt
16-
addCommandAlias("fc", "scalafmtCheck") // Check if production files are formatted according to ScalaFmt
17-
addCommandAlias("tf", "Test / scalafmt") // Format test files according to ScalaFmt
18-
addCommandAlias("tfc", "Test / scalafmtCheck") // Check if test files are formatted according to ScalaFmt
19-
20-
// All the needed tasks before pushing to the repository (compile, compile test, format check in prod and test)
21-
addCommandAlias("prep", ";c;tc;fc;tfc")
5+
SbtAliases.aliases.flatMap { case (alias, command) =>
6+
addCommandAlias(alias, command)
7+
}

src/main/g8/project/SbtAliases.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
object SbtAliases {
2+
val aliases: Seq[(String, String)] = Seq(
3+
"t" -> "test",
4+
"to" -> "testOnly",
5+
"tq" -> "testQuick",
6+
"tsf" -> "testShowFailed",
7+
"c" -> "compile",
8+
"tc" -> "Test / compile",
9+
"f" -> "scalafmt", // Format production files according to ScalaFmt
10+
"fc" -> "scalafmtCheck", // Check if production files are formatted according to ScalaFmt
11+
"tf" -> "Test / scalafmt", // Format test files according to ScalaFmt
12+
"tfc" -> "Test / scalafmtCheck", // Check if test files are formatted according to ScalaFmt
13+
"prep" -> ";c;tc;fc;tfc" // All the needed tasks before pushing to the repository (compile, compile test, format check in prod and test)
14+
)
15+
}

0 commit comments

Comments
 (0)