Fixed behavior of multi-step builds.

* Output from the main strawboss executable is properly directed to stdout
  and stderr.
* Added threshold logging to strawboss core functions.
* Fixed a bug in the way dependent steps were detected and executed.
  The logic for checking if prior steps had already been executed was only
  executed once when the initial step was prepared, not for any of the
  dependent steps. This logic has been moved into the main work block for
  executing steps.
* Renamed `initiateRun` to `run` and  `runStep` to `doRun` to be more accurate.
* Dependent steps get their owng, independent copy of the workspace.
* Updated the test project to provide a test target.
This commit is contained in:
Jonathan Bernard
2017-11-24 20:29:41 -06:00
parent 573903bda0
commit 58fbbc048c
8 changed files with 134 additions and 66 deletions

View File

@ -8,8 +8,8 @@ let SB_VER = "0.2.0"
proc logProcOutput*(outMsg, errMsg: TaintedString, cmd: string) =
let prefix = if cmd != nil: cmd else: ""
if outMsg != nil: echo prefix & "(stdout): " & outMsg
if errMsg != nil: echo prefix & "(stderr): " & errMsg
if outMsg != nil: stdout.writeLine prefix & outMsg
if errMsg != nil: stderr.writeLine prefix & errMsg
when isMainModule:
@ -51,7 +51,7 @@ Options
if req.workspaceDir.isNilOrEmpty: req.workspaceDir = mkdtemp()
let status = core.initiateRun(cfg, req, logProcOutput)
let status = core.run(cfg, req, logProcOutput)
if status.state == BuildState.failed: raiseEx status.details
echo "strawboss: build passed."
except: