This repository has been archived by the owner on Sep 12, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split silhoute in two project (silhouette and testkit)
- Loading branch information
Showing
165 changed files
with
205 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import sbt._ | ||
|
||
object Build extends Build { | ||
|
||
val silhouette = Project( | ||
id = "silhouette", | ||
base = file("silhouette") | ||
) | ||
|
||
val silhouetteTestkit = Project( | ||
id = "silhouette-testkit", | ||
base = file("silhouette-testkit"), | ||
dependencies = Seq(silhouette) | ||
) | ||
|
||
val root = Project( | ||
id = "root", | ||
base = file("."), | ||
aggregate = Seq(silhouette, silhouetteTestkit) | ||
) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
import sbt.Keys._ | ||
import sbt._ | ||
|
||
object BasicSettings extends AutoPlugin { | ||
override def trigger = allRequirements | ||
|
||
override def projectSettings = Seq( | ||
organization := "com.mohiva", | ||
version := "2.0-SNAPSHOT", | ||
resolvers ++= Dependencies.resolvers, | ||
scalaVersion := Dependencies.Versions.scalaVersion, | ||
crossScalaVersions := Dependencies.Versions.crossScala, | ||
scalacOptions ++= Seq( | ||
"-deprecation", // Emit warning and location for usages of deprecated APIs. | ||
"-feature", // Emit warning and location for usages of features that should be imported explicitly. | ||
"-unchecked", // Enable additional warnings where generated code depends on assumptions. | ||
"-Xfatal-warnings", // Fail the compilation if there are any warnings. | ||
"-Xlint", // Enable recommended additional warnings. | ||
"-Ywarn-adapted-args", // Warn if an argument list is modified to match the receiver. | ||
"-Ywarn-dead-code", // Warn when dead code is identified. | ||
"-Ywarn-inaccessible", // Warn about inaccessible types in method signatures. | ||
"-Ywarn-nullary-override", // Warn when non-nullary overrides nullary, e.g. def foo() over def foo. | ||
"-Ywarn-numeric-widen" // Warn when numerics are widened. | ||
), | ||
scalacOptions in Test ~= { (options: Seq[String]) => | ||
options filterNot (_ == "-Ywarn-dead-code") // Allow dead code in tests (to support using mockito). | ||
}, | ||
parallelExecution in Test := false | ||
) | ||
} | ||
|
||
////******************************* | ||
//// Scalariform settings | ||
////******************************* | ||
object CodeFormatter extends AutoPlugin { | ||
|
||
import com.typesafe.sbt.SbtScalariform._ | ||
import scalariform.formatter.preferences.{DoubleIndentClassDeclaration, FormatXml, PreserveDanglingCloseParenthesis} | ||
|
||
override def trigger = allRequirements | ||
|
||
override def projectSettings = defaultScalariformSettings ++ Seq( | ||
ScalariformKeys.preferences := ScalariformKeys.preferences.value | ||
.setPreference(FormatXml, false) | ||
.setPreference(DoubleIndentClassDeclaration, false) | ||
.setPreference(PreserveDanglingCloseParenthesis, true) | ||
) | ||
} | ||
|
||
////******************************* | ||
//// ScalaDoc settings | ||
////******************************* | ||
object Doc extends AutoPlugin { | ||
|
||
import play.core.PlayVersion | ||
|
||
override def projectSettings = Seq( | ||
autoAPIMappings := true, | ||
apiURL := Some(url(s"http://silhouette.mohiva.com/api/$version/")), | ||
apiMappings ++= { | ||
implicit val cp = (fullClasspath in Compile).value | ||
Map( | ||
jarFor("com.typesafe.play", "play") -> url(s"http://www.playframework.com/documentation/${PlayVersion.current}/api/scala/"), | ||
scalaInstance.value.libraryJar -> url(s"http://www.scala-lang.org/api/${scalaVersion.value}/") | ||
) | ||
} | ||
) | ||
|
||
/** | ||
* Gets the JAR file for a package. | ||
* | ||
* @param organization The organization name. | ||
* @param name The name of the package. | ||
* @param cp The class path. | ||
* @return The file which points to the JAR. | ||
* @see http://stackoverflow.com/a/20919304/2153190 | ||
*/ | ||
private def jarFor(organization: String, name: String)(implicit cp: Seq[Attributed[File]]): File = { | ||
(for { | ||
entry <- cp | ||
module <- entry.get(moduleID.key) | ||
if module.organization == organization | ||
if module.name.startsWith(name) | ||
jarFile = entry.data | ||
} yield jarFile).head | ||
} | ||
} | ||
|
||
////******************************* | ||
//// Maven settings | ||
////******************************* | ||
object Publish extends AutoPlugin { | ||
|
||
import xerial.sbt.Sonatype._ | ||
|
||
override def trigger = allRequirements | ||
|
||
private val pom = { | ||
<scm> | ||
<url>git@github.com:mohiva/play-silhouette.git</url> | ||
<connection>scm:git:git@github.com:mohiva/play-silhouette.git</connection> | ||
</scm> | ||
<developers> | ||
<developer> | ||
<id>akkie</id> | ||
<name>Christian Kaps</name> | ||
<url>http://mohiva.com</url> | ||
</developer> | ||
<developer> | ||
<id>fernandoacorreia</id> | ||
<name>Fernando Correia</name> | ||
<url>http://www.fernandocorreia.info/</url> | ||
</developer> | ||
</developers> | ||
} | ||
|
||
override def projectSettings = sonatypeSettings ++ Seq( | ||
description := "Authentication library for Play Framework applications that supports several authentication methods, including OAuth1, OAuth2, OpenID, Credentials or custom authentication schemes", | ||
homepage := Some(url("http://silhouette.mohiva.com/")), | ||
licenses := Seq("Apache License" -> url("https://github.com/mohiva/play-silhouette/blob/master/LICENSE")), | ||
publishMavenStyle := true, | ||
publishArtifact in Test := false, | ||
pomIncludeRepository := { _ => false}, | ||
pomExtra := pom, | ||
credentials += Credentials(Path.userHome / ".sbt" / "sonatype.credentials") | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import sbt._ | ||
|
||
object Dependencies { | ||
|
||
object Versions { | ||
val crossScala = Seq("2.11.4", "2.10.4") | ||
val scalaVersion = crossScala.head | ||
} | ||
|
||
val resolvers = Seq( | ||
"Atlassian Releases" at "https://maven.atlassian.com/public/" | ||
) | ||
|
||
object Library { | ||
|
||
object Play { | ||
val version = play.core.PlayVersion.current | ||
val ws = "com.typesafe.play" %% "play-ws" % version | ||
val cache = "com.typesafe.play" %% "play-cache" % version | ||
val test = "com.typesafe.play" %% "play-test" % version | ||
} | ||
|
||
val jbcrypt = "org.mindrot" % "jbcrypt" % "0.3m" | ||
val jwtCore = "com.atlassian.jwt" % "jwt-core" % "1.2.3" | ||
val jwtApi = "com.atlassian.jwt" % "jwt-api" % "1.2.3" | ||
val mockito = "org.mockito" % "mockito-core" % "1.9.5" | ||
val scalaGuice = "net.codingwell" %% "scala-guice" % "4.0.0-beta5" | ||
val akkaTestkit = "com.typesafe.akka" %% "akka-testkit" % "2.3.3" | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=0.13.5 | ||
sbt.version=0.13.7 |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Dependencies._ | ||
|
||
libraryDependencies ++= Seq( | ||
Library.Play.test, | ||
Library.mockito % Test, | ||
Library.akkaTestkit % Test | ||
) | ||
|
||
enablePlugins(PlayScala, Doc) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Dependencies._ | ||
|
||
libraryDependencies ++= Seq( | ||
Library.Play.cache, | ||
Library.Play.ws, | ||
Library.jbcrypt, | ||
Library.jwtCore, | ||
Library.jwtApi, | ||
Library.mockito % Test, | ||
Library.scalaGuice % Test, | ||
Library.akkaTestkit % Test | ||
) | ||
|
||
enablePlugins(PlayScala, Doc) | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.