build.sbt 49.3 KB
Newer Older
1
2
import org.openmole.buildsystem._
import OMKeys._
Mathieu's avatar
Mathieu committed
3
import sbt.{io, _}
Mathieu's avatar
Mathieu committed
4
import Keys.{libraryDependencies, _}
Mathieu Leclaire's avatar
Mathieu Leclaire committed
5
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
6
import execnpm.NpmDeps.Dep
Mathieu Leclaire's avatar
Mathieu Leclaire committed
7

8
9
10
organization := "org.openmole"
name := "openmole-root"

11
def macroParadise =
Romain Reuillon's avatar
Romain Reuillon committed
12
  addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.Patch())
13
14
15
16

import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import scalariform.formatter.preferences._

17
def formatSettings =
Mathieu's avatar
Mathieu committed
18
19
20
21
22
23
24
25
26
27
28
  Seq(
    ScalariformKeys.preferences :=
      ScalariformKeys.preferences(p =>
        p.setPreference(RewriteArrowSymbols, true)
          .setPreference(AlignParameters, true)
          .setPreference(AlignSingleLineCaseStatements, true)
          .setPreference(DanglingCloseParenthesis, Preserve)
          .setPreference(CompactControlReadability, true)
      ).value,
    scalariformAutoformat := true
  )
29

30
lazy val scalaVersionValue = "2.12.7"
31

32
def defaultSettings = formatSettings ++
33
34
  Seq(
    organization := "org.openmole",
35
    updateOptions := updateOptions.value.withCachedResolution(true),
36
    resolvers += Resolver.sonatypeRepo("snapshots"),
Romain Reuillon's avatar
Romain Reuillon committed
37
    resolvers += Resolver.sonatypeRepo("staging"),
38
    resolvers += Resolver.bintrayRepo("projectseptemberinc", "maven"), // For freek
Mathieu's avatar
Mathieu committed
39
    resolvers += Resolver.bintrayRepo("definitelyscala", "maven"), // For plotlyjs
40
    resolvers += "osgeo" at "http://download.osgeo.org/webdav/geotools", // for geotools
41
    scalaVersion in Global := scalaVersionValue, // + "-bin-typelevel-4",
42
    scalacOptions ++= Seq("-target:jvm-1.8", "-language:higherKinds"),
43
    scalacOptions += "-Ypartial-unification",
44
    //scalacOptions += "-Yinduction-heuristics",
45
46
47
48
    scalacOptions ++= Seq("-Xmax-classfile-name", "140"),
    javacOptions ++= Seq("-source", "1.8", "-target", "1.8"),
    publishArtifact in (packageDoc in install) := false,
    publishArtifact in (packageSrc in install) := false,
49
    macroParadise,
50
51
52
53
    //scalaOrganization := "org.typelevel",
    //scalaVersion := "2.12.4-bin-typelevel-4",
    //addCompilerPlugin("org.scalameta" % "paradise" % "3.0.0-M10" cross CrossVersion.full),
    //scalacOptions += "-Xplugin-require:macroparadise",
54
    shellPrompt := { s => Project.extract(s).currentProject.id + " > " }
55
56
  )

57
58
Global / concurrentRestrictions := Seq(Tags.limitAll(4))

59

60
61
publishTo in ThisBuild :=
  (if (isSnapshot.value) Some("OpenMOLE Nexus" at "https://maven.openmole.org/snapshots") else Some("OpenMOLE Nexus" at "https://maven.openmole.org/releases"))
62
63


64
65
66
67
/* ------ Third parties ---------- */

def thirdPartiesDir = file("third-parties")
def thirdPartiesSettings = defaultSettings ++ Seq(libraryDependencies += Libraries.scalatest)
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
def allThirdParties = Seq(
  openmoleCache,
  openmoleTar,
  openmoleFile,
  openmoleLock,
  openmoleLogger,
  openmoleThread,
  openmoleHash,
  openmoleStream,
  openmoleCollection,
  openmoleCrypto,
  openmoleStatistics,
  openmoleTypes,
  openmoleByteCode,
  openmoleOSGi,
  openmoleRandom,
  openmoleNetwork,
85
  openmoleException,
86
  openmoleOutputRedirection,
87
  txtmark)
88

