-
Notifications
You must be signed in to change notification settings - Fork 142
/
Build.scala
165 lines (152 loc) · 7.2 KB
/
Build.scala
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import sbt._
import Keys._
import play.twirl.sbt.Import.TwirlKeys
object ApplicationBuild extends Build {
val appName = "play2-auth"
val playVersion = play.core.PlayVersion.current
lazy val baseSettings = Seq(
version := "0.14.1",
scalaVersion := "2.11.6",
crossScalaVersions := Seq("2.10.5", "2.11.6"),
organization := "jp.t2v",
resolvers ++=
Resolver.typesafeRepo("releases") ::
Resolver.sonatypeRepo("releases") ::
Nil,
scalacOptions ++= Seq("-language:_", "-deprecation")
)
lazy val appPublishMavenStyle = true
lazy val appPublishArtifactInTest = false
lazy val appPomIncludeRepository = { _: MavenRepository => false }
lazy val appPublishTo = { (v: String) =>
val nexus = "https://oss.sonatype.org/"
if (v.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
lazy val appPomExtra = {
<url>https://github.com/t2v/play2-auth</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:t2v/play2-auth.git</url>
<connection>scm:git:[email protected]:t2v/play2-auth.git</connection>
</scm>
<developers>
<developer>
<id>gakuzzzz</id>
<name>gakuzzzz</name>
<url>https://github.com/gakuzzzz</url>
</developer>
</developers>
}
lazy val core = Project("core", base = file("module"))
.settings(
baseSettings,
libraryDependencies += "com.typesafe.play" %% "play" % playVersion % "provided",
libraryDependencies += "com.typesafe.play" %% "play-cache" % playVersion % "provided",
libraryDependencies += "jp.t2v" %% "stackable-controller" % "0.5.0",
name := appName,
publishMavenStyle := appPublishMavenStyle,
publishArtifact in Test := appPublishArtifactInTest,
pomIncludeRepository := appPomIncludeRepository,
publishTo <<=(version)(appPublishTo),
pomExtra := appPomExtra
)
lazy val test = Project("test", base = file("test"))
.settings(
baseSettings,
libraryDependencies += "com.typesafe.play" %% "play-test" % playVersion,
name := appName + "-test",
publishMavenStyle := appPublishMavenStyle,
publishArtifact in Test := appPublishArtifactInTest,
pomIncludeRepository := appPomIncludeRepository,
publishTo <<=(version)(appPublishTo),
pomExtra := appPomExtra
).dependsOn(core)
lazy val sample = Project("sample", file("sample"))
.enablePlugins(play.sbt.PlayScala)
.settings(
baseSettings,
resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases",
libraryDependencies += play.sbt.Play.autoImport.cache,
libraryDependencies += play.sbt.Play.autoImport.specs2 % Test,
libraryDependencies += play.sbt.Play.autoImport.jdbc,
libraryDependencies += "org.mindrot" % "jbcrypt" % "0.3m",
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc" % "2.2.7",
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc-config" % "2.2.7",
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc-syntax-support-macro" % "2.2.7",
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc-test" % "2.2.7" % "test",
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc-play-initializer" % "2.4.0",
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc-play-dbapi-adapter" % "2.4.0",
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc-play-fixture" % "2.4.0",
libraryDependencies += "org.flywaydb" %% "flyway-play" % "2.0.1",
TwirlKeys.templateImports in Compile ++= Seq(
"jp.t2v.lab.play2.auth.sample._",
"play.api.data.Form",
"play.api.mvc.Flash",
"views._",
"views.html.helper",
"controllers._"
),
publish := { },
publishArtifact := false,
packagedArtifacts := Map.empty,
publishTo <<=(version)(appPublishTo),
pomExtra := appPomExtra
)
.dependsOn(core, test % "test")
lazy val social = Project (id = "social", base = file ("social"))
.settings(
baseSettings,
name := appName + "-social",
libraryDependencies += "com.typesafe.play" %% "play" % playVersion % "provided",
libraryDependencies += "com.typesafe.play" %% "play-ws" % playVersion % "provided",
publishMavenStyle := appPublishMavenStyle,
publishArtifact in Test := appPublishArtifactInTest,
pomIncludeRepository := appPomIncludeRepository,
publishTo <<=(version)(appPublishTo),
pomExtra := appPomExtra
).dependsOn(core)
lazy val socialSample = Project("social-sample", file("social-sample"))
.enablePlugins(play.sbt.PlayScala)
.settings(
baseSettings,
name := appName + "-social-sample",
resourceDirectories in Test += baseDirectory.value / "conf",
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
libraryDependencies ++= Seq(
"com.typesafe.play" %% "play-ws" % playVersion,
"com.typesafe.play" %% "play-cache" % playVersion,
"org.flywaydb" %% "flyway-play" % "2.0.1",
"org.scalikejdbc" %% "scalikejdbc" % "2.2.7",
"org.scalikejdbc" %% "scalikejdbc-config" % "2.2.7",
"org.scalikejdbc" %% "scalikejdbc-syntax-support-macro" % "2.2.7",
"org.scalikejdbc" %% "scalikejdbc-test" % "2.2.7" % "test",
"org.scalikejdbc" %% "scalikejdbc-play-initializer" % "2.4.0",
"org.scalikejdbc" %% "scalikejdbc-play-dbapi-adapter" % "2.4.0",
"org.scalikejdbc" %% "scalikejdbc-play-fixture" % "2.4.0"
),
publish := { },
publishArtifact := false,
packagedArtifacts := Map.empty,
publishTo <<=(version)(appPublishTo),
pomExtra := appPomExtra
)
.dependsOn(core, social)
lazy val root = Project("root", base = file("."))
.settings(baseSettings)
.settings(
publish := { },
publishArtifact := false,
packagedArtifacts := Map.empty,
publishTo <<=(version)(appPublishTo),
pomExtra := appPomExtra
).aggregate(core, test, sample, social, socialSample)
}