forked from ReactivePlatform/Pragmatic-Scala
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
94 lines (65 loc) · 3.11 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
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import scalariform.formatter.preferences._
name := "PragmaticScala"
version := "1.0.0"
scalaVersion := "2.12.7"
scalafixSemanticdbVersion := "4.2.0"
scalacOptions in Compile ++= Seq("-encoding", "UTF-8", "-target:jvm-1.8", "-feature", "-unchecked", "-Xlog-reflective-calls", "-Xlint")
javacOptions in compile ++= Seq("-encoding", "UTF-8", "-source", "1.8", "-target", "1.8", "-Xlint:unchecked", "-XDignore.symbol.file")
resolvers += "akka" at "https://dl.bintray.com/akka/maven/"
//javaFormattingSettingsFilename in ThisBuild := "formatting-java.xml"
//sourceLevel in ThisBuild := Some("1.8")
//
//targetLevel in ThisBuild := Some("1.8")
enablePlugins(ParadoxSitePlugin)
enablePlugins(GhpagesPlugin)
enablePlugins(AutomateHeaderPlugin)
enablePlugins(JavaFormatterPlugin)
(sources in Test) := Nil
scmInfo := Some(ScmInfo(url(
"https://github.com/ReactivePlatform/Pragmatic-Scala.git"),
"[email protected]:ReactivePlatform/Pragmatic-Scala.git"))
git.remoteRepo := scmInfo.value.get.connection
excludeFilter in ghpagesCleanSite :=
new FileFilter{
def accept(f: File) = (ghpagesRepository.value / "CNAME").getCanonicalPath == f.getCanonicalPath
} || "versions.html"
enablePlugins(ParadoxMaterialThemePlugin)
ParadoxMaterialThemePlugin.paradoxMaterialThemeSettings(Paradox)
paradoxProperties in Compile ++= Map(
"project.name" -> "Pragmatic-Scala",
"github.base_url" -> "https://github.com/ReactivePlatform/Pragmatic-Scala"
)
paradoxMaterialTheme in Compile ~= {
_.withColor("red", "pink")
.withLogoIcon("cloud")
.withCopyright("Copyleft © 2018 pragmatic-scala.reactiveplatform.xyz")
.withRepository(uri("https://github.com/ReactivePlatform/Pragmatic-Scala.git"))
.withSearch(tokenizer = "[\\s\\-\\.]+")
.withSocial(
uri("https://github.com/hepin1989")
)
}
organizationName := "pragmatic-scala.reactiveplatform.xyz"
startYear := Some(2018)
licenses += ("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt"))
def setPreferences(preferences: IFormattingPreferences): IFormattingPreferences = preferences
.setPreference(RewriteArrowSymbols, true)
.setPreference(AlignParameters, true)
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(DoubleIndentConstructorArguments, false)
.setPreference(DoubleIndentMethodDeclaration, false)
.setPreference(DanglingCloseParenthesis, Preserve)
.setPreference(NewlineAtEndOfFile, true)
ScalariformKeys.preferences := setPreferences(ScalariformKeys.preferences.value)
ScalariformKeys.preferences in Compile := setPreferences(ScalariformKeys.preferences.value)
ScalariformKeys.preferences in Test := setPreferences(ScalariformKeys.preferences.value)
libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "1.2.0"
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.5.23"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8"
libraryDependencies += "junit" % "junit" % "4.12"
libraryDependencies += "org.mockito" % "mockito-core" % "3.0.0"
//如果想要写更好的代码:)
//wartremoverErrors ++= Warts.all
scalafixSettings
scalafixConfigure(Compile)