89
lazy val openmoleCache = OsgiProject(thirdPartiesDir, "org.openmole.tool.cache", imports = Seq("*")) dependsOn (openmoleLogger) settings (thirdPartiesSettings: _*) settings (libraryDependencies += Libraries.squants, libraryDependencies += Libraries.cats)
90
lazy val openmoleTar = OsgiProject(thirdPartiesDir, "org.openmole.tool.tar", imports = Seq("*")) dependsOn (openmoleFile) settings (thirdPartiesSettings: _*)
91
lazy val openmoleFile = OsgiProject(thirdPartiesDir, "org.openmole.tool.file", imports = Seq("*")) dependsOn(openmoleLock, openmoleStream, openmoleLogger) settings (thirdPartiesSettings: _*)
92
lazy val openmoleLock = OsgiProject(thirdPartiesDir, "org.openmole.tool.lock", imports = Seq("*")) settings (thirdPartiesSettings: _*)
93
lazy val openmoleLogger = OsgiProject(thirdPartiesDir, "org.openmole.tool.logger", imports = Seq("*")) dependsOn(openmoleOutputRedirection) settings (thirdPartiesSettings: _*) settings (libraryDependencies += Libraries.sourceCode)
94
lazy val openmoleThread = OsgiProject(thirdPartiesDir, "org.openmole.tool.thread", imports = Seq("*")) dependsOn(openmoleLogger, openmoleCollection) settings (thirdPartiesSettings: _*) settings (libraryDependencies += Libraries.squants)
95
lazy val openmoleHash = OsgiProject(thirdPartiesDir, "org.openmole.tool.hash", imports = Seq("*")) dependsOn(openmoleFile, openmoleStream) settings (thirdPartiesSettings: _*)
96
lazy val openmoleStream = OsgiProject(thirdPartiesDir, "org.openmole.tool.stream", imports = Seq("*")) dependsOn (openmoleThread) settings(libraryDependencies += Libraries.collections, libraryDependencies += Libraries.squants) settings (thirdPartiesSettings: _*)
97
lazy val openmoleCollection = OsgiProject(thirdPartiesDir, "org.openmole.tool.collection", imports = Seq("*")) settings (Libraries.addScalaLang(scalaVersionValue)) settings (thirdPartiesSettings: _*)
98
lazy val openmoleCrypto = OsgiProject(thirdPartiesDir, "org.openmole.tool.crypto", imports = Seq("*")) settings(libraryDependencies += Libraries.bouncyCastle, libraryDependencies += Libraries.jasypt) settings (thirdPartiesSettings: _*)
99
lazy val openmoleStatistics = OsgiProject(thirdPartiesDir, "org.openmole.tool.statistics", imports = Seq("*")) dependsOn (openmoleLogger, openmoleTypes) settings (thirdPartiesSettings: _*)
100
lazy val openmoleTypes = OsgiProject(thirdPartiesDir, "org.openmole.tool.types", imports = Seq("*")) settings(libraryDependencies += Libraries.shapeless, libraryDependencies += Libraries.squants) settings (thirdPartiesSettings: _*)
101
102
lazy val openmoleByteCode = OsgiProject(thirdPartiesDir, "org.openmole.tool.bytecode", imports = Seq("*")) settings (libraryDependencies += Libraries.asm) settings (thirdPartiesSettings: _*)
lazy val openmoleOSGi = OsgiProject(thirdPartiesDir, "org.openmole.tool.osgi", imports = Seq("*")) dependsOn (openmoleFile) settings (libraryDependencies += Libraries.equinoxOSGi) settings (thirdPartiesSettings: _*)
103
lazy val openmoleRandom = OsgiProject(thirdPartiesDir, "org.openmole.tool.random", imports = Seq("*")) settings (thirdPartiesSettings: _*) settings(libraryDependencies += Libraries.math, Libraries.addScalaLang(scalaVersionValue)) dependsOn (openmoleCache)
104
lazy val openmoleNetwork = OsgiProject(thirdPartiesDir, "org.openmole.tool.network", imports = Seq("*")) settings (thirdPartiesSettings: _*)
105
lazy val openmoleException = OsgiProject(thirdPartiesDir, "org.openmole.tool.exception", imports = Seq("*")) settings (thirdPartiesSettings: _*)
106
lazy val openmoleOutputRedirection = OsgiProject(thirdPartiesDir, "org.openmole.tool.outputredirection", imports = Seq("*")) settings (thirdPartiesSettings: _*)
107

108
lazy val txtmark = OsgiProject(thirdPartiesDir, "com.quandora.txtmark", exports = Seq("com.github.rjeschke.txtmark.*"), imports = Seq("*")) settings (thirdPartiesSettings: _*)
109
110
111
112
113


/* ------------- Core ----------- */

def coreDir = file("core")
114
def coreProvidedScope = Osgi.openMOLEScope += "provided"
115
116
117
118
def coreSettings =
  defaultSettings ++
    osgiSettings ++
    Seq(
119
      coreProvidedScope,
120
121
122
      libraryDependencies += Libraries.scalatest,
      libraryDependencies += Libraries.equinoxOSGi
    )
123

124
def allCore = Seq(
125
  keyword,
126
  workflow,
127
  authentication,
128
129
130
131
132
133
134
135
136
137
  serializer,
  communication,
  openmoleDSL,
  exception,
  tools,
  event,
  replication,
  workspace,
  pluginManager,
  fileService,
138
  logconfig,
139
  outputManager,
140
141
142
143
  console,
  project,
  buildinfo,
  module,
144
  market,
145
  context,
146
147
148
149
150
  expansion,
  preference,
  db,
  threadProvider,
  services,
151
  location,
152
  code,
153
154
  networkService,
  csv)
155
156


Mathieu's avatar
Mathieu committed
157
158
159
lazy val keyword = OsgiProject(coreDir, "org.openmole.core.keyword", imports = Seq("*")) settings (coreSettings: _*) settings (
  defaultActivator
  ) dependsOn(pluginManager, preference)
160

161
lazy val context = OsgiProject(coreDir, "org.openmole.core.context", imports = Seq("*")) settings(
162
  libraryDependencies ++= Seq(Libraries.cats, Libraries.sourceCode), defaultActivator
163
) dependsOn(tools, workspace, preference) settings (coreSettings: _*)
164
165

lazy val expansion = OsgiProject(coreDir, "org.openmole.core.expansion", imports = Seq("*")) settings (
166
  libraryDependencies ++= Seq(Libraries.cats)
167
  ) dependsOn(context, tools, openmoleRandom, openmoleFile, pluginManager, console, code) settings (coreSettings: _*)
168

169
lazy val workflow = OsgiProject(coreDir, "org.openmole.core.workflow", imports = Seq("*")) settings(
170
  libraryDependencies ++= Seq(Libraries.math, Libraries.cats, Libraries.equinoxOSGi, Libraries.shapeless),
171
  Libraries.addScalaLang(scalaVersionValue),
172
  defaultActivator
173
) dependsOn(
174
175
176
177
178
179
  event,
  exception,
  tools,
  workspace,
  pluginManager,
  serializer,
180
  outputManager,
181
182
  console,
  context,
183
184
  preference,
  expansion,
185
  threadProvider,
186
  code,
187
  networkService,
188
189
  keyword,
  csv) settings (coreSettings: _*)
190

191
lazy val serializer = OsgiProject(coreDir, "org.openmole.core.serializer", global = true, imports = Seq("*")) settings(
192
193
  libraryDependencies += Libraries.xstream,
  libraryDependencies += Libraries.equinoxOSGi
Mathieu Leclaire's avatar
Mathieu Leclaire committed
194
) dependsOn(workspace, pluginManager, fileService, tools, openmoleTar, console) settings (coreSettings: _*)
195

196
lazy val communication = OsgiProject(coreDir, "org.openmole.core.communication", imports = Seq("*")) dependsOn(workflow, workspace) settings (coreSettings: _*)
197

198
lazy val openmoleDSL = OsgiProject(coreDir, "org.openmole.core.dsl", imports = Seq("*")) settings (
199
  libraryDependencies += Libraries.squants) dependsOn(workflow, logconfig, csv) settings (coreSettings: _*) settings (defaultActivator)
