From 4d33357a6540b678e41d66dbd3563709b34bbe55 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 16 Oct 2023 23:16:20 +0100 Subject: ccwl: Add #:requirements argument to command. * ccwl/ccwl.scm ()[requirements]: New field. (command): Add #:requirements argument. * ccwl/cwl.scm (command->cwl-scm): Serialize requirements. --- ccwl/ccwl.scm | 7 +++++-- ccwl/cwl.scm | 1 + 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 - (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 @@ -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 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. -- cgit v1.2.3