Commit 262e4870 authored by Juste Raimbault's avatar Juste Raimbault
Browse files

[Plugin] JuliaTask: fix

parent 0cc11899
...@@ -27,13 +27,13 @@ import org.openmole.plugin.task.container ...@@ -27,13 +27,13 @@ import org.openmole.plugin.task.container
*/ */
object JuliaTask { object JuliaTask {
implicit def isTask: InputOutputBuilder[PythonTask] = InputOutputBuilder(PythonTask.config) implicit def isTask: InputOutputBuilder[JuliaTask] = InputOutputBuilder(JuliaTask.config)
implicit def isExternal: ExternalBuilder[PythonTask] = ExternalBuilder(PythonTask.external) implicit def isExternal: ExternalBuilder[JuliaTask] = ExternalBuilder(JuliaTask.external)
implicit def isInfo = InfoBuilder(info) implicit def isInfo = InfoBuilder(info)
implicit def isMapped = MappedInputOutputBuilder(PythonTask.mapped) implicit def isMapped = MappedInputOutputBuilder(JuliaTask.mapped)
def installCommands(install: Seq[String], libraries: Seq[String]): Vector[String] = { def installCommands(install: Seq[String], libraries: Seq[String]): Vector[String] = {
(install ++ "julia -e 'using Pkg; Pkg.add.([ " + libraries.dropRight(1).map { l "\""+l+"\", " }.reduce(+)+"\""+libraries.last+"\"" +"])'" ).toVector (install ++ Seq("julia -e 'using Pkg; Pkg.add.([ " + libraries.map { l "\""+l+"\"" }.mkString(",")+"])'" )).toVector
} }
def apply( def apply(
...@@ -54,7 +54,7 @@ object JuliaTask { ...@@ -54,7 +54,7 @@ object JuliaTask {
new JuliaTask( new JuliaTask(
script = script, script = script,
arguments = arguments.option, arguments = arguments.option,
image = ContainerTask.prepare(installContainerSystem, DockerImage("julia"), installCommands(install, libraries)), image = ContainerTask.prepare(installContainerSystem, DockerImage("julia"), installCommands(install, Seq("JSON")++libraries)),
errorOnReturnValue = errorOnReturnValue, errorOnReturnValue = errorOnReturnValue,
returnValue = returnValue, returnValue = returnValue,
stdOut = stdOut, stdOut = stdOut,
...@@ -65,8 +65,7 @@ object JuliaTask { ...@@ -65,8 +65,7 @@ object JuliaTask {
config = InputOutputConfig(), config = InputOutputConfig(),
external = External(), external = External(),
info = InfoConfig(), info = InfoConfig(),
mapped = MappedInputOutputConfig(), mapped = MappedInputOutputConfig()
major = major
) set (outputs += (Seq(returnValue.option, stdOut.option, stdErr.option).flatten: _*)) ) set (outputs += (Seq(returnValue.option, stdOut.option, stdErr.option).flatten: _*))
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment