summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2023-10-16 23:16:20 +0100
committerArun Isaac2023-10-16 23:16:20 +0100
commit4d33357a6540b678e41d66dbd3563709b34bbe55 (patch)
tree9aecc7413a9e6c46ea954249cdb499a2002e9a68
parentd2e34b132a36978fc227ab9301c4407ea13212cb (diff)
downloadccwl-4d33357a6540b678e41d66dbd3563709b34bbe55.tar.gz
ccwl-4d33357a6540b678e41d66dbd3563709b34bbe55.tar.lz
ccwl-4d33357a6540b678e41d66dbd3563709b34bbe55.zip
ccwl: Add #:requirements argument to command.
* ccwl/ccwl.scm (<command>)[requirements]: New field. (command): Add #:requirements argument. * ccwl/cwl.scm (command->cwl-scm): Serialize requirements.
-rw-r--r--ccwl/ccwl.scm7
-rw-r--r--ccwl/cwl.scm1
2 files changed, 6 insertions, 2 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm
index f193ea9..fc6a152 100644
--- a/ccwl/ccwl.scm
+++ b/ccwl/ccwl.scm
@@ -44,6 +44,7 @@
command-stdin
command-stderr
command-stdout
+ command-requirements
command-other
cwl-workflow?
cwl-workflow
@@ -188,7 +189,7 @@
(_ (error "Invalid output:" (syntax->datum output-spec)))))
(define-immutable-record-type <command>
- (make-command inputs outputs args stdin stderr stdout other)
+ (make-command inputs outputs args stdin stderr stdout requirements other)
command?
(inputs command-inputs set-command-inputs)
(outputs command-outputs)
@@ -196,6 +197,7 @@
(stdin command-stdin)
(stderr command-stderr)
(stdout command-stdout)
+ (requirements command-requirements)
(other command-other))
(define-immutable-record-type <cwl-workflow>
@@ -352,7 +354,7 @@ identifiers defined in the commands."
(condition (ccwl-violation extra)
(formatted-message "Unexpected extra positional argument ~a in command definition"
(syntax->datum extra))))))))
- (apply (syntax-lambda** (#:key stdin stderr stdout (other #''()) #:key* inputs outputs run)
+ (apply (syntax-lambda** (#:key stdin stderr stdout (requirements #''()) (other #''()) #:key* inputs outputs run)
(when (null? run)
(raise-exception
(condition (ccwl-violation x)
@@ -381,6 +383,7 @@ identifiers defined in the commands."
(condition (ccwl-violation stdout)
(formatted-message "#:stdout parameter must be a string")))
stdout)
+ #,requirements
#,other))
#'(args ...)))))))
diff --git a/ccwl/cwl.scm b/ccwl/cwl.scm
index 30a6cb9..6c28175 100644
--- a/ccwl/cwl.scm
+++ b/ccwl/cwl.scm
@@ -120,6 +120,7 @@ CWL YAML specification."
"Render COMMAND, a <command> object, into a CWL tree."
`((cwlVersion . ,%cwl-version)
(class . CommandLineTool)
+ (requirements . ,(command-requirements command))
,@(command-other command)
(arguments . ,(list->vector
;; Put string arguments into the arguments array.