Commit 1f850978 authored by Bas Lijnse's avatar Bas Lijnse

Merge branch 'master' into 180-run-interactive-tests-as-independent-programs

parents 2ccf973b 44b03802
......@@ -714,7 +714,7 @@ externalProcessExample =
enterInformation "Enter the path to the external process. To for instance open a shell run '/bin/bash' or 'c:\\Windows\\System32\\cmd.exe'." [] >>= \path ->
withShared
Nothing
( \sds -> ( externalProcess () path [] Nothing sds True handlers gEditor{|*|} <<@ ApplyLayout (removeSubUIs (SelectByPath [])) >&>
( \sds -> ( externalProcess () path [] Nothing sds handlers Nothing gEditor{|*|} <<@ ApplyLayout (removeSubUIs (SelectByPath [])) >&>
viewSharedInformation "Process output" []
) -&&-
forever (enterInformation "Enter data to send to StdIn" [] >>= \data -> set (Just (data +++ "\n")) sds)
......
......@@ -71,7 +71,7 @@ where
runWithOutput :: FilePath [String] (Maybe FilePath) (Shared [String]) -> Task (ExitCode,[String])
runWithOutput prog args dir out
= externalProcess () prog args dir out False {onStartup=onStartup,onOutData=onOutData,onErrData=onErrData,onShareChange=onShareChange,onExit=onExit} gEditor{|*|}
= externalProcess () prog args dir out {onStartup=onStartup,onOutData=onOutData,onErrData=onErrData,onShareChange=onShareChange,onExit=onExit} Nothing gEditor{|*|}
where
onStartup r = (Ok (ExitCode 0,[]), Nothing, [], False)
onOutData data (e,o) r = (Ok (e,o ++ [data]), Just (r ++ [data]), [], False)
......
......@@ -6,6 +6,7 @@ from iTasks.WF.Tasks.Interaction import :: ViewOption
from System.FilePath import :: FilePath
from System.OSError import :: OSError, :: OSErrorCode, :: OSErrorMessage
from System.Process import :: ProcessPtyOptions
//* External (operating system) process status
:: ProcessInformation =
......@@ -32,14 +33,14 @@ instance toString CallException
* @param Executable: path to the executable
* @param Arguments: a list of command-line arguments
* @param Optional startup directory
* @param Run with pseudo terminal
* @param Run with pseudo terminal options
* @return return-code of the process
* @throws CallException
*
* @gin-title Start executable
* @gin-icon executable
*/
callProcess :: !d ![ViewOption ProcessInformation] !FilePath ![String] !(Maybe FilePath) !Bool -> Task ProcessInformation | toPrompt d
callProcess :: !d ![ViewOption ProcessInformation] !FilePath ![String] !(Maybe FilePath) (Maybe ProcessPtyOptions) -> Task ProcessInformation | toPrompt d
/**
* Calls an external executable. This call blocks task computation, only use when process is known to terminate fast.
......
......@@ -18,13 +18,13 @@ where
toString (CallFailed (_,err)) = "Error calling external process: " +++ err
callProcess :: !d ![ViewOption ProcessInformation] !FilePath ![String] !(Maybe FilePath) !Bool -> Task ProcessInformation | toPrompt d
callProcess :: !d ![ViewOption ProcessInformation] !FilePath ![String] !(Maybe FilePath) (Maybe ProcessPtyOptions) -> Task ProcessInformation | toPrompt d
callProcess prompt [ViewAs tof:_] executable arguments workingDirectory pty
= externalProcess prompt executable arguments workingDirectory unitShare pty (callProcessHandlers executable arguments) (comapEditorValue tof gEditor{|*|})
= externalProcess prompt executable arguments workingDirectory unitShare (callProcessHandlers executable arguments) pty (comapEditorValue tof gEditor{|*|})
callProcess prompt [ViewUsing tof editor:_] executable arguments workingDirectory pty
= externalProcess prompt executable arguments workingDirectory unitShare pty (callProcessHandlers executable arguments) (comapEditorValue tof editor)
= externalProcess prompt executable arguments workingDirectory unitShare (callProcessHandlers executable arguments) pty (comapEditorValue tof editor)
callProcess prompt _ executable arguments workingDirectory pty
= externalProcess prompt executable arguments workingDirectory unitShare pty (callProcessHandlers executable arguments) gEditor{|*|}
= externalProcess prompt executable arguments workingDirectory unitShare (callProcessHandlers executable arguments) pty gEditor{|*|}
callProcessHandlers executable arguments
= {onStartup = onStartup, onOutData = onOutData, onErrData = onErrData, onShareChange = onShareChange, onExit = onExit}
......
......@@ -6,7 +6,8 @@ from TCPIP import class ChannelEnv, :: IPAddress, :: Timeout
from Internet.HTTP import :: HTTPRequest, :: HTTPResponse
from System.FilePath import :: FilePath
from System.Time import :: Timestamp
from System.Time import :: Timestamp
from System.Process import :: ProcessPtyOptions
from Data.Error import :: MaybeError
from iTasks.WF.Definition import :: TaskId
from iTasks.Internal.IWorld import :: IWorld, :: BackgroundTaskId
......@@ -23,7 +24,7 @@ addListener :: !TaskId !Int !Bool !ConnectionTask !*IWorld -> (!MaybeError TaskE
addConnection :: !TaskId !String !Int !ConnectionTask !*IWorld -> (!MaybeError TaskException Dynamic,!*IWorld)
//Dynamically add an external process
addExternalProc :: !TaskId !FilePath ![String] !(Maybe FilePath) !Bool !ExternalProcessTask !IWorld -> (!MaybeError TaskException Dynamic, !*IWorld)
addExternalProc :: !TaskId !FilePath ![String] !(Maybe FilePath) !ExternalProcessTask (!Maybe ProcessPtyOptions) !IWorld -> (!MaybeError TaskException Dynamic, !*IWorld)
//Dynamically add a background task
addBackgroundTask :: !BackgroundTask !*IWorld -> (!MaybeError TaskException BackgroundTaskId,!*IWorld)
......
......@@ -538,7 +538,7 @@ where
= case mbConn of
Nothing = (Error ("Failed to connect to host " +++ host), {iworld & world = world})
Just channel = (Ok (ip, channel), {iworld & world = world})
onInitHandler :: !IPAddress !Dynamic !*IWorld -> (!MaybeErrorString Dynamic, !Maybe Dynamic, ![String], !Bool, !*IWorld)
onInitHandler ip r iworld = handlers.ConnectionHandlersIWorld.onConnect (toString ip) r iworld
......@@ -547,17 +547,19 @@ where
# opts = {ConnectionInstanceOpts|taskId = taskId, connectionId = 0, remoteHost = ip, connectionTask = connectionTask, removeOnClose = False}
= ConnectionInstance opts channel
addExternalProc :: !TaskId !FilePath ![String] !(Maybe FilePath) !Bool !ExternalProcessTask !IWorld -> (!MaybeError TaskException Dynamic, !*IWorld)
addExternalProc taskId cmd args dir pty extProcTask=:(ExternalProcessTask handlers sds) iworld
addExternalProc :: !TaskId !FilePath ![String] !(Maybe FilePath) !ExternalProcessTask (!Maybe 'Process'.ProcessPtyOptions) !IWorld -> (!MaybeError TaskException Dynamic, !*IWorld)
addExternalProc taskId cmd args dir extProcTask=:(ExternalProcessTask handlers sds) mopts iworld
= addIOTask taskId sds init externalProcessIOOps onInitHandler mkIOTaskInstance iworld
where
init :: !*IWorld -> (!MaybeErrorString (!(), (!ProcessHandle, !ProcessIO)), !*IWorld)
init iworld
# (mbRes, world) = (if pty 'Process'.runProcessPty 'Process'.runProcessIO) cmd args dir iworld.world
# (mbRes, world) = case mopts of
Nothing = 'Process'.runProcessIO cmd args dir iworld.world
Just opts = 'Process'.runProcessPty cmd args dir opts iworld.world
= case mbRes of
Error (_, e) = (Error e, {iworld & world = world})
Ok proc = (Ok ((), proc), {iworld & world = world})
onInitHandler :: !() !Dynamic !*IWorld -> (!MaybeErrorString Dynamic, !Maybe Dynamic, ![String], !Bool, !*IWorld)
onInitHandler _ r iworld
# (mbl, mbw, out, close) = handlers.ExternalProcessHandlers.onStartup r
......
......@@ -4,7 +4,7 @@ import StdString
import StdOverloaded
import iTasks.Internal.Tonic.AbsSyn
import qualified Data.Map as DM
from Data.Map import instance Functor Map
from Data.Map import instance Functor (Map k)
import qualified Data.IntMap.Strict as DIS
from Data.IntMap.Strict import :: IntMap
import Data.Functor
......
......@@ -13,6 +13,7 @@ from Text.JSON import :: JSONNode
//# UIContainer
container :: Editor ()
containerl :: (Editor a) -> Editor [a]
containerL :: [Editor a] -> Editor [a]
container1 :: (Editor a) -> Editor a
container2 :: (Editor a) (Editor b) -> Editor (a,b)
container3 :: (Editor a) (Editor b) (Editor c) -> Editor (a,b,c)
......@@ -22,6 +23,7 @@ container5 :: (Editor a) (Editor b) (Editor c) (Editor d) (Editor e) -> Editor (
//# UIPanel
panel :: Editor ()
panell :: (Editor a) -> Editor [a]
panelL :: [Editor a] -> Editor [a]
panel1 :: (Editor a) -> Editor a
panel2 :: (Editor a) (Editor b) -> Editor (a,b)
panel3 :: (Editor a) (Editor b) (Editor c) -> Editor (a,b,c)
......@@ -31,6 +33,7 @@ panel5 :: (Editor a) (Editor b) (Editor c) (Editor d) (Editor e) -> Editor (a,b,
//# UITabSet
tabset :: Editor ()
tabsetl :: (Editor a) -> Editor [a]
tabsetL :: [Editor a] -> Editor [a]
tabset1 :: (Editor a) -> Editor a
tabset2 :: (Editor a) (Editor b) -> Editor (a,b)
tabset3 :: (Editor a) (Editor b) (Editor c) -> Editor (a,b,c)
......@@ -40,6 +43,7 @@ tabset5 :: (Editor a) (Editor b) (Editor c) (Editor d) (Editor e) -> Editor (a,b
//# UIWindow
window :: Editor ()
windowl :: (Editor a) -> Editor [a]
windowL :: [Editor a] -> Editor [a]
window1 :: (Editor a) -> Editor a
window2 :: (Editor a) (Editor b) -> Editor (a,b)
window3 :: (Editor a) (Editor b) (Editor c) -> Editor (a,b,c)
......@@ -49,6 +53,7 @@ window5 :: (Editor a) (Editor b) (Editor c) (Editor d) (Editor e) -> Editor (a,b
//# UIMenu
menu :: Editor ()
menul :: (Editor a) -> Editor [a]
menuL :: [Editor a] -> Editor [a]
menu1 :: (Editor a) -> Editor a
menu2 :: (Editor a) (Editor b) -> Editor (a,b)
menu3 :: (Editor a) (Editor b) (Editor c) -> Editor (a,b,c)
......@@ -58,6 +63,7 @@ menu5 :: (Editor a) (Editor b) (Editor c) (Editor d) (Editor e) -> Editor (a,b,c
//# UIToolBar
toolbar :: Editor ()
toolbarl :: (Editor a) -> Editor [a]
toolbarL :: [Editor a] -> Editor [a]
toolbar1 :: (Editor a) -> Editor a
toolbar2 :: (Editor a) (Editor b) -> Editor (a,b)
toolbar3 :: (Editor a) (Editor b) (Editor c) -> Editor (a,b,c)
......@@ -67,6 +73,7 @@ toolbar5 :: (Editor a) (Editor b) (Editor c) (Editor d) (Editor e) -> Editor (a,
//# UIButtonBar
buttonbar :: Editor ()
buttonbarl :: (Editor a) -> Editor [a]
buttonbarL :: [Editor a] -> Editor [a]
buttonbar1 :: (Editor a) -> Editor a
buttonbar2 :: (Editor a) (Editor b) -> Editor (a,b)
buttonbar3 :: (Editor a) (Editor b) (Editor c) -> Editor (a,b,c)
......@@ -76,6 +83,7 @@ buttonbar5 :: (Editor a) (Editor b) (Editor c) (Editor d) (Editor e) -> Editor (
//# UIList
list :: Editor ()
listl :: (Editor a) -> Editor [a]
listL :: [Editor a] -> Editor [a]
list1 :: (Editor a) -> Editor a
list2 :: (Editor a) (Editor b) -> Editor (a,b)
list3 :: (Editor a) (Editor b) (Editor c) -> Editor (a,b,c)
......@@ -85,6 +93,7 @@ list5 :: (Editor a) (Editor b) (Editor c) (Editor d) (Editor e) -> Editor (a,b,c
//# UIListItem
listitem :: Editor ()
listiteml :: (Editor a) -> Editor [a]
listitemL :: [Editor a] -> Editor [a]
listitem1 :: (Editor a) -> Editor a
listitem2 :: (Editor a) (Editor b) -> Editor (a,b)
listitem3 :: (Editor a) (Editor b) (Editor c) -> Editor (a,b,c)
......@@ -94,6 +103,7 @@ listitem5 :: (Editor a) (Editor b) (Editor c) (Editor d) (Editor e) -> Editor (a
//# UIDebug
debug :: Editor ()
debugl :: (Editor a) -> Editor [a]
debugL :: [Editor a] -> Editor [a]
debug1 :: (Editor a) -> Editor a
debug2 :: (Editor a) (Editor b) -> Editor (a,b)
debug3 :: (Editor a) (Editor b) (Editor c) -> Editor (a,b,c)
......
......@@ -63,6 +63,49 @@ where
onRefreshAll dp i [] os ms vst //Elements have been removed from the list
= (Ok (repeatn (length os) (i,RemoveChild),[]),[],vst)
groupL :: UIType [Editor a] -> Editor [a]
groupL type editors = {Editor|genUI=genUI,onEdit=onEdit,onRefresh=onRefresh}
where
genUI dp val vst = case genUIAll 0 editors dp val vst of
(Error e,vst) = (Error e,vst)
(Ok (uis,masks),vst) = (Ok (UI type emptyAttr uis, CompoundMask {CompoundMask|fields=masks,state=JSONNull}),vst)
genUIAll i _ dp [] vst = (Ok ([],[]),vst)
genUIAll i [ed:eds] dp [v:vs] vst = case ed.Editor.genUI (dp ++ [i]) v vst of
(Error e,vst) = (Error e,vst)
(Ok (ui,m),vst) = case genUIAll (i + 1) eds dp vs vst of
(Error e,vst) = (Error e,vst)
(Ok (uis,ms),vst) = (Ok ([ui:uis],[m:ms]),vst)
onEdit dp ([i:tp],e) val (CompoundMask {CompoundMask|fields=masks}) vst
| i < 0 || i >= length val || i >= length masks = (Error "Event route out of range",val,vst)
= case (editors !! i).Editor.onEdit (dp ++ [i]) (tp,e) (val !! i) (masks !! i) vst of
(Error e,ival,vst) = (Error e,val,vst)
(Ok (NoChange,imask),ival,vst)
= (Ok (NoChange,CompoundMask {CompoundMask|fields=updateAt i imask masks,state=JSONNull}),updateAt i ival val,vst)
(Ok (change,imask),ival,vst)
= (Ok (ChangeUI [] [(i,ChangeChild change)],CompoundMask {CompoundMask|fields=updateAt i imask masks,state=JSONNull}),updateAt i ival val, vst)
onRefresh dp new old (CompoundMask {CompoundMask|fields=masks}) vst = case onRefreshAll 0 editors dp new old masks vst of
(Error e,val,vst) = (Error e,val,vst)
(Ok ([],masks),val,vst) = (Ok (NoChange,CompoundMask {CompoundMask|fields=masks,state=JSONNull}),val,vst)
(Ok (changes,masks),val,vst) = (Ok (ChangeUI [] changes,CompoundMask {CompoundMask|fields=masks,state=JSONNull}),new,vst)
onRefreshAll i [ed:eds] dp [n:ns] [o:os] [m:ms] vst
= case ed.Editor.onRefresh (dp ++ [i]) n o m vst of
(Error e,v,vst) = (Error e,[],vst)
(Ok (c,m),v,vst) = case onRefreshAll (i + 1) eds dp ns os ms vst of
(Error e,vs,vst) = (Error e,vs,vst)
(Ok (cs,ms),vs,vst) = (Ok ([(i,ChangeChild c):cs],[m:ms]),[v:vs],vst)
onRefreshAll i [ed:eds] dp ns [] _ vst //There are new elements in the list
= case genUIAll i eds dp ns vst of
(Error e,vst) = (Error e,[],vst)
(Ok (us,ms),vst) = (Ok ([(n,InsertChild u) \\ u <- us & n <- [i..]],ms),ns,vst)
onRefreshAll i eds dp [] os ms vst //Elements have been removed from the list
= (Ok (repeatn (length os) (i,RemoveChild),[]),[],vst)
group1 :: UIType (Editor a) -> Editor a
group1 type editor1 = {Editor|genUI=genUI,onEdit=onEdit,onRefresh=onRefresh}
where
......@@ -277,6 +320,9 @@ container = group UIContainer
containerl :: (Editor a) -> Editor [a]
containerl e = groupl UIContainer e
containerL :: [Editor a] -> Editor [a]
containerL e = groupL UIContainer e
container1 :: (Editor a) -> Editor a
container1 e1 = group1 UIContainer e1
......@@ -299,6 +345,9 @@ panel = group UIPanel
panell :: (Editor a) -> Editor [a]
panell e = groupl UIPanel e
panelL :: [Editor a] -> Editor [a]
panelL e = groupL UIPanel e
panel1 :: (Editor a) -> Editor a
panel1 e1 = group1 UIPanel e1
......@@ -321,6 +370,9 @@ tabset = group UITabSet
tabsetl :: (Editor a) -> Editor [a]
tabsetl e = groupl UITabSet e
tabsetL :: [Editor a] -> Editor [a]
tabsetL e = groupL UITabSet e
tabset1 :: (Editor a) -> Editor a
tabset1 e1 = group1 UITabSet e1
......@@ -343,6 +395,9 @@ window = group UIWindow
windowl :: (Editor a) -> Editor [a]
windowl e = groupl UIWindow e
windowL :: [Editor a] -> Editor [a]
windowL e = groupL UIWindow e
window1 :: (Editor a) -> Editor a
window1 e1 = group1 UIWindow e1
......@@ -365,6 +420,9 @@ menu = group UIMenu
menul :: (Editor a) -> Editor [a]
menul e = groupl UIMenu e
menuL :: [Editor a] -> Editor [a]
menuL e = groupL UIMenu e
menu1 :: (Editor a) -> Editor a
menu1 e1 = group1 UIMenu e1
......@@ -387,6 +445,9 @@ toolbar = group UIToolBar
toolbarl :: (Editor a) -> Editor [a]
toolbarl e = groupl UIToolBar e
toolbarL :: [Editor a] -> Editor [a]
toolbarL e = groupL UIToolBar e
toolbar1 :: (Editor a) -> Editor a
toolbar1 e1 = group1 UIToolBar e1
......@@ -409,6 +470,9 @@ buttonbar = group UIButtonBar
buttonbarl :: (Editor a) -> Editor [a]
buttonbarl e = groupl UIButtonBar e
buttonbarL :: [Editor a] -> Editor [a]
buttonbarL e = groupL UIButtonBar e
buttonbar1 :: (Editor a) -> Editor a
buttonbar1 e1 = group1 UIButtonBar e1
......@@ -431,6 +495,9 @@ list = group UIList
listl :: (Editor a) -> Editor [a]
listl e = groupl UIList e
listL :: [Editor a] -> Editor [a]
listL e = groupL UIList e
list1 :: (Editor a) -> Editor a
list1 e1 = group1 UIList e1
......@@ -453,6 +520,9 @@ listitem = group UIListItem
listiteml :: (Editor a) -> Editor [a]
listiteml e = groupl UIListItem e
listitemL :: [Editor a] -> Editor [a]
listitemL e = groupL UIListItem e
listitem1 :: (Editor a) -> Editor a
listitem1 e1 = group1 UIListItem e1
......@@ -475,6 +545,9 @@ debug = group UIDebug
debugl :: (Editor a) -> Editor [a]
debugl e = groupl UIDebug e
debugL :: [Editor a] -> Editor [a]
debugL e = groupL UIDebug e
debug1 :: (Editor a) -> Editor a
debug1 e1 = group1 UIDebug e1
......
......@@ -689,24 +689,28 @@ where
| otherwise
= ([],items)
adjustRemSiblings selection path whichSiblings children = adjust 0 [] children
adjustRemSiblings selection path whichSiblings children = (changes, reverse items)
where
(changes, items) = adjust 0 [] children
adjust :: !Int ![MvUIChild] ![MvUIChild] -> (![(!Int,!UIChildChange)],![MvUIChild])
adjust i before [] = ([],before)
adjust i before [MvUIItem item:children]
| item.MvUI.deleted
= adjust i (before ++ [MvUIItem item]) children //Ignore deleted branches
= adjust i [MvUIItem item : before] children //Ignore deleted branches
| whichSiblings i
# (cchange, items) = adjustRem selection (path ++ [i]) NoChange item
# change = case cchange of
(ChangeChild NoChange) = []
(ChangeChild (ChangeUI [] [])) = []
(ChangeChild change) = [(adjustIndex i before,cchange)]
# (changes, children) = adjust (i + 1) (before ++ map MvUIItem items) children
(ChangeChild change) = [(adjustIndex i (reverse before),cchange)]
# (changes, children) = adjust (i + 1) (map MvUIItem (reverse items) ++ before) children
= (change ++ changes, children)
| otherwise
= adjust (i + 1) (before ++ [MvUIItem item]) children
= adjust (i + 1) [MvUIItem item : before] children
adjust i before [child:children]
= adjust i (before ++ [child]) children
= adjust i [child : before] children
adjustIns Nothing path mvuis = (NoChange, removeDeleted mvuis)
adjustIns (Just dst) path mvuis
......@@ -1058,6 +1062,8 @@ where
adjustSiblings path whichSiblings items states = adjust 0 items states
where
adjust :: !Int ![UI] ![(!Int, !LayoutTree LayoutState ())]
-> (![(!Int, !UIChildChange)], ![UI], ![(!Int, !LayoutTree LayoutState ())])
adjust i [] states = ([],[],states)
adjust i [item:items] states
| whichSiblings i
......
......@@ -7,6 +7,7 @@ import iTasks.WF.Definition
from iTasks.SDS.Definition import :: RWShared, :: SDS
from iTasks.UI.Prompt import class toPrompt
from System.FilePath import :: FilePath
from System.Process import :: ProcessPtyOptions
from Data.Error import :: MaybeError, :: MaybeErrorString
:: ConnectionHandlers l r w =
......@@ -31,11 +32,12 @@ from Data.Error import :: MaybeError, :: MaybeErrorString
* @param a list of command-line arguments
* @param (optional) startup directory
* @param A reference to shared data the task has access to
* @param A flag whether to open a pseudotty
* @param The event handler functions
* @param Optionally the pseudotty settings
* @param An editor for visualizing the local state
*/
externalProcess :: !d !FilePath ![String] !(Maybe FilePath) !(SDS () r w) !Bool !(ExternalProcessHandlers l r w) !(Editor l) -> Task l | toPrompt d & iTask l & TC r & TC w
externalProcess :: !d !FilePath ![String] !(Maybe FilePath) !(SDS () r w) !(ExternalProcessHandlers l r w) !(Maybe ProcessPtyOptions) !(Editor l) -> Task l | toPrompt d & iTask l & TC r & TC w
/**
* Connect to an external system using TCP. This task's value becomes stable when the connection is closed
* @param Hostname
......
......@@ -13,6 +13,7 @@ import iTasks.Internal.TaskServer
import iTasks.Internal.Generic.Visualization
import iTasks.Internal.Generic.Defaults
import System.Process
import Text, Text.JSON, StdString, StdInt
import qualified Data.Map as DM
import qualified Data.Set as DS
......@@ -33,11 +34,11 @@ import qualified Data.Set as DS
, onExit :: !(ExitCode l r -> (!MaybeErrorString l, !Maybe w ))
}
externalProcess :: !d !FilePath ![String] !(Maybe FilePath) !(SDS () r w) !Bool !(ExternalProcessHandlers l r w) !(Editor l) -> Task l | toPrompt d & iTask l & TC r & TC w
externalProcess prompt cmd args dir sds pty handlers editor = Task eval
externalProcess :: !d !FilePath ![String] !(Maybe FilePath) !(SDS () r w) !(ExternalProcessHandlers l r w) !(Maybe ProcessPtyOptions) !(Editor l) -> Task l | toPrompt d & iTask l & TC r & TC w
externalProcess prompt cmd args dir sds handlers mopts editor = Task eval
where
eval event evalOpts tree=:(TCInit taskId ts) iworld
= case addExternalProc taskId cmd args dir pty (wrapExternalProcTask handlers sds) iworld of
= case addExternalProc taskId cmd args dir (wrapExternalProcTask handlers sds) mopts iworld of
(Error e, iworld)
= (ExceptionResult e, iworld)
(Ok (initialValue :: l^), iworld)
......
......@@ -216,7 +216,7 @@ where
runBuildTool directory moduleName
= get cpmExecutable
>>- \cpm -> callProcess () [] cpm [addExtension moduleName "prj"] (Just directory) False
>>- \cpm -> callProcess () [] cpm [addExtension moduleName "prj"] (Just directory) Nothing
>>* [OnAction ActionClose (ifStable return)] //Pause after command...
setExecutable directory moduleName state
......@@ -228,12 +228,12 @@ where
>>- maybe (throw "Cannot run the program. There is no executable yet")
(\executable ->
makeExecutable executable
>>- \_ -> callProcess () [] executable ["-port","8084"] (Just temporaryDirectory) False
>>- \_ -> callProcess () [] executable ["-port","8084"] (Just temporaryDirectory) Nothing
>>* [OnAction ActionClose (always (return ()))] //Pause after command...
)
) @! ()
where
makeExecutable path = callProcess () [] "chmod" ["+x",path] Nothing False
makeExecutable path = callProcess () [] "chmod" ["+x",path] Nothing Nothing
:: SourceTreeQualityMetrics =
{ numFiles :: Int
......
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