-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sbt
119 lines (90 loc) · 2.9 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
/* basic project info */
name := "prototype-project"
organization := "com.example"
version := "1.0.0-SNAPSHOT"
// description := "an awesome program"
// homepage := Some( url("http://example.com"))
// organizationName := "My Company"
/* scala versions and options */
scalaVersion := "2.9.2"
crossScalaVersions := Seq("2.9.1")
scalacOptions ++= Seq("-deprecation", "-unchecked")
javacOptions ++= Seq("-Xlint:unchecked", "-Xlint:deprecation")
/* entry point */
mainClass in (Compile, packageBin) := Some("com.example.Main")
mainClass in (Compile, run) := Some("com.example.Main")
/* dependencies */
libraryDependencies ++= Seq (
"org.scalaz" %% "scalaz-core" % "7.0.0-M2",
"org.scalaz" %% "scalaz-effect" % "7.0.0-M2",
"org.scalacheck" %% "scalacheck" % "1.9" % "test"
)
/* improve REPL */
initialCommands in console :=
"""|import scalaz._
|import Scalaz._
|import com.example._
|println("scalaz 7 loaded!")
|""".stripMargin
/* you may need these repos */
resolvers ++= Seq(
// "sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
// "sonatype releases" at "https://oss.sonatype.org/content/repositories/releases",
// Classpaths.typesafeResolver,
// Classpaths.typesafeSnapshots,
// JavaNet1Repository,
// JavaNet2Repository,
)
/* sbt behavior */
logLevel in compile := Level.Warn
traceLevel := 5
/* assembly plugin */
mainClass in AssemblyKeys.assembly := Some("com.example.Main")
assemblySettings
test in AssemblyKeys.assembly := {}
/* dependecy graph plugin */
net.virtualvoid.sbt.graph.Plugin.graphSettings
/* start script plugin */
seq(
com.typesafe.startscript.StartScriptPlugin.startScriptForClassesSettings: _*
)
/* buildinfo plugin */
buildInfoSettings
sourceGenerators in Compile <+= buildInfo
buildInfoKeys := Seq[Scoped](name, version, scalaVersion, sbtVersion)
buildInfoPackage := "com.example"
/* publishing */
publishMavenStyle := true
publishTo <<= version { (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")
}
publishArtifact in Test := false
pomIncludeRepository := { _ => false }
pomExtra := (
<url>https://github.com/ACCOUNT/MYPROJ</url>
<licenses>
<license>
<name>LICENSE NAME</name>
<url>https://github.com/ACCOUNT/MYPROJ/blob/master/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:ACCOUNT/MYPROJ.git</url>
<connection>scm:git:[email protected]:ACCOUNT/MYPROJ.git</connection>
</scm>
<developers>
<developer>
<id>HANDLE</id>
<name>MY FULL NAME</name>
<email>EMAIL</email>
<url>HOMEPAGE</url>
</developer>
</developers>
)
// Josh Suereth's step-by-step guide to publishing on sonatype
// httpcom://www.scala-sbt.org/using_sonatype.html