forked from scalafx/scalafx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
172 lines (158 loc) · 5.95 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
import java.net.URL
//
// Environment variables used by the build:
// GRAPHVIZ_DOT_PATH - Full path to Graphviz dot utility. If not defined Scaladocs will be build without diagrams.
// JAR_BUILT_BY - Name to be added to Jar metadata field "Built-By" (defaults to System.getProperty("user.name")
//
val scalafxVersion = "8.0.181-R14-SNAPSHOT"
val versionTagDir = if (scalafxVersion.endsWith("SNAPSHOT")) "master" else "v" + scalafxVersion
// ScalaFX project
lazy val scalafx = (project in file("scalafx")).settings(
scalafxSettings,
description := "The ScalaFX framework",
fork in run := true,
scalacOptions in(Compile, doc) ++= Seq(
"-sourcepath", baseDirectory.value.toString,
"-doc-root-content", baseDirectory.value + "/src/main/scala/root-doc.creole",
"-doc-source-url", "https://github.com/scalafx/scalafx/blob/" + versionTagDir + "/scalafx/€{FILE_PATH}.scala"
) ++ (Option(System.getenv("GRAPHVIZ_DOT_PATH")) match {
case Some(path) => Seq("-diagrams", "-diagrams-dot-path", path)
case None => Seq.empty[String]
})
)
// ScalaFX Demos project
lazy val scalafxDemos = (project in file("scalafx-demos")).settings(
scalafxSettings,
description := "The ScalaFX demonstrations",
fork in run := true,
javaOptions ++= Seq(
"-Xmx512M",
"-Djavafx.verbose"
),
publishArtifact := false
).dependsOn(scalafx % "compile;test->test")
// Dependencies
lazy val scalatest = "org.scalatest" %% "scalatest" % "3.0.5"
// Resolvers
lazy val sonatypeNexusSnapshots = "Sonatype Nexus Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
lazy val sonatypeNexusStaging = "Sonatype Nexus Staging" at "https://oss.sonatype.org/service/local/staging/deploy/maven2"
// Add snapshots to root project to enable compilation with Scala SNAPSHOT compiler,
// e.g., 2.11.0-SNAPSHOT
resolvers += sonatypeNexusSnapshots
// Common settings
lazy val scalafxSettings = Seq(
organization := "org.scalafx",
version := scalafxVersion,
crossScalaVersions := Seq("2.10.7", "2.11.12", "2.12.7"),
scalaVersion := crossScalaVersions.value.head,
scalacOptions ++= Seq("-unchecked", "-deprecation", "-Xcheckinit", "-encoding", "utf8", "-feature"),
scalacOptions in(Compile, doc) ++= Opts.doc.title("ScalaFX API"),
scalacOptions in(Compile, doc) ++= Opts.doc.version(scalafxVersion),
scalacOptions in(Compile, doc) += s"-doc-external-doc:${scalaInstance.value.libraryJar}#http://www.scala-lang.org/api/${scalaVersion.value}/",
scalacOptions in(Compile, doc) ++= Seq("-doc-footer", s"ScalaFX API v.$scalafxVersion"),
javacOptions ++= Seq(
"-target", "1.8",
"-source", "1.8",
"-Xlint:deprecation"),
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
scalatest % "test"),
autoAPIMappings := true,
manifestSetting,
publishSetting,
fork in Test := true,
parallelExecution in Test := false,
resolvers += sonatypeNexusSnapshots,
// print junit-style XML for CI
testOptions in Test += {
val t = (target in Test).value
Tests.Argument(TestFrameworks.ScalaTest, "-u", s"$t/junitxmldir")
},
shellPrompt in ThisBuild := { state => "sbt:" + Project.extract(state).currentRef.project + "> " }
) ++ mavenCentralSettings
lazy val manifestSetting = packageOptions += {
Package.ManifestAttributes(
"Created-By" -> "Simple Build Tool",
"Built-By" -> Option(System.getenv("JAR_BUILT_BY")).getOrElse(System.getProperty("user.name")),
"Build-Jdk" -> System.getProperty("java.version"),
"Specification-Title" -> name.value,
"Specification-Version" -> version.value,
"Specification-Vendor" -> organization.value,
"Implementation-Title" -> name.value,
"Implementation-Version" -> version.value,
"Implementation-Vendor-Id" -> organization.value,
"Implementation-Vendor" -> organization.value
)
}
lazy val publishSetting = publishTo := {
val version: String = scalafxVersion
if (version.trim.endsWith("SNAPSHOT"))
Some(sonatypeNexusSnapshots)
else
Some(sonatypeNexusStaging)
}
// Metadata needed by Maven Central
// See also http://maven.apache.org/pom.html#Developers
lazy val mavenCentralSettings = Seq(
homepage := Some(new URL("http://www.scalafx.org/")),
startYear := Some(2011),
licenses := Seq(("BSD", new URL("https://github.com/scalafx/scalafx/blob/master/LICENSE.txt"))),
pomExtra :=
<scm>
<url>https://github.com/scalafx/scalafx</url>
<connection>scm:git:https://github.com/scalafx/scalafx.git</connection>
</scm>
<developers>
<developer>
<id>rafael.afonso</id>
<name>Rafael Afonso</name>
<url>https://github.com/rafonso</url>
</developer>
<developer>
<name>Mike Allen</name>
</developer>
<developer>
<id>Alain.Fagot.Bearez</id>
<name>Alain Béarez</name>
<url>http://cua.li/TI/</url>
</developer>
<developer>
<id>steveonjava</id>
<name>Stephen Chin</name>
<url>http://www.nighthacking.com/</url>
</developer>
<developer>
<id>KevinCoghlan</id>
<name>Kevin Coghlan</name>
<url>http://www.kevincoghlan.com</url>
</developer>
<developer>
<id>akauppi</id>
<name>Asko Kauppi</name>
</developer>
<developer>
<id>rladstaetter</id>
<name>Robert Ladstätter</name>
</developer>
<developer>
<id>peter.pilgrim</id>
<name>Peter Pilgrim</name>
<url>http://www.xenonique.co.uk/blog/</url>
</developer>
<developer>
<name>Matthew Pocock</name>
</developer>
<developer>
<id>sven.reimers</id>
<name>Sven Reimers</name>
<url>http://wiki.netbeans.org/SvenReimers/</url>
</developer>
<developer>
<id>jpsacha</id>
<name>Jarek Sacha</name>
</developer>
<developer>
<name>Curtis Stanford</name>
</developer>
</developers>
)