|
1 | | -import com.typesafe.sbt.SbtGhPages.ghpages |
2 | | -import com.typesafe.sbt.SbtGit.git |
3 | | - |
4 | | -import scalariform.formatter.preferences._ |
5 | | -import com.typesafe.sbt.SbtScalariform |
6 | | -import com.typesafe.sbt.SbtScalariform.ScalariformKeys |
| 1 | +import de.heikoseeberger.sbtheader.license.MIT |
| 2 | +import catext.Dependencies._ |
7 | 3 |
|
| 4 | +val dev = Seq(Dev("47 Degrees (twitter: @47deg)", "47 Degrees")) |
| 5 | +val gh = GitHubSettings("com.fortysevendeg", "github4s", "47 Degrees", mit) |
| 6 | +val vAll = Versions(versions, libraries, scalacPlugins) |
8 | 7 |
|
9 | 8 | lazy val buildSettings = Seq( |
10 | | - organization := "com.fortysevendeg", |
11 | | - organizationName := "47 Degrees", |
12 | | - description := "Github API wrapper written in Scala", |
13 | | - startYear := Option(2016), |
14 | | - homepage := Option(url("http://47deg.github.io/github4s/")), |
15 | | - organizationHomepage := Option(new URL("http://47deg.com")), |
16 | | - scalaVersion := "2.11.8", |
17 | | - licenses := Seq("Apache License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")) |
18 | | -) |
19 | | - |
20 | | -lazy val cats = "0.7.2" |
21 | | -lazy val circe = "0.5.2" |
22 | | - |
23 | | -lazy val dependencies = libraryDependencies ++= Seq( |
24 | | - "org.typelevel" %% "cats-free" % cats, |
25 | | - "org.scalaj" %% "scalaj-http" % "2.2.1", |
26 | | - "io.circe" %% "circe-core" % circe, |
27 | | - "io.circe" %% "circe-generic" % circe, |
28 | | - "io.circe" %% "circe-parser" % circe, |
29 | | - "com.github.mpilquist" %% "simulacrum" % "0.8.0", |
30 | | - "org.scalatest" %% "scalatest" % "2.2.6" % "test", |
31 | | - "org.mock-server" % "mockserver-netty" % "3.10.4" % "test", |
32 | | - compilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full) |
33 | | -) |
34 | | - |
35 | | -lazy val scalariformSettings = SbtScalariform.scalariformSettings ++ Seq( |
36 | | - ScalariformKeys.preferences := ScalariformKeys.preferences.value |
37 | | - .setPreference(SpacesWithinPatternBinders, true) |
38 | | - .setPreference(SpaceBeforeColon, false) |
39 | | - .setPreference(SpaceInsideParentheses, false) |
40 | | - .setPreference(SpaceInsideBrackets, false) |
41 | | - .setPreference(SpacesAroundMultiImports, true) |
42 | | - .setPreference(PreserveSpaceBeforeArguments, false) |
43 | | - .setPreference(CompactStringConcatenation, false) |
44 | | - .setPreference(DanglingCloseParenthesis, Force) |
45 | | - .setPreference(CompactControlReadability, false) |
46 | | - .setPreference(AlignParameters, false) |
47 | | - .setPreference(AlignArguments, true) |
48 | | - .setPreference(AlignSingleLineCaseStatements, false) |
49 | | - .setPreference(DoubleIndentClassDeclaration, false) |
50 | | - .setPreference(IndentLocalDefs, false) |
51 | | - .setPreference(MultilineScaladocCommentsStartOnFirstLine, false) |
52 | | - .setPreference(PlaceScaladocAsterisksBeneathSecondAsterisk, true) |
53 | | - .setPreference(RewriteArrowSymbols, true)) |
54 | | - |
55 | | - |
56 | | -lazy val noPublishSettings = Seq( |
57 | | - publish := (), |
58 | | - publishLocal := (), |
59 | | - publishArtifact := false) |
60 | | - |
61 | | -lazy val tutDirectoriesSettings = Seq( |
62 | | - tutSourceDirectory := sourceDirectory.value / "tut", |
63 | | - tutTargetDirectory := sourceDirectory.value / "jekyll" |
| 9 | + name := gh.proj, |
| 10 | + organization := gh.org, |
| 11 | + organizationName := gh.publishOrg, |
| 12 | + description := "Github API wrapper written in Scala", |
| 13 | + startYear := Option(2016), |
| 14 | + homepage := Option(url("http://47deg.github.io/github4s/")), |
| 15 | + organizationHomepage := Option(new URL("http://47deg.com")), |
| 16 | + scalaVersion := "2.11.8", |
| 17 | + scalafmtConfig in ThisBuild := Some(file(".scalafmt")), |
| 18 | + headers := Map( |
| 19 | + "scala" -> MIT("2016", "47 Degrees, LLC. <http://www.47deg.com>") |
| 20 | + ) |
| 21 | + ) ++ reformatOnCompileSettings ++ |
| 22 | + sharedReleaseProcess ++ |
| 23 | + pgpSettings ++ |
| 24 | + credentialSettings ++ |
| 25 | + sharedPublishSettings(gh, dev) |
| 26 | + |
| 27 | +lazy val micrositeSettings = Seq( |
| 28 | + micrositeName := "github4s", |
| 29 | + micrositeDescription := "Github API wrapper written in Scala", |
| 30 | + micrositeBaseUrl := "github4s", |
| 31 | + micrositeDocumentationUrl := "/github4s/docs.html", |
| 32 | + micrositeGithubOwner := "47deg", |
| 33 | + micrositeGithubRepo := "github4s", |
| 34 | + includeFilter in makeSite := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.md" |
64 | 35 | ) |
65 | 36 |
|
66 | | -lazy val github4sSettings = buildSettings ++ dependencies ++ scalariformSettings |
67 | | - |
68 | | -lazy val ghpagesSettings = ghpages.settings ++ Seq(git.remoteRepo := "git@github.com:47deg/github4s.git") |
69 | | - |
70 | | -lazy val docsSettings = buildSettings ++ docsDependencies ++ noPublishSettings ++ tutSettings ++ tutDirectoriesSettings ++ ghpagesSettings |
| 37 | +lazy val dependencies = addLibs(vAll, |
| 38 | + "cats-free", |
| 39 | + "circe-core", |
| 40 | + "circe-generic", |
| 41 | + "circe-parser", |
| 42 | + "simulacrum") ++ |
| 43 | + addTestLibs(vAll, "scalatest") ++ |
| 44 | + addCompilerPlugins(vAll, "paradise") ++ |
| 45 | + Seq( |
| 46 | + libraryDependencies ++= Seq( |
| 47 | + "org.scalaj" %% "scalaj-http" % "2.2.1", |
| 48 | + "org.mock-server" % "mockserver-netty" % "3.10.4" % "test" |
| 49 | + )) |
71 | 50 |
|
72 | 51 | lazy val docsDependencies = libraryDependencies ++= Seq( |
73 | | - "com.ironcorelabs" %% "cats-scalatest" % "1.1.2" % "test", |
74 | | - "org.mock-server" % "mockserver-netty" % "3.10.4" % "test" |
75 | | -) |
| 52 | + "com.ironcorelabs" %% "cats-scalatest" % "1.1.2" % "test", |
| 53 | + "org.mock-server" % "mockserver-netty" % "3.10.4" % "test" |
| 54 | + ) |
| 55 | + |
| 56 | +lazy val scalazDependencies = addLibs(vAll, "scalaz-concurrent") |
76 | 57 |
|
77 | 58 | lazy val github4s = (project in file(".")) |
78 | | - .settings(moduleName := "github4s") |
79 | | - .settings(github4sSettings:_*) |
| 59 | + .settings(moduleName := "github4s") |
| 60 | + .settings(buildSettings: _*) |
| 61 | + .settings(dependencies: _*) |
| 62 | + .enablePlugins(AutomateHeaderPlugin) |
80 | 63 |
|
81 | 64 | lazy val docs = (project in file("docs")) |
82 | | - .settings(moduleName := "github4s-docs") |
83 | | - .settings(docsSettings: _*) |
84 | | - .enablePlugins(JekyllPlugin) |
85 | | - .dependsOn(scalaz) |
86 | | - |
87 | | -lazy val scalazDependencies = libraryDependencies ++= Seq( |
88 | | - "org.scalaz" %% "scalaz-concurrent" % "7.3.0-M5" |
89 | | -) |
90 | | - |
91 | | -lazy val scalazSettings = buildSettings ++ scalazDependencies ++ scalariformSettings |
| 65 | + .dependsOn(scalaz) |
| 66 | + .settings(moduleName := "github4s-docs") |
| 67 | + .settings(buildSettings: _*) |
| 68 | + .settings(micrositeSettings: _*) |
| 69 | + .settings(docsDependencies: _*) |
| 70 | + .settings(noPublishSettings: _*) |
| 71 | + .enablePlugins(MicrositesPlugin) |
92 | 72 |
|
93 | 73 | lazy val scalaz = (project in file("scalaz")) |
94 | | - .settings(moduleName := "github4s-scalaz") |
95 | | - .settings(scalazSettings: _*) |
96 | | - .dependsOn(github4s) |
| 74 | + .settings(moduleName := "github4s-scalaz") |
| 75 | + .settings(buildSettings: _*) |
| 76 | + .settings(scalazDependencies: _*) |
| 77 | + .dependsOn(github4s) |
| 78 | + .enablePlugins(AutomateHeaderPlugin) |
0 commit comments