200

201
lazy val exception = OsgiProject(coreDir, "org.openmole.core.exception", imports = Seq("*")) settings (coreSettings: _*)
202

203
204
205
lazy val csv = OsgiProject(coreDir, "org.openmole.core.csv", imports = Seq("*")) dependsOn(context) settings (coreSettings: _*) settings(
  libraryDependencies += Libraries.opencsv)

206
lazy val tools = OsgiProject(coreDir, "org.openmole.core.tools", global = true, imports = Seq("*")) settings
207
  (libraryDependencies ++= Seq(Libraries.xstream, Libraries.exec, Libraries.math, Libraries.scalatest, Libraries.equinoxOSGi), Libraries.addScalaLang(scalaVersionValue)) dependsOn
208
  (exception, openmoleTar, openmoleFile, openmoleLock, openmoleThread, openmoleHash, openmoleLogger, openmoleStream, openmoleCollection, openmoleStatistics, openmoleTypes, openmoleCache, openmoleRandom, openmoleNetwork, openmoleException, openmoleOutputRedirection, openmoleLogger) settings (coreSettings: _*)
209

210
lazy val event = OsgiProject(coreDir, "org.openmole.core.event", imports = Seq("*")) dependsOn (tools) settings (coreSettings: _*)
211

Mathieu's avatar
Mathieu committed
212
lazy val code = OsgiProject(coreDir, "org.openmole.core.code", imports = Seq("*")) dependsOn(tools, workspace) settings (coreSettings: _*)
213
214


215
lazy val replication = OsgiProject(coreDir, "org.openmole.core.replication", imports = Seq("*")) settings (
216
  libraryDependencies ++= Seq(Libraries.slick, Libraries.xstream, Libraries.guava)) settings (coreSettings: _*) dependsOn(db, preference, workspace, openmoleCache)
217

218
lazy val db = OsgiProject(coreDir, "org.openmole.core.db", imports = Seq("*")) settings (
219
  libraryDependencies ++= Seq(Libraries.slick, Libraries.xstream, Libraries.h2, Libraries.scopt)) settings (coreSettings: _*) dependsOn(openmoleNetwork, exception, openmoleCrypto, openmoleFile, openmoleLogger)
220

221
lazy val preference = OsgiProject(coreDir, "org.openmole.core.preference", imports = Seq("*")) settings(
222
  libraryDependencies ++= Seq(Libraries.configuration, Libraries.squants), Libraries.addScalaLang(scalaVersionValue)) settings (coreSettings: _*) dependsOn(openmoleNetwork, openmoleCrypto, openmoleFile, openmoleThread, openmoleTypes, openmoleLock, exception)
223
224
225

lazy val workspace = OsgiProject(coreDir, "org.openmole.core.workspace", imports = Seq("*")) dependsOn
  (exception, event, tools, openmoleCrypto) settings (coreSettings: _*)
226

227
lazy val authentication = OsgiProject(coreDir, "org.openmole.core.authentication", imports = Seq("*")) dependsOn(workspace, serializer) settings (coreSettings: _*)
228

229
lazy val services = OsgiProject(coreDir, "org.openmole.core.services", imports = Seq("*")) dependsOn(workspace, serializer, preference, fileService, networkService, threadProvider, replication, authentication, openmoleOutputRedirection) settings (coreSettings: _*)
230

231
lazy val location = OsgiProject(coreDir, "org.openmole.core.location", imports = Seq("*")) dependsOn (exception) settings (coreSettings: _*)
232
233


234
235
236
lazy val pluginManager = OsgiProject(
  coreDir,
  "org.openmole.core.pluginmanager",
237
  imports = Seq("*")
Mathieu's avatar
Mathieu committed
238
) settings (defaultActivator) dependsOn(exception, tools, location) settings (coreSettings: _*)
239

240
lazy val fileService = OsgiProject(coreDir, "org.openmole.core.fileservice", imports = Seq("*")) dependsOn(tools, workspace, openmoleTar, preference, threadProvider) settings (coreSettings: _*) settings (defaultActivator) settings (libraryDependencies += Libraries.guava)
241

242
lazy val networkService = OsgiProject(coreDir, "org.openmole.core.networkservice", imports = Seq("*")) dependsOn(tools, workspace, preference) settings (coreSettings: _*) settings (defaultActivator)
243

244
lazy val threadProvider = OsgiProject(coreDir, "org.openmole.core.threadprovider", imports = Seq("*")) dependsOn(tools, preference) settings (coreSettings: _*) settings (defaultActivator)
245

246
lazy val module = OsgiProject(coreDir, "org.openmole.core.module", imports = Seq("*")) dependsOn(buildinfo, expansion, openmoleHash, openmoleFile, pluginManager) settings (coreSettings: _*) settings(
247
  libraryDependencies ++= Libraries.gridscaleHTTP,
248
249
  libraryDependencies += Libraries.json4s,
  defaultActivator)
250

251
lazy val market = OsgiProject(coreDir, "org.openmole.core.market", imports = Seq("*")) enablePlugins (ScalaJSPlugin) dependsOn(buildinfo, expansion, openmoleHash, openmoleFile, pluginManager) settings (coreSettings: _*) settings(
252
  libraryDependencies ++= Libraries.gridscaleHTTP,
253
254
  libraryDependencies += Libraries.json4s,
  defaultActivator)
255

256
lazy val logconfig = OsgiProject(
257
  coreDir,
258
259
  "org.openmole.core.logconfig",
  imports = Seq("*")
Mathieu's avatar
Mathieu committed
260
) settings(libraryDependencies ++= Seq(Libraries.log4j, Libraries.logback, Libraries.slf4j), defaultActivator) dependsOn (tools) settings (coreSettings: _*)
261

262
263
lazy val outputManager = OsgiProject(coreDir, "org.openmole.core.outputmanager", imports = Seq("*")) dependsOn (openmoleStream) settings (coreSettings: _*) settings (defaultActivator)

