From 9a354d0b99da83f60ab68f0151d6f0d5488b7a93 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 11 Oct 2021 14:40:42 +0530 Subject: ccwl: Factorize out CWL generation code to separate file. This factorization is required to support other compilation targets such as graphviz, bash, scheme, etc. * ccwl/cwl.scm: New file. * Makefile.am (SOURCES): Register it. * ccwl/ccwl.scm (ccwl): Export command?, command-inputs, command-outputs, command-args, command-stdin, command-other, workflow?, workflow-steps, workflow-inputs, workflow-outputs, workflow-other, input?, input-id, input-type, input-label, input-default, input-position, input-prefix, input-other, output?, output-id, output-type, output-binding, output-source, output-other, step?, step-id, step-run, step-in, step-out, unspecified-default?. (): New type. (filter-alist): Move to cwl.scm. (make-workflow): Refactor into workflow->cwl-scm in cwl.scm. (output->cwl): Move to cwl.scm as output->cwl-scm. (command->cwl): Move to cwl.scm as command->cwl-scm. (workflow-steps): Rename to collect-steps. Clarify docstring. (workflow): Use collect-steps instead of workflow-steps. Explicitly pass empty list as other argument of make-workflow. Add TODO note to implement it properly. * scripts/ccwl.in: Import (ccwl cwl) instead of (ccwl yaml). Use workflow->cwl instead of scm->yaml. * tests/ccwl.scm ("stdin input should not have inputBinding"): Use command->cwl-scm from (ccwl cwl) instead of command->cwl from (ccwl ccwl). --- scripts/ccwl.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/ccwl.in b/scripts/ccwl.in index 939cdf2..d0145d7 100755 --- a/scripts/ccwl.in +++ b/scripts/ccwl.in @@ -27,15 +27,15 @@ (use-modules (ice-9 match) (ccwl ccwl) - (ccwl yaml)) + (ccwl cwl)) (match (command-line) ((_ "compile" input-file) ;; FIXME: Compiling ccwl files fails since the workflow macro is ;; unable to access command definitions. (set! %load-should-auto-compile #f) - (scm->yaml (load (canonicalize-path input-file)) - (current-output-port))) + (workflow->cwl (load (canonicalize-path input-file)) + (current-output-port))) ((program _ ...) (format (current-error-port) "Usage: ~a compile input-file~%" -- cgit v1.2.3