forked from lastland/scala-forklift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
100 lines (88 loc) · 3.88 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
val repoKind = SettingKey[String]("repo-kind",
"Maven repository kind (\"snapshots\" or \"releases\")")
lazy val slickVersion = "3.3.2"
lazy val scala212 = "2.12.11"
lazy val scala213 = "2.13.1"
lazy val supportedScalaVersions = List(scala212, scala213)
lazy val coreDependencies = libraryDependencies ++= List(
"org.scala-lang" % "scala-compiler" % scalaVersion.value,
"com.typesafe" % "config" % "1.3.2",
"org.eclipse.jgit" % "org.eclipse.jgit" % "4.0.1.201506240215-r"
)
lazy val slickDependencies = List(
"com.typesafe.slick" %% "slick" % slickVersion,
"com.typesafe.slick" %% "slick-codegen" % slickVersion,
"io.github.nafg" %% "slick-migration-api" % "0.7.0",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.0.0"
)
lazy val slickDependenciesWithTests = slickDependencies ++ List(
"org.scalatest" %% "scalatest" % "3.1.0",
"com.lihaoyi" %% "ammonite-ops" % "2.0.4",
"commons-io" % "commons-io" % "2.6",
"com.typesafe.slick" %% "slick-hikaricp" % slickVersion,
"com.h2database" % "h2" % "1.4.200",
"org.xerial" % "sqlite-jdbc" % "3.8.11.2",// 3.30.1 crashes SQLiteCommandTests
"mysql" % "mysql-connector-java" % "5.1.38",
"org.postgresql" % "postgresql" % "42.2.9",
"org.hsqldb" % "hsqldb" % "2.5.0",
"org.apache.derby" % "derby" % "10.14.2.0",
"ch.qos.logback" % "logback-classic" % "1.2.3"
).map(_ % "test")
lazy val commonSettings = Seq(
organization := "com.liyaos",
licenses := Seq("Apache 2.0" ->
url("https://github.com/lastland/scala-forklift/blob/master/LICENSE")),
homepage := Some(url("https://github.com/lastland/scala-forklift")),
scalaVersion := scala213,
scalacOptions += "-deprecation",
scalacOptions += "-feature",
resolvers += Resolver.jcenterRepo,
publishMavenStyle := true,
publishArtifact in Test := false,
repoKind := { if (version.value.trim.endsWith("SNAPSHOT")) "snapshots"
else "releases" },
publishTo := { repoKind.value match {
case "snapshots" => Some("snapshots" at
"https://oss.sonatype.org/content/repositories/snapshots")
case "releases" => Some("releases" at
"https://oss.sonatype.org/service/local/staging/deploy/maven2")
}},
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"),
pomExtra := (
<scm>
<url>[email protected]:lastland/scala-forklift.git</url>
<connection>scm:git:[email protected]:lastland/scala-forklift.git</connection>
</scm>
<developers>
<developer>
<id>lastland</id>
<name>Yao Li</name>
</developer>
</developers>))
// Derby is running is secured mode since version 10.12.1.1, so security manager must be disabled for tests
// https://stackoverflow.com/questions/48008343/sbt-test-does-not-work-for-spark-test
// https://issues.apache.org/jira/browse/DERBY-6648
Test / testOptions += Tests.Setup(() => System.setSecurityManager(null))
lazy val root = Project(
"scala-forklift", file(".")).settings(
crossScalaVersions := Nil,
publishArtifact := false).aggregate(
coreProject, slickMigrationProject, plainMigrationProject, gitToolProject)
lazy val coreProject = Project(
"scala-forklift-core", file("core")).settings(
commonSettings:_*).settings {Seq(
crossScalaVersions := supportedScalaVersions,
coreDependencies
)}
lazy val slickMigrationProject = Project(
"scala-forklift-slick", file("migrations/slick")).dependsOn(
coreProject).settings(commonSettings:_*).settings { Seq(
crossScalaVersions := supportedScalaVersions,
libraryDependencies ++= slickDependenciesWithTests
)}
lazy val plainMigrationProject = Project(
"scala-forklift-plain", file("migrations/plain")).dependsOn(
coreProject).settings(commonSettings:_*).settings(crossScalaVersions := supportedScalaVersions)
lazy val gitToolProject = Project(
"scala-forklift-git-tools", file("tools/git")).dependsOn(
coreProject).settings(commonSettings:_*).settings(crossScalaVersions := supportedScalaVersions)