264
lazy val console = OsgiProject(coreDir, "org.openmole.core.console", global = true, imports = Seq("*"), exports = Seq("org.openmole.core.console.*", "$line5.*")) dependsOn (pluginManager) settings(
265
  OsgiKeys.importPackage := Seq("*"),
266
  Libraries.addScalaLang(scalaVersionValue),
267
  libraryDependencies += Libraries.monocle,
268
269
  macroParadise,
  defaultActivator
270
) dependsOn(openmoleOSGi, workspace, fileService) settings (coreSettings: _*)
271

272
273
274
lazy val project = OsgiProject(coreDir, "org.openmole.core.project", imports = Seq("*")) dependsOn(console, openmoleDSL, services) settings (OsgiKeys.importPackage := Seq("*")) settings (coreSettings: _*) settings (
  Libraries.addScalaLang(scalaVersionValue)
)
275

Mathieu's avatar
Mathieu committed
276
lazy val buildinfo = OsgiProject(coreDir, "org.openmole.core.buildinfo", imports = Seq("*")) enablePlugins (BuildInfoPlugin) settings(
277
  //sourceGenerators in Compile += buildInfo.taskValue,
278
279
280
281
  (sourceGenerators in Compile) := Seq(
    Def.taskDyn {
      val src = (sourceManaged in Compile).value
      val buildInfoDirectory = src / "sbt-buildinfo"
Mathieu's avatar
Mathieu committed
282
283
284
      if (buildInfoDirectory.exists && !buildInfoDirectory.list().isEmpty) Def.task {
        buildInfoDirectory.listFiles.toSeq
      }
285
286
287
      else (buildInfo in Compile)
    }.taskValue
  ),
288
  buildInfoKeys :=
289
290
291
292
293
294
295
296
297
298
    Seq[BuildInfoKey](
      name,
      version,
      scalaVersion,
      sbtVersion,
      BuildInfoKey.action("buildTime") {
        System.currentTimeMillis
      }
    ),
  buildInfoPackage := s"org.openmole.core.buildinfo"
Mathieu Leclaire's avatar
Mathieu Leclaire committed
299
) settings (coreSettings: _*)
300
301
302
303
304
305


/* ------------- Plugins ----------- */


def pluginDir = file("plugins")
306
def corePlugins =
307
308
309
310
311
312
313
314
315
316
  allTask ++
    allSource ++
    allSampling ++
    allMethod ++
    allHook ++
    allGrouping ++
    allEnvironment ++
    allDomain ++
    allTools

317
def allTools = Seq(netLogoAPI, netLogo5API, netLogo6API, csvTool, pattern, json)
318

319
lazy val defaultActivator = OsgiKeys.bundleActivator := Some(name.value + ".Activator")
320
321

def pluginSettings =
322
  defaultSettings ++ Seq(
323
324
325
326
327
328
329
330
331
332
333
334
    defaultActivator,
    libraryDependencies += Libraries.equinoxOSGi,
    libraryDependencies += Libraries.scalatest
  )


/* Tools */

def toolsSettings = defaultSettings ++ Seq(OsgiKeys.bundleActivator := None, libraryDependencies += Libraries.scalatest)



335
lazy val netLogoAPI = OsgiProject(pluginDir, "org.openmole.plugin.tool.netlogo", imports = Seq("*")) settings(
336
337
  autoScalaLibrary := false,
  crossPaths := false
Mathieu Leclaire's avatar
Mathieu Leclaire committed
338
) settings (toolsSettings: _*)
339
340


341
lazy val netLogo5API = OsgiProject(pluginDir, "org.openmole.plugin.tool.netlogo5", imports = Seq("*")) dependsOn (netLogoAPI) settings(
342
343
  crossPaths := false,
  autoScalaLibrary := false,
344
  libraryDependencies += Libraries.netlogo5 intransitive(),
345
  libraryDependencies -= Libraries.scalatest
Mathieu Leclaire's avatar
Mathieu Leclaire committed
346
) settings (toolsSettings: _*)
347

348
349
350
351
352
353
354
355

lazy val netLogo6API = OsgiProject(pluginDir, "org.openmole.plugin.tool.netlogo6", imports = Seq("*")) dependsOn (netLogoAPI) settings(
  crossPaths := false,
  autoScalaLibrary := false,
  libraryDependencies += Libraries.netlogo6 intransitive(),
  libraryDependencies -= Libraries.scalatest
) settings (toolsSettings: _*)

356
lazy val csvTool = OsgiProject(pluginDir, "org.openmole.plugin.tool.csv", imports = Seq("*")) dependsOn(exception, openmoleDSL) settings(
357
  libraryDependencies += Libraries.opencsv, defaultActivator) settings (toolsSettings: _*)
358

359
lazy val pattern = OsgiProject(pluginDir, "org.openmole.plugin.tool.pattern", imports = Seq("*")) dependsOn(exception, openmoleDSL) settings (toolsSettings: _*) settings (defaultActivator)
360
361


362
363
364
365
366
lazy val json = OsgiProject(pluginDir, "org.openmole.plugin.tool.json", imports = Seq("*")) dependsOn(exception, openmoleDSL) settings (toolsSettings: _*) settings (
  libraryDependencies += Libraries.json4s,
  libraryDependencies += Libraries.shapeless)


367
368
/* Domain */

369
def allDomain = Seq(collectionDomain, distributionDomain, fileDomain, modifierDomain, rangeDomain, boundsDomain)
370

371
lazy val collectionDomain = OsgiProject(pluginDir, "org.openmole.plugin.domain.collection", imports = Seq("*")) dependsOn (openmoleDSL) settings (pluginSettings: _*)
372

373
374
lazy val distributionDomain = OsgiProject(pluginDir, "org.openmole.plugin.domain.distribution", imports = Seq("*")) dependsOn (openmoleDSL) settings
  (libraryDependencies ++= Seq(Libraries.math)) settings (pluginSettings: _*)
375

376
lazy val fileDomain = OsgiProject(pluginDir, "org.openmole.plugin.domain.file", imports = Seq("*")) dependsOn (openmoleDSL) settings (pluginSettings: _*)
377

378
lazy val modifierDomain = OsgiProject(pluginDir, "org.openmole.plugin.domain.modifier", imports = Seq("*")) dependsOn (openmoleDSL) settings (
379
  libraryDependencies += Libraries.scalatest) settings (pluginSettings: _*)
