Skip to content

Instantly share code, notes, and snippets.

@pgrosu
Created April 28, 2016 16:59
Show Gist options
  • Save pgrosu/07a9e5c3fde3af824412c9e53a64e6d8 to your computer and use it in GitHub Desktop.
Save pgrosu/07a9e5c3fde3af824412c9e53a64e6d8 to your computer and use it in GitHub Desktop.
Yaml Output of the CommandLineTool object
!!org.commonwl.lang.CommandLineTool
arguments: null
baseCommand: wc
class: null
cwlVersion: null
description: null
hints: null
id: null
inputs:
- {default: null, description: null, format: null, id: null, inputBinding: null, label: null,
secondaryFiles: null, streamable: null, type: File}
- null
label: null
outputs:
- description: null
format: null
id: null
label: null
outputBinding: {glob: output, loadContents: null, outputEval: null}
secondaryFiles: null
streamable: null
type: null
- null
- null
permanentFailCodes: null
requirements: null
stdin: inputs.file1.path
stdout: output
successCodes: null
temporaryFailCodes: null
// Compile: ./compile-demo2yaml.sh
//
// Run: ./run-demo2yaml.sh wc-tool.cwl wc-job.json > CommandLineTool_YamlOutput.txt
import java.util.*;
import org.commonwl.lang.*;
import org.commonwl.util.*;
import org.yaml.snakeyaml.*;
public class CommandLineToolDemo2YamlOutput {
public static void main( String [] args ) throws Exception {
CWLReader tool = new CWLReader( args[0] );
tool.processFile();
CommandLineTool CommandLineTool_Instance = tool.getCommandLineToolInstance();
Yaml yaml = new Yaml();
String output = yaml.dump(CommandLineTool_Instance);
System.out.println(output);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment