forked from frgomes/jquantlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
202 lines (164 loc) · 6.7 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
import sbt._
import Keys._
import com.typesafe.sbt.SbtPgp.PgpKeys.publishSigned
import xerial.sbt.Sonatype.sonatypeSettings
val `app.organization` = "org.jquantlib.java"
val `app.name` = None
val `app.description` = "JQuantLib is a library for Quantitative Finance written in 100% Java."
val `app.license` = ("BSD Simplified", url("http://opensource.org/licenses/BSD-2-Clause"))
val `bintray.organization` = Some("jquantlib.org")
val `bintray.packagelabels` = Seq("java", "scala", "quantitative", "finance", "models")
val `java.version` = "1.7"
val `junit.version` = "4.12"
val `junit-interface.version` = "0.11"
val `slf4j.version` = "1.4.0"
val `jcip.version` = "1.0"
val `jfreechart.version` = "1.0.0"
// compilation --------------------------------------------------------------------------------------------------
lazy val librarySettings : Seq[Setting[_]] =
Seq(
autoScalaLibrary := false,
crossPaths := false,
javacOptions ++=
Seq(
"-encoding", "UTF-8"
)
)
lazy val disableJavadocs : Seq[Setting[_]] =
Seq(
publishArtifact in (Compile, packageDoc) := false,
publishArtifact in packageDoc := false,
sources in (Compile,doc) := Seq.empty
)
lazy val javadocSettings : Seq[Setting[_]] =
Seq(
javacOptions in (Compile,compile) ++= Seq("-source", `java.version`, "-target", `java.version`, "-Xlint"),
javacOptions in (Compile,doc) ++= Seq("-Xdoclint", "-notimestamp", "-linksource")
)
// test frameworks ----------------------------------------------------------------------------------------------
lazy val junitSettings : Seq[Setting[_]] =
Seq(
libraryDependencies ++= Seq(
"junit" % "junit" % `junit.version` % "test",
"com.novocode" % "junit-interface" % `junit-interface.version` % "test" ),
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v")
)
// dependencies -------------------------------------------------------------------------------------------------
lazy val deps_common : Seq[Setting[_]] =
Seq(
libraryDependencies ++= Seq(
"net.jcip" % "jcip-annotations" % `jcip.version`,
"org.slf4j" % "slf4j-api" % `slf4j.version`,
"org.slf4j" % "slf4j-simple" % `slf4j.version` % "test"
)
)
lazy val deps_samples : Seq[Setting[_]] =
Seq(
libraryDependencies ++= Seq(
"jfree" % "jfreechart" % `jfreechart.version`
)
)
// projects -----------------------------------------------------------------------------------------------------
def makeRoot(p: sbt.Project): sbt.Project =
p.settings(
disablePublishing ++
Seq(
organization := `app.organization`,
version := (version in ThisBuild).value,
description := `app.description`,
licenses += `app.license`
): _*)
def makeModule(p: sbt.Project): sbt.Project =
p.settings(
librarySettings ++
publishSettings ++
//paranoidOptions ++
//javadocSettings ++
disableJavadocs ++
junitSettings ++
// otestFramework ++
deps_common ++
Seq(
organization := `app.organization`,
version := (version in ThisBuild).value,
description := `app.description`,
licenses += `app.license`
): _*)
lazy val root =
makeRoot(project.in(file(".")))
.aggregate(core, helpers, contrib, samples)
lazy val core =
makeModule(project.in(file("jquantlib")))
lazy val helpers =
makeModule(project.in(file("jquantlib-helpers")))
.dependsOn(core)
lazy val contrib =
makeModule(project.in(file("jquantlib-contrib")))
.dependsOn(core)
lazy val samples =
makeModule(project.in(file("jquantlib-samples")))
.dependsOn(core, helpers)
.settings(deps_samples:_*)
// publish settings ---------------------------------------------------------------------------------------------
lazy val disablePublishing: Seq[Setting[_]] =
sonatypeSettings ++
Seq(
publishArtifact := false,
publishSigned := (),
publish := (),
publishLocal := ()
)
lazy val publishSettings: Seq[Setting[_]] =
Seq(
name in bintray := name.value,
bintrayOrganization in bintray := `bintray.organization`,
bintrayRepository in bintray := (if((version in ThisBuild).value.contains("SNAPSHOT")) "snapshots" else "releases"),
bintrayPackageLabels in bintray := `bintray.packagelabels`,
pomExtra := `pom.extra`
)
// --------------------------------------------------------------------------------------------------------------
val `pom.extra` =
<scm>
<developerConnection>scm:git:git@github.com:frgomes/jquantlib.git</developerConnection>
<connection>scm:git:github.com/frgomes/jquantlib.git</connection>
<url>http://github.com/frgomes/jquantlib</url>
</scm>
<developers>
<developer>
<id>frgomes</id>
<name>Richard Gomes</name>
<url>http://rgomes-info.blogspot.com</url>
</developer>
</developers>
// --------------------------------------------------------------------------------------------------------------
/*
TODO: Translate to SBT
//TODO: doclet 'gr.spinellis:UmlGraph:4.9.0'
//TODO: //-- doclet 'org.umlgraph:doclet:5.1'
//TODO: //-- taglets 'net.sf.latextaglet:latextaglet:0.1.2'
//TODO: taglets 'org.jquantlib:latextaglet:1.0-SNAPSHOT'
task umlgraph(type: Javadoc) {
description = "JQuantLib $version API Javadoc"
classpath = files( new File("$projectDir/src/main/java") )
source = sourceSets.main.allJava
options.doclet = "gr.spinellis.umlgraph.doclet.UmlGraphDoc"
// options.doclet = "org.umlgraph.doclet.UmlGraphDoc"
options.docletpath = configurations.doclet as List
options.taglets = [ 'net.sf.latextaglet.LaTeXBlockEquationTaglet','net.sf.latextaglet.LaTeXEquationTaglet','net.sf.latextaglet.LaTeXInlineTaglet' ]
options.tagletPath = configurations.taglets as List
options.addStringOption('inferrel')
options.addStringOption('inferdep')
options.addStringOption('quiet')
options.addStringOption('qualify')
options.addStringOption('postfixpackage')
options.addStringOption('hide', 'java.*')
options.addStringOption('collpackages', 'java.util.*')
options.addStringOption('nodefontsize', '9')
options.addStringOption('nodefontpackagesize', '7')
}
task demo(type: JavaExec) {
description = 'Run EquityOptions'
classpath configurations.demo
main = 'org.jquantlib.samples.EquityOptions'
}
*/