380

381
lazy val rangeDomain = OsgiProject(pluginDir, "org.openmole.plugin.domain.range", imports = Seq("*")) dependsOn (openmoleDSL) settings (pluginSettings: _*)
382

383
384
lazy val boundsDomain = OsgiProject(pluginDir, "org.openmole.plugin.domain.bounds", imports = Seq("*")) dependsOn (openmoleDSL) settings (pluginSettings: _*)

385
386
387

/* Environment */

388
def allEnvironment = Seq(batch, gridscale, ssh, egi, pbs, oar, sge, condor, slurm)
389

390
lazy val batch = OsgiProject(pluginDir, "org.openmole.plugin.environment.batch", imports = Seq("*")) dependsOn(
391
  workflow, workspace, tools, event, replication, exception,
392
393
  serializer, fileService, pluginManager, openmoleTar, communication, authentication, location, services,
  openmoleByteCode
Mathieu Leclaire's avatar
Mathieu Leclaire committed
394
) settings (
395
396
397
398
399
400
401
402
  libraryDependencies ++= Seq(
    Libraries.gridscale,
    Libraries.h2,
    Libraries.guava,
    Libraries.jasypt,
    Libraries.slick
  )
  ) settings (pluginSettings: _*)
403

404
405
406

//lazy val cluster = OsgiProject(pluginDir, "org.openmole.plugin.environment.cluster", imports = Seq("*")) dependsOn(openmoleDSL, batch, gridscale, ssh) settings (pluginSettings: _*)

407
408
lazy val oar = OsgiProject(pluginDir, "org.openmole.plugin.environment.oar", imports = Seq("*")) dependsOn(openmoleDSL, batch, gridscale, ssh) settings
  (libraryDependencies += Libraries.gridscaleOAR) settings (pluginSettings: _*)
409

Mathieu's avatar
Mathieu committed
410

411
lazy val egi = OsgiProject(pluginDir, "org.openmole.plugin.environment.egi") dependsOn(openmoleDSL, batch, workspace, fileService, gridscale) settings(
412
  libraryDependencies ++= Libraries.gridscaleEGI, Libraries.addScalaLang(scalaVersionValue)) settings (pluginSettings: _*)
413

Mathieu's avatar
Mathieu committed
414
415
lazy val gridscale = OsgiProject(pluginDir, "org.openmole.plugin.environment.gridscale", imports = Seq("*")) settings (
  libraryDependencies += Libraries.gridscaleLocal) dependsOn(openmoleDSL, tools, batch, exception) settings (pluginSettings: _*)
416

417
418
lazy val pbs = OsgiProject(pluginDir, "org.openmole.plugin.environment.pbs", imports = Seq("*")) dependsOn(openmoleDSL, batch, gridscale, ssh) settings
  (libraryDependencies += Libraries.gridscalePBS) settings (pluginSettings: _*)
419

420
421
lazy val sge = OsgiProject(pluginDir, "org.openmole.plugin.environment.sge", imports = Seq("*")) dependsOn(openmoleDSL, batch, gridscale, ssh) settings
  (libraryDependencies += Libraries.gridscaleSGE) settings (pluginSettings: _*)
422

423
424
lazy val condor = OsgiProject(pluginDir, "org.openmole.plugin.environment.condor", imports = Seq("*")) dependsOn(openmoleDSL, batch, gridscale, ssh) settings
  (libraryDependencies += Libraries.gridscaleCondor) settings (pluginSettings: _*)
425

426
427
lazy val slurm = OsgiProject(pluginDir, "org.openmole.plugin.environment.slurm", imports = Seq("*")) dependsOn(openmoleDSL, batch, gridscale, ssh) settings
  (libraryDependencies += Libraries.gridscaleSLURM) settings (pluginSettings: _*)
428

429
lazy val ssh = OsgiProject(pluginDir, "org.openmole.plugin.environment.ssh", imports = Seq("*")) dependsOn(openmoleDSL, event, batch, gridscale) settings
Romain Reuillon's avatar
Romain Reuillon committed
430
  (libraryDependencies ++= Libraries.gridscaleSSH) settings (pluginSettings: _*)
431
432
433
434
435
436


/* Grouping */

def allGrouping = Seq(batchGrouping, onvariableGrouping)

437
lazy val batchGrouping = OsgiProject(pluginDir, "org.openmole.plugin.grouping.batch", imports = Seq("*")) dependsOn(exception, workflow, workspace) settings (pluginSettings: _*)
438

439
lazy val onvariableGrouping = OsgiProject(pluginDir, "org.openmole.plugin.grouping.onvariable", imports = Seq("*")) dependsOn(exception, workflow) settings (pluginSettings: _*)
440
441
442
443
444
445


/* Hook */

def allHook = Seq(displayHook, fileHook, modifierHook)

446
lazy val displayHook = OsgiProject(pluginDir, "org.openmole.plugin.hook.display", imports = Seq("*")) dependsOn (openmoleDSL) settings (pluginSettings: _*)
447

448
lazy val fileHook = OsgiProject(pluginDir, "org.openmole.plugin.hook.file", imports = Seq("*")) dependsOn(openmoleDSL, csvTool, replication % "test") settings (
449
  libraryDependencies += Libraries.scalatest
450
  ) settings (pluginSettings: _*)
451
452
453

lazy val modifierHook = OsgiProject(pluginDir, "org.openmole.plugin.hook.modifier", imports = Seq("*")) dependsOn (openmoleDSL) settings (
  libraryDependencies += Libraries.scalatest
454
  ) settings (pluginSettings: _*)
455
456
457
458


/* Method */

459
def allMethod = Seq(evolution, directSampling, sensitivity, abc)
460

461
lazy val evolution = OsgiProject(pluginDir, "org.openmole.plugin.method.evolution", imports = Seq("*")) dependsOn(
462
  openmoleDSL, csvTool, toolsTask, pattern, collectionDomain % "test", boundsDomain % "test"
463
) settings(libraryDependencies += Libraries.mgo, libraryDependencies += Libraries.shapeless) settings (pluginSettings: _*)
464

