forked from t2v/play2-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
201 lines (189 loc) · 8.33 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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
import sbt._
import Keys._
import play.routes.compiler.InjectedRoutesGenerator
import play.sbt.routes.RoutesKeys.routesGenerator
import play.twirl.sbt.Import.TwirlKeys
val appName = "play2-auth"
val playVersion = play.core.PlayVersion.current
val Scala211 = "2.11.12"
val Scala212 = "2.12.8"
lazy val baseSettings = Seq(
version := "0.16.0-SNAPSHOT",
scalaVersion := Scala211,
crossScalaVersions := Seq(Scala211, Scala212),
organization := "jp.t2v",
resolvers ++= Seq(
Resolver.typesafeRepo("releases"),
Resolver.sonatypeRepo("releases"),
"Opt-Technologies Snapshots" at "https://raw.githubusercontent.com/opt-tech/maven-repository/master/snapshots"
),
scalacOptions ++= Seq("-language:_", "-deprecation")
)
lazy val appPublishMavenStyle = true
lazy val appPublishArtifactInTest = false
lazy val appPomIncludeRepository = { _: MavenRepository => false }
lazy val appPomExtra = {
<url>https://github.com/t2v/play2-auth</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>git@github.com:t2v/play2-auth.git</url>
<connection>scm:git:git@github.com: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.in(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.7.0-SNAPSHOT",
name := appName,
publishMavenStyle := appPublishMavenStyle,
publishArtifact in Test := appPublishArtifactInTest,
pomIncludeRepository := appPomIncludeRepository,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
pomExtra := appPomExtra
)
lazy val test = project.in(file("test"))
.settings(
baseSettings,
libraryDependencies += "com.typesafe.play" %% "play-test" % playVersion,
name := appName + "-test",
publishMavenStyle := appPublishMavenStyle,
publishArtifact in Test := appPublishArtifactInTest,
pomIncludeRepository := appPomIncludeRepository,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
pomExtra := appPomExtra
).dependsOn(core)
lazy val sample = project.in(file("sample"))
.enablePlugins(play.sbt.PlayScala)
.settings(
baseSettings,
resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases",
libraryDependencies += play.sbt.Play.autoImport.guice,
libraryDependencies += play.sbt.Play.autoImport.cache,
libraryDependencies += play.sbt.Play.autoImport.specs2 % Test,
libraryDependencies += play.sbt.Play.autoImport.jdbc,
libraryDependencies += "com.h2database" % "h2" % "1.4.193",
libraryDependencies += "org.mindrot" % "jbcrypt" % "0.3m",
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc" % "3.2.0",
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc-config" % "3.2.0",
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc-syntax-support-macro" % "3.2.0",
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc-test" % "3.2.0" % "test",
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc-play-initializer" % "2.6.0-scalikejdbc-3.2",
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc-play-dbapi-adapter" % "2.6.0-scalikejdbc-3.2",
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc-play-fixture" % "2.6.0-scalikejdbc-3.2",
libraryDependencies += "org.flywaydb" %% "flyway-play" % "5.0.0",
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 := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
pomExtra := appPomExtra,
routesGenerator := InjectedRoutesGenerator
)
.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",
libraryDependencies += "com.typesafe.play" %% "play-cache" % playVersion % "provided",
libraryDependencies += "com.typesafe.play" %% "play-ahc-ws-standalone" % "1.1.9",
publishMavenStyle := appPublishMavenStyle,
publishArtifact in Test := appPublishArtifactInTest,
pomIncludeRepository := appPomIncludeRepository,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
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" % "5.0.0",
"org.scalikejdbc" %% "scalikejdbc" % "3.2.0",
"org.scalikejdbc" %% "scalikejdbc-config" % "3.2.0",
"org.scalikejdbc" %% "scalikejdbc-syntax-support-macro" % "3.2.0",
"org.scalikejdbc" %% "scalikejdbc-test" % "3.2.0" % "test",
"org.scalikejdbc" %% "scalikejdbc-play-initializer" % "2.6.0-scalikejdbc-3.2",
"org.scalikejdbc" %% "scalikejdbc-play-dbapi-adapter" % "2.6.0-scalikejdbc-3.2",
"org.scalikejdbc" %% "scalikejdbc-play-fixture" % "2.6.0-scalikejdbc-3.2"
),
publish := { },
publishArtifact := false,
packagedArtifacts := Map.empty,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
pomExtra := appPomExtra
)
.dependsOn(core, social)
lazy val root = project.in(file("."))
.settings(baseSettings)
.settings(
publish := { },
publishArtifact := false,
packagedArtifacts := Map.empty,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
pomExtra := appPomExtra
).aggregate(core, test, sample, social, socialSample)