-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.sbt
199 lines (149 loc) · 8.04 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
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._
//import scalariform.formatter.preferences._
//import com.typesafe.sbt.SbtScalariform.ScalariformKeys
ThisBuild / organization := "org.openmole.gridscale"
name := "gridscale"
ThisBuild / scalaVersion := "3.3.1"
//ThisBuild / crossScalaVersions := Seq("2.13.8", "3.1.2")
ThisBuild / licenses := Seq("Affero GPLv3" -> url("http://www.gnu.org/licenses/"))
ThisBuild / homepage := Some(url("https://github.com/openmole/gridscale"))
ThisBuild / publishTo := sonatypePublishToBundle.value
ThisBuild / pomIncludeRepository := { _ => false}
ThisBuild / scmInfo := Some(ScmInfo(url("https://github.com/openmole/gridscale.git"), "scm:git:[email protected]:openmole/gridscale.git"))
ThisBuild / pomExtra := {
<!-- Developer contact information -->
<developers>
<developer>
<id>romainreuillon</id>
<name>Romain Reuillon</name>
<url>https://github.com/romainreuillon/</url>
</developer>
<developer>
<id>jopasserat</id>
<name>Jonathan Passerat-Palmbach</name>
<url>https://github.com/jopasserat/</url>
</developer>
<developer>
<id>justeraimbault</id>
<name>Juste Raimbault</name>
<url>https://github.com/JusteRaimbault/</url>
</developer>
</developers>
}
releaseVersionBump := sbtrelease.Version.Bump.Minor
releaseTagComment := s"Releasing ${(ThisBuild / version).value}"
releaseCommitMessage := s"Bump version to ${(ThisBuild / version).value}"
sonatypeProfileName := "org.openmole"
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
//releaseStepCommand("sonatypeReleaseAll"),
pushChanges
)
def is2_13(scalaVersion: String): Boolean =
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, minor)) => true
case _ => false
}
def settings = Seq (
resolvers += Resolver.sonatypeRepo("snapshots"),
scalacOptions ++=
(if(is2_13(scalaVersion.value)) Seq("-Ytasty-reader", "-language:implicitConversions", "-language:postfixOps") else Seq("-Xtarget:11", "-language:postfixOps"))
)
def exportSettings = Seq(exportJars := true)
lazy val publishDir = settingKey[File]("Publishing directory")
lazy val publishIpfs = taskKey[Unit]("Publish to IPFS")
def defaultSettings =
settings ++
/*scalariformSettings(autoformat = true) ++ Seq(
ScalariformKeys.preferences :=
ScalariformKeys.preferences.value
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(RewriteArrowSymbols, true),*/
Seq(
shellPrompt := { s => Project.extract(s).currentProject.id + " > " },
javacOptions ++= Seq("-source", "1.8", "-target", "1.8"),
)
/* ---------------- Libraries --------------------*/
lazy val httpComponentsVersion = "4.5.14"
lazy val httpComponents = Seq("httpclient", "httpmime").map(
"org.apache.httpcomponents" % _ % httpComponentsVersion)
lazy val scalaTest = "org.scalatest" %% "scalatest" % "3.2.9" % "test"
lazy val betterFile = "com.github.pathikrit" %% "better-files" % "3.9.2" cross(CrossVersion.for3Use2_13)
val circeVersion = "0.14.6"
lazy val circe = Seq(
"io.circe" %% "circe-core",
"io.circe" %% "circe-generic",
"io.circe" %% "circe-parser"
).map(_ % circeVersion)
lazy val compress = "org.apache.commons" % "commons-compress" % "1.22"
val json4sVersion = "4.0.6"
/* -------------- gridscale dsl ------------------ */
def dslSettings = defaultSettings ++ Seq(
libraryDependencies += "org.typelevel" %% "squants" % "1.8.3",
resolvers += "jitpack" at "https://jitpack.io"
)
lazy val gridscale = Project(id = "gridscale", base = file("gridscale")) settings(dslSettings: _*) settings(
libraryDependencies += scalaTest
)
lazy val local = Project(id = "local", base = file("local")) settings(dslSettings: _*) dependsOn (gridscale)
lazy val ssh = Project(id = "ssh", base = file("ssh")) settings(dslSettings: _*) dependsOn (gridscale) settings (
libraryDependencies += "com.hierynomus" % "sshj" % "0.38.0",
libraryDependencies += "com.jcraft" % "jzlib" % "1.1.3"
)
lazy val cluster = Project(id = "cluster", base = file("cluster")) settings(dslSettings: _*) dependsOn (ssh, local)
lazy val pbs = Project(id = "pbs", base = file("pbs")) settings(dslSettings: _*) dependsOn(gridscale, cluster)
lazy val slurm = Project(id = "slurm", base = file("slurm")) settings(dslSettings: _*) dependsOn(gridscale, cluster)
lazy val condor = Project(id = "condor", base = file("condor")) settings(dslSettings: _*) dependsOn(gridscale, cluster)
lazy val oar = Project(id = "oar", base = file("oar")) settings(dslSettings: _*) dependsOn(gridscale, cluster)
lazy val sge = Project(id = "sge", base = file("sge")) settings(dslSettings: _*) dependsOn(gridscale, cluster)
lazy val qarnot = Project(id = "qarnot", base = file("qarnot")) dependsOn(gridscale, http) settings(
dslSettings,
libraryDependencies ++= circe
)
lazy val http = Project(id = "http", base = file("http")) settings(dslSettings: _*) dependsOn(gridscale) settings (
libraryDependencies += "org.htmlparser" % "htmlparser" % "2.1",
libraryDependencies += "com.squareup.okhttp3" % "okhttp" % "4.10.0",
libraryDependencies ++= httpComponents
)
lazy val webdav = Project(id = "webdav", base = file("webdav")) settings(dslSettings: _*) dependsOn(gridscale, http)
lazy val dirac = Project(id = "dirac", base = file("dirac")) settings(dslSettings: _*) dependsOn(gridscale, http) settings (
libraryDependencies += "org.json4s" %% "json4s-jackson" % json4sVersion,
libraryDependencies += compress
)
lazy val egi = Project(id = "egi", base = file("egi")) settings(dslSettings: _*) dependsOn(gridscale, http, webdav) settings (
libraryDependencies += "org.json4s" %% "json4s-jackson" % json4sVersion,
libraryDependencies += "org.bouncycastle" % "bcpkix-jdk18on" % "1.77",
libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "2.1.0"
)
lazy val ipfs = Project(id = "ipfs", base = file("ipfs")) settings(dslSettings: _*) dependsOn(gridscale, http) settings (
libraryDependencies ++= circe,
libraryDependencies += compress)
/* -------------- examples ------------------ */
def exampleSettings =
defaultSettings ++ exportSettings ++ Seq(
publish := false
)
lazy val egiCreamExample = Project(id = "example-egi-cream", base = file("examples/egi/cream")) settings(exampleSettings) dependsOn egi
lazy val egiWebDAVExample = Project(id = "example-egi-webdav", base = file("examples/egi/webdav")) settings(exampleSettings) dependsOn (egi, webdav)
lazy val egiDiracExample = Project(id = "example-egi-dirac", base = file("examples/egi/dirac")) settings(exampleSettings) dependsOn (egi, dirac)
lazy val condorExample = Project(id = "example-condor", base = file("examples/condor")) settings(exampleSettings) dependsOn condor
lazy val pbsExample = Project(id = "example-pbs", base = file("examples/pbs")) settings(exampleSettings) dependsOn pbs
lazy val slurmExample = Project(id = "example-slurm", base = file("examples/slurm")) settings(exampleSettings) dependsOn slurm
lazy val sgeExample = Project(id = "example-sge", base = file("examples/sge")) settings(exampleSettings) dependsOn sge
lazy val sshExample = Project(id = "example-ssh", base = file("examples/ssh")) settings(exampleSettings) dependsOn ssh
lazy val oarExample = Project(id = "example-oar", base = file("examples/oar")) settings(exampleSettings) dependsOn oar
lazy val qarnotExample = Project(id = "example-qarnot", base = file("examples/qarnot")) settings(exampleSettings) dependsOn qarnot
lazy val httpExample = Project(id = "example-http", base = file("examples/http")) settings(exampleSettings) dependsOn http
lazy val localExample = Project(id = "example-local", base = file("examples/local")) settings(exampleSettings) dependsOn (local, cluster)
lazy val ipfsExample = Project(id = "ipfsexample", base = file("examples/ipfs")) settings(exampleSettings) dependsOn ipfs settings(
libraryDependencies += betterFile
)