465
466
lazy val abc = OsgiProject(pluginDir, "org.openmole.plugin.method.abc", imports = Seq("*")) dependsOn(openmoleDSL, csvTool, toolsTask, pattern) settings
  (libraryDependencies += Libraries.mgo, libraryDependencies += Libraries.shapeless) settings (pluginSettings: _*)
467

468
lazy val directSampling = OsgiProject(pluginDir, "org.openmole.plugin.method.directsampling", imports = Seq("*")) dependsOn(openmoleDSL, distributionDomain, pattern, modifierDomain, fileHook) settings (pluginSettings: _*)
469

470
lazy val sensitivity = OsgiProject(pluginDir, "org.openmole.plugin.method.sensitivity", imports = Seq("*")) dependsOn(exception, workflow, workspace, openmoleDSL, lhsSampling, directSampling) settings (pluginSettings: _*)
471

472
473
474

/* Sampling */

Juste Raimbault's avatar
Juste Raimbault committed
475
// FIXME problem with osgi bundling for spatialSampling
476
def allSampling = Seq(combineSampling, csvSampling,oneFactorSampling, lhsSampling, quasirandomSampling, spatialSampling)
477

478
lazy val combineSampling = OsgiProject(pluginDir, "org.openmole.plugin.sampling.combine", imports = Seq("*")) dependsOn(exception, modifierDomain, collectionDomain, workflow) settings (pluginSettings: _*)
479

480
lazy val csvSampling = OsgiProject(pluginDir, "org.openmole.plugin.sampling.csv", imports = Seq("*")) dependsOn(exception, workflow, csvTool) settings (
481
  libraryDependencies += Libraries.scalatest
482
  ) settings (pluginSettings: _*)
483

484
485
lazy val oneFactorSampling = OsgiProject(pluginDir, "org.openmole.plugin.sampling.onefactor", imports = Seq("*")) dependsOn(exception, workflow, openmoleDSL) settings (pluginSettings: _*)

486
lazy val lhsSampling = OsgiProject(pluginDir, "org.openmole.plugin.sampling.lhs", imports = Seq("*")) dependsOn(exception, workflow, workspace, openmoleDSL) settings (pluginSettings: _*)
487

488
lazy val quasirandomSampling = OsgiProject(pluginDir, "org.openmole.plugin.sampling.quasirandom", imports = Seq("*")) dependsOn(exception, workflow, workspace) settings (
489
  libraryDependencies += Libraries.math
490
  ) settings (pluginSettings: _*)
491

492

493
lazy val spatialSampling = OsgiProject(pluginDir, "org.openmole.plugin.sampling.spatial", imports = Seq("*")) dependsOn(exception, workflow, workspace) settings (
494
495
  libraryDependencies += Libraries.math,
  libraryDependencies += Libraries.spatialdata
496
497
  ) settings (pluginSettings: _*)

498
499
500
501
502

/* Source */

def allSource = Seq(fileSource)

503
lazy val fileSource = OsgiProject(pluginDir, "org.openmole.plugin.source.file", imports = Seq("*")) dependsOn(openmoleDSL, serializer, exception, csvTool) settings (pluginSettings: _*)
504
505
506
507


/* Task */

Juste Raimbault's avatar
Juste Raimbault committed
508
def allTask = Seq(toolsTask, external, netLogo, netLogo5, netLogo6, jvm, scala, template, systemexec, container, care, udocker, r, scilab, python, timing)
509

510
lazy val toolsTask = OsgiProject(pluginDir, "org.openmole.plugin.task.tools", imports = Seq("*")) dependsOn (openmoleDSL) settings (pluginSettings: _*)
511

512
lazy val external = OsgiProject(pluginDir, "org.openmole.plugin.task.external", imports = Seq("*")) dependsOn(openmoleDSL, workspace) settings (pluginSettings: _*)
513

514
lazy val netLogo = OsgiProject(pluginDir, "org.openmole.plugin.task.netlogo", imports = Seq("*")) dependsOn(openmoleDSL, external, netLogoAPI) settings (pluginSettings: _*)
515

516
lazy val netLogo5 = OsgiProject(pluginDir, "org.openmole.plugin.task.netlogo5") dependsOn(netLogo, openmoleDSL, external, netLogo5API) settings (pluginSettings: _*)
517

518
519
lazy val netLogo6 = OsgiProject(pluginDir, "org.openmole.plugin.task.netlogo6") dependsOn(netLogo, openmoleDSL, external, netLogo6API) settings (pluginSettings: _*)

520
lazy val jvm = OsgiProject(pluginDir, "org.openmole.plugin.task.jvm", imports = Seq("*")) dependsOn(openmoleDSL, external, workspace) settings (pluginSettings: _*)
521

522
lazy val scala = OsgiProject(pluginDir, "org.openmole.plugin.task.scala", imports = Seq("*")) dependsOn(openmoleDSL, jvm, console) settings (pluginSettings: _*)
523

524
lazy val template = OsgiProject(pluginDir, "org.openmole.plugin.task.template", imports = Seq("*")) dependsOn(openmoleDSL, replication % "test") settings (
525
  libraryDependencies += Libraries.scalatest) settings (pluginSettings: _*)
526

527
528
lazy val systemexec = OsgiProject(pluginDir, "org.openmole.plugin.task.systemexec", imports = Seq("*")) dependsOn(openmoleDSL, external, workspace) settings (
  libraryDependencies += Libraries.exec) settings (pluginSettings: _*)
529

530
lazy val container = OsgiProject(pluginDir, "org.openmole.plugin.task.container", imports = Seq("*")) dependsOn(openmoleFile, pluginManager, external, expansion, exception) settings (pluginSettings: _*)
531

532
lazy val care = OsgiProject(pluginDir, "org.openmole.plugin.task.care", imports = Seq("*")) dependsOn(systemexec, container) settings (
533
  libraryDependencies += Libraries.scalatest) settings (pluginSettings: _*)
534

535
lazy val udocker = OsgiProject(pluginDir, "org.openmole.plugin.task.udocker", imports = Seq("!jawn.*", "*")) dependsOn(systemexec, container, openmoleOutputRedirection, networkService, services) settings(
536
  libraryDependencies += Libraries.scalatest,
537
  libraryDependencies += Libraries.circe,
538
  libraryDependencies ++= Libraries.httpClient) settings (pluginSettings: _*)
539

540
lazy val r = OsgiProject(pluginDir, "org.openmole.plugin.task.r", imports = Seq("*")) dependsOn (udocker, json) settings (pluginSettings: _*)
541

542
543
lazy val scilab = OsgiProject(pluginDir, "org.openmole.plugin.task.scilab", imports = Seq("*")) dependsOn (udocker) settings (pluginSettings: _*)

Juste Raimbault's avatar
Juste Raimbault committed
544
545
lazy val python = OsgiProject(pluginDir, "org.openmole.plugin.task.python", imports = Seq("*")) dependsOn (udocker, json) settings (pluginSettings: _*)

Juste Raimbault's avatar
Juste Raimbault committed
546
547
lazy val timing = OsgiProject(pluginDir, "org.openmole.plugin.task.timing", imports = Seq("*")) dependsOn (openmoleDSL) settings (pluginSettings: _*)

548

549
550
551
552
553
554
555
556
557
558
559
/* ---------------- REST ------------------- */


def restDir = file("rest")

lazy val message = OsgiProject(restDir, "org.openmole.rest.message") settings (defaultSettings: _*)

lazy val server = OsgiProject(
  restDir,
  "org.openmole.rest.server",
  imports = Seq("org.h2", "!com.sun.*", "*")
560
) dependsOn(workflow, openmoleTar, openmoleCollection, project, message, openmoleCrypto, services) settings(
561
  libraryDependencies ++= Seq(Libraries.bouncyCastle, Libraries.logback, Libraries.scalatra, Libraries.arm, Libraries.codec, Libraries.json4s), Libraries.addScalaLang(scalaVersionValue)) settings (defaultSettings: _*)
562
563


564
lazy val client = Project("org-openmole-rest-client", restDir / "client") settings(
565
  libraryDependencies ++= Libraries.httpClient,
Romain Reuillon's avatar
Romain Reuillon committed
566
  libraryDependencies += "org.json4s" %% "json4s-jackson" % Libraries.json4sVersion
Mathieu Leclaire's avatar
Mathieu Leclaire committed
567
) dependsOn(message, openmoleTar) settings (defaultSettings: _*)
568
569
570
571
572
573
574
575
576



/* -------------------- GUI --------------------- */


def guiDir = file("gui")

def guiExt = guiDir / "ext"
577
def guiExtTarget = guiExt / "target"
578

579
580
581

/* -------------------- Ext ----------------------*/

582
lazy val dataGUI = OsgiProject(guiExt, "org.openmole.gui.ext.data") enablePlugins (ScalaJSPlugin) settings(
583
  Libraries.scalaTagsJS,
584
585
  Libraries.scalajsDomJS,
  libraryDependencies += Libraries.monocle
Mathieu Leclaire's avatar
Mathieu Leclaire committed
586
) settings (defaultSettings: _*)
587

588
lazy val extServerTool = OsgiProject(guiExt, "org.openmole.gui.ext.tool.server") dependsOn(dataGUI, workspace, module) settings(
Mathieu Leclaire's avatar
Mathieu Leclaire committed
589
  libraryDependencies += Libraries.autowire,
Mathieu's avatar
Mathieu committed
590
  libraryDependencies += Libraries.boopickle
Mathieu Leclaire's avatar
Mathieu Leclaire committed
591
) settings (defaultSettings: _*)
Mathieu Leclaire's avatar
Mathieu Leclaire committed
592

593
lazy val extClientTool = OsgiProject(guiExt, "org.openmole.gui.ext.tool.client") enablePlugins (ScalaJSPlugin) dependsOn(dataGUI, sharedGUI) settings(
Mathieu's avatar
Mathieu committed
594
  Libraries.boopickleJS,
595
596
597
  Libraries.autowireJS,
  Libraries.rxJS,
  Libraries.scalajsDomJS,
Mathieu's avatar
Mathieu committed
598
599
  Libraries.scaladgetTools,
  Libraries.bootstrapnative,
600
  Libraries.scalaTagsJS
Mathieu Leclaire's avatar
Mathieu Leclaire committed
601
) settings (defaultSettings: _*)
602

603
lazy val extPluginGUIServer = OsgiProject(guiExt, "org.openmole.gui.ext.plugin.server") dependsOn(extServerTool, services) settings (
604
  libraryDependencies += Libraries.equinoxOSGi) settings (defaultSettings: _*)
605

606
lazy val sharedGUI = OsgiProject(guiExt, "org.openmole.gui.ext.api") dependsOn(dataGUI, market) settings (defaultSettings: _*)
607

608
lazy val jsCompile = OsgiProject(guiServerDir, "org.openmole.gui.server.jscompile", imports = Seq("*")) dependsOn(pluginManager, fileService, workspace, dataGUI) settings (defaultSettings: _*) settings(
609
  libraryDependencies += "org.scala-js" %% "scalajs-library" % Libraries.scalajsVersion % "provided" intransitive(),
610
  libraryDependencies += Libraries.scalajsTools,
611
612
  (resourceDirectories in Compile) += (crossTarget.value / "resources"),
  (OsgiKeys.embeddedJars) := {
613
614
615
616
617
618
619
620
621
    val scalaLib =
      (Keys.externalDependencyClasspath in Compile).value.filter {
        d => d.data.getName startsWith "scalajs-library"
      }.head

    val dest = crossTarget.value / "resources/scalajs-library.jar"
    dest.getParentFile.mkdirs()
    sbt.IO.copyFile(scalaLib.data, dest)
    Seq()
622
  })
623

Mathieu Leclaire's avatar
Mathieu Leclaire committed
624
def guiClientDir = guiDir / "client"
Mathieu's avatar
Mathieu committed
625
lazy val clientGUI = OsgiProject(guiClientDir, "org.openmole.gui.client.core") enablePlugins (ExecNpmPlugin) dependsOn
Mathieu Leclaire's avatar
Mathieu Leclaire committed
626
  (sharedGUI, clientToolGUI, market, dataGUI, extClientTool) settings(
627
  libraryDependencies += Libraries.async,
628
  npmDeps in Compile += Dep("ace-builds/src-min", "1.4.3", List("mode-scala.js", "theme-github.js", "ext-language_tools.js"), true),
629
  npmDeps in Compile += Dep("sortablejs", "1.7.0", List("Sortable.min.js"))
630
) settings (defaultSettings: _*)
631
632


633
lazy val clientToolGUI = OsgiProject(guiClientDir, "org.openmole.gui.client.tool", privatePackages = Seq("autowire.*", "boopickle.*", "sourcecode.*", "rx.*", "org.scalajs.dom.*", "scalatags.*", "scaladget.*", "net.scalapro.sortable.*", "com.definitelyscala.plotlyjs.*", "org.querki.jsext.*")) enablePlugins (ScalaJSPlugin) dependsOn (workspace) settings(
634
  Libraries.autowireJS,
Mathieu's avatar
Mathieu committed
635
  Libraries.boopickleJS,
636
637
  Libraries.scalajsDomJS,
  Libraries.scalaTagsJS,
Mathieu's avatar
Mathieu committed
638
  Libraries.ace,
Mathieu's avatar
Mathieu committed
639
640
  Libraries.bootstrapnative,
  Libraries.scaladgetTools,
Mathieu's avatar
Mathieu committed
641
  Libraries.rxJS,
642
643
  Libraries.sortable,
  Libraries.plotlyJS) dependsOn (extClientTool) settings (defaultSettings: _*)
644
645


646
/* -------------------------- Server ----------------------- */
647

648
649
650
def guiServerDir = guiDir / "server"

lazy val serverGUI = OsgiProject(guiServerDir, "org.openmole.gui.server.core") settings
Mathieu's avatar
Mathieu committed
651
  (libraryDependencies ++= Seq(Libraries.arm, Libraries.autowire, Libraries.boopickle, Libraries.circe, Libraries.scalaTags, Libraries.logback, Libraries.scalatra, Libraries.clapper, Libraries.opencsv)) dependsOn(
652
653
654
655
656
657
658
659
660
661
  sharedGUI,
  dataGUI,
  workflow,
  buildinfo,
  openmoleFile,
  openmoleTar,
  openmoleCollection,
  project,
  openmoleDSL,
  batch,
662
663
  //egi,
  //ssh,
664
665
666
667
668
  openmoleStream,
  txtmark,
  openmoleCrypto,
  module,
  market,
669
670
  extServerTool,
  extPluginGUIServer,
671
672
673
  jsCompile,
  services,
  location
Mathieu Leclaire's avatar
Mathieu Leclaire committed
674
) settings (defaultSettings: _*)
675

676
677
/* -------------------- GUI Plugin ----------------------- */

Mathieu Leclaire's avatar
Mathieu Leclaire committed
678
def guiPluginSettings = defaultSettings ++ Seq(defaultActivator)
679

680
681
def guiPluginDir = guiDir / "plugins"

682
lazy val guiEnvironmentEGIPlugin = OsgiProject(guiPluginDir, "org.openmole.gui.plugin.authentication.egi") settings(
683
  guiPluginSettings,
Mathieu's avatar
Mathieu committed
684
685
  libraryDependencies += Libraries.equinoxOSGi,
  Libraries.bootstrapnative
686
) dependsOn(extPluginGUIServer, extClientTool, dataGUI, workspace, egi) enablePlugins (ScalaJSPlugin)
687

688
689
lazy val guiEnvironmentSSHKeyPlugin = OsgiProject(guiPluginDir, "org.openmole.gui.plugin.authentication.sshkey") settings(
  guiPluginSettings,
Mathieu's avatar
Mathieu committed
690
691
  libraryDependencies += Libraries.equinoxOSGi,
  Libraries.bootstrapnative
692
) dependsOn(extPluginGUIServer, extClientTool, dataGUI, workspace, ssh) enablePlugins (ScalaJSPlugin)
693
694
695

lazy val guiEnvironmentSSHLoginPlugin = OsgiProject(guiPluginDir, "org.openmole.gui.plugin.authentication.sshlogin") settings(
  guiPluginSettings,
Mathieu's avatar
Mathieu committed
696
697
  libraryDependencies += Libraries.equinoxOSGi,
  Libraries.bootstrapnative
698
) dependsOn(extPluginGUIServer, extClientTool, dataGUI, workspace, ssh) enablePlugins (ScalaJSPlugin)
699

700
lazy val netlogoWizardPlugin = OsgiProject(guiPluginDir, "org.openmole.gui.plugin.wizard.netlogo", imports = Seq("!org.scalajs.*", "!rx.*", "!scaladget.*", "*")) settings(
701
702
  guiPluginSettings,
  libraryDependencies += Libraries.equinoxOSGi
703
) dependsOn(extPluginGUIServer, extClientTool, extServerTool, workspace) enablePlugins (ScalaJSPlugin)
704
705
706
707
708

lazy val nativeWizardPlugin = OsgiProject(guiPluginDir, "org.openmole.gui.plugin.wizard.native") settings(
  guiPluginSettings,
  libraryDependencies += Libraries.equinoxOSGi,
  libraryDependencies += Libraries.arm
709
) dependsOn(extPluginGUIServer, extClientTool, extServerTool, workspace) enablePlugins (ScalaJSPlugin)
710

711
712
713
lazy val rWizardPlugin = OsgiProject(guiPluginDir, "org.openmole.gui.plugin.wizard.r") settings(
  guiPluginSettings,
  libraryDependencies += Libraries.equinoxOSGi,
714
) dependsOn(extPluginGUIServer, extClientTool, extServerTool, workspace) enablePlugins (ScalaJSPlugin)
715

716
717
718
lazy val jarWizardPlugin = OsgiProject(guiPluginDir, "org.openmole.gui.plugin.wizard.jar") settings(
  guiPluginSettings,
  libraryDependencies += Libraries.equinoxOSGi,
719
) dependsOn(extPluginGUIServer, extClientTool, extServerTool, workspace) enablePlugins (ScalaJSPlugin)
720
721
722
723
724
725

val guiPlugins = Seq(
  guiEnvironmentSSHLoginPlugin,
  guiEnvironmentSSHKeyPlugin,
  guiEnvironmentEGIPlugin,
  netlogoWizardPlugin,