Skip to content

Commit e08a279

Browse files
committed
initial support for CWL v1.1
1 parent 2435c91 commit e08a279

File tree

444 files changed

+36912
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

444 files changed

+36912
-0
lines changed

Diff for: adding_new_cwl_versions.txt

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# discover the valid CWL files from the conformance tests:
2+
3+
cd ~/cwl-v1.1 # my local checkout of https://github.com/common-workflow-language/cwl-v1.1/
4+
git ls-files -- tests | grep cwl$ | xargs -I{} bash -c 'cwltool --relax-path-checks --validate {} >/dev/null 2>/dev/null && echo {}' > valid_examples.txt
5+
#git ls-files -- tests | grep cwl$ | xargs -I{} bash -c 'cwltool --relax-path-checks --validate {} >/dev/null 2>/dev/null || echo {}' > invalid_examples.txt
6+
mkdir valid-examples; for file in $(cat valid_examples.txt); do cp ${file} valid-examples/valid_$(basename ${file}) ; done
7+
8+
# build the Java parser
9+
schema-salad-tool --codegen java --codegen-package org.w3id.cwl.cwl1_1 --codegen-examples ~/cwl-v1.1/valid-examples ~/cwl-v1.1/CommonWorkflowLanguage.yml
10+
11+
mvn test
12+
# copy missing files into ./src/test/resources/org/w3id/cwl/cwl1_1/utils

Diff for: src/main/java/org/w3id/cwl/cwl1_1/Any.java

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright Common Workflow Language project contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package org.w3id.cwl.cwl1_1;
16+
17+
import org.w3id.cwl.cwl1_1.utils.ValidationException;
18+
19+
public enum Any {
20+
ANY("Any");
21+
22+
private static String[] symbols = new String[] {"Any"};
23+
private String docVal;
24+
25+
private Any(final String docVal) {
26+
this.docVal = docVal;
27+
}
28+
29+
public static Any fromDocumentVal(final String docVal) {
30+
for(final Any val : Any.values()) {
31+
if(val.docVal.equals(docVal)) {
32+
return val;
33+
}
34+
}
35+
throw new ValidationException(String.format("Expected one of %s", Any.symbols, docVal));
36+
}
37+
}

Diff for: src/main/java/org/w3id/cwl/cwl1_1/ArraySchema.java

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright Common Workflow Language project contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package org.w3id.cwl.cwl1_1;
16+
17+
import org.w3id.cwl.cwl1_1.utils.Saveable;
18+
19+
/**
20+
* Auto-generated interface for <I>https://w3id.org/cwl/salad#ArraySchema</I><BR>This interface is implemented by {@link ArraySchemaImpl}<BR>
21+
*/
22+
public interface ArraySchema extends Saveable {
23+
/**
24+
* Getter for property <I>https://w3id.org/cwl/salad#items</I><BR>
25+
* <BLOCKQUOTE>
26+
* Defines the type of the array elements. * </BLOCKQUOTE>
27+
*/
28+
29+
Object getItems();
30+
/**
31+
* Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
32+
* <BLOCKQUOTE>
33+
* Must be `array` * </BLOCKQUOTE>
34+
*/
35+
36+
enum_d062602be0b4b8fd33e69e29a841317b6ab665bc getType();
37+
}
+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
// Copyright Common Workflow Language project contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package org.w3id.cwl.cwl1_1;
16+
17+
import org.w3id.cwl.cwl1_1.utils.LoaderInstances;
18+
import org.w3id.cwl.cwl1_1.utils.LoadingOptions;
19+
import org.w3id.cwl.cwl1_1.utils.LoadingOptionsBuilder;
20+
import org.w3id.cwl.cwl1_1.utils.SaveableImpl;
21+
import org.w3id.cwl.cwl1_1.utils.ValidationException;
22+
23+
/**
24+
* Auto-generated class implementation for <I>https://w3id.org/cwl/salad#ArraySchema</I><BR>
25+
*/
26+
public class ArraySchemaImpl extends SaveableImpl implements ArraySchema {
27+
private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
28+
private java.util.Map<String, Object> extensionFields_ =
29+
new java.util.HashMap<String, Object>();
30+
31+
private Object items;
32+
33+
/**
34+
* Getter for property <I>https://w3id.org/cwl/salad#items</I><BR>
35+
* <BLOCKQUOTE>
36+
* Defines the type of the array elements. * </BLOCKQUOTE>
37+
*/
38+
39+
public Object getItems() {
40+
return this.items;
41+
}
42+
43+
private enum_d062602be0b4b8fd33e69e29a841317b6ab665bc type;
44+
45+
/**
46+
* Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
47+
* <BLOCKQUOTE>
48+
* Must be `array` * </BLOCKQUOTE>
49+
*/
50+
51+
public enum_d062602be0b4b8fd33e69e29a841317b6ab665bc getType() {
52+
return this.type;
53+
}
54+
55+
/**
56+
* Used by {@link org.w3id.cwl.cwl1_1.utils.RootLoader} to construct instances of ArraySchemaImpl.
57+
*
58+
* @param __doc_ Document fragment to load this record object from (presumably a
59+
{@link java.util.Map}).
60+
* @param __baseUri_ Base URI to generate child document IDs against.
61+
* @param __loadingOptions Context for loading URIs and populating objects.
62+
* @param __docRoot_ ID at this position in the document (if available) (maybe?)
63+
* @throws ValidationException If the document fragment is not a {@link java.util.Map}
64+
* or validation of fields fails.
65+
*/
66+
public ArraySchemaImpl(
67+
final Object __doc_,
68+
final String __baseUri_,
69+
LoadingOptions __loadingOptions,
70+
final String __docRoot_) {
71+
super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
72+
// Prefix plumbing variables with '__' to reduce likelihood of collision with
73+
// generated names.
74+
String __baseUri = __baseUri_;
75+
String __docRoot = __docRoot_;
76+
if (!(__doc_ instanceof java.util.Map)) {
77+
throw new ValidationException("ArraySchemaImpl called on non-map");
78+
}
79+
final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
80+
final java.util.List<ValidationException> __errors =
81+
new java.util.ArrayList<ValidationException>();
82+
if (__loadingOptions != null) {
83+
this.loadingOptions_ = __loadingOptions;
84+
}
85+
Object items;
86+
try {
87+
items =
88+
LoaderInstances
89+
.typedsl_union_of_PrimitiveType_or_RecordSchema_or_EnumSchema_or_ArraySchema_or_StringInstance_or_array_of_union_of_PrimitiveType_or_RecordSchema_or_EnumSchema_or_ArraySchema_or_StringInstance_2
90+
.loadField(__doc.get("items"), __baseUri, __loadingOptions);
91+
} catch (ValidationException e) {
92+
items = null; // won't be used but prevents compiler from complaining.
93+
final String __message = "the `items` field is not valid because:";
94+
__errors.add(new ValidationException(__message, e));
95+
}
96+
enum_d062602be0b4b8fd33e69e29a841317b6ab665bc type;
97+
try {
98+
type =
99+
LoaderInstances
100+
.typedsl_enum_d062602be0b4b8fd33e69e29a841317b6ab665bc_2
101+
.loadField(__doc.get("type"), __baseUri, __loadingOptions);
102+
} catch (ValidationException e) {
103+
type = null; // won't be used but prevents compiler from complaining.
104+
final String __message = "the `type` field is not valid because:";
105+
__errors.add(new ValidationException(__message, e));
106+
}
107+
if (!__errors.isEmpty()) {
108+
throw new ValidationException("Trying 'RecordField'", __errors);
109+
}
110+
this.items = (Object) items;
111+
this.type = (enum_d062602be0b4b8fd33e69e29a841317b6ab665bc) type;
112+
}
113+
}

Diff for: src/main/java/org/w3id/cwl/cwl1_1/CWLType.java

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright Common Workflow Language project contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package org.w3id.cwl.cwl1_1;
16+
17+
import org.w3id.cwl.cwl1_1.utils.ValidationException;
18+
19+
public enum CWLType {
20+
NULL("null"),
21+
BOOLEAN("boolean"),
22+
INT("int"),
23+
LONG("long"),
24+
FLOAT("float"),
25+
DOUBLE("double"),
26+
STRING("string"),
27+
FILE("File"),
28+
DIRECTORY("Directory");
29+
30+
private static String[] symbols = new String[] {"null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"};
31+
private String docVal;
32+
33+
private CWLType(final String docVal) {
34+
this.docVal = docVal;
35+
}
36+
37+
public static CWLType fromDocumentVal(final String docVal) {
38+
for(final CWLType val : CWLType.values()) {
39+
if(val.docVal.equals(docVal)) {
40+
return val;
41+
}
42+
}
43+
throw new ValidationException(String.format("Expected one of %s", CWLType.symbols, docVal));
44+
}
45+
}

Diff for: src/main/java/org/w3id/cwl/cwl1_1/CWLVersion.java

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright Common Workflow Language project contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package org.w3id.cwl.cwl1_1;
16+
17+
import org.w3id.cwl.cwl1_1.utils.ValidationException;
18+
19+
public enum CWLVersion {
20+
DRAFT_2("draft-2"),
21+
DRAFT_3_DEV1("draft-3.dev1"),
22+
DRAFT_3_DEV2("draft-3.dev2"),
23+
DRAFT_3_DEV3("draft-3.dev3"),
24+
DRAFT_3_DEV4("draft-3.dev4"),
25+
DRAFT_3_DEV5("draft-3.dev5"),
26+
DRAFT_3("draft-3"),
27+
DRAFT_4_DEV1("draft-4.dev1"),
28+
DRAFT_4_DEV2("draft-4.dev2"),
29+
DRAFT_4_DEV3("draft-4.dev3"),
30+
V1_0_DEV4("v1.0.dev4"),
31+
V1_0("v1.0"),
32+
V1_1_0_DEV1("v1.1.0-dev1"),
33+
V1_1("v1.1");
34+
35+
private static String[] symbols = new String[] {"draft-2", "draft-3.dev1", "draft-3.dev2", "draft-3.dev3", "draft-3.dev4", "draft-3.dev5", "draft-3", "draft-4.dev1", "draft-4.dev2", "draft-4.dev3", "v1.0.dev4", "v1.0", "v1.1.0-dev1", "v1.1"};
36+
private String docVal;
37+
38+
private CWLVersion(final String docVal) {
39+
this.docVal = docVal;
40+
}
41+
42+
public static CWLVersion fromDocumentVal(final String docVal) {
43+
for(final CWLVersion val : CWLVersion.values()) {
44+
if(val.docVal.equals(docVal)) {
45+
return val;
46+
}
47+
}
48+
throw new ValidationException(String.format("Expected one of %s", CWLVersion.symbols, docVal));
49+
}
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// Copyright Common Workflow Language project contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package org.w3id.cwl.cwl1_1;
16+
17+
import org.w3id.cwl.cwl1_1.utils.Saveable;
18+
19+
/**
20+
* Auto-generated interface for <I>https://w3id.org/cwl/cwl#CommandInputArraySchema</I><BR>This interface is implemented by {@link CommandInputArraySchemaImpl}<BR>
21+
*/
22+
public interface CommandInputArraySchema extends InputArraySchema, CommandInputSchema, CommandLineBindable, Saveable {
23+
/**
24+
* Getter for property <I>https://w3id.org/cwl/cwl#IOSchema/name</I><BR>
25+
* <BLOCKQUOTE>
26+
* The identifier for this type * </BLOCKQUOTE>
27+
*/
28+
29+
java.util.Optional<String> getName();
30+
/**
31+
* Getter for property <I>https://w3id.org/cwl/salad#items</I><BR>
32+
* <BLOCKQUOTE>
33+
* Defines the type of the array elements. * </BLOCKQUOTE>
34+
*/
35+
36+
Object getItems();
37+
/**
38+
* Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
39+
* <BLOCKQUOTE>
40+
* Must be `array` * </BLOCKQUOTE>
41+
*/
42+
43+
enum_d062602be0b4b8fd33e69e29a841317b6ab665bc getType();
44+
/**
45+
* Getter for property <I>https://w3id.org/cwl/cwl#Labeled/label</I><BR>
46+
* <BLOCKQUOTE>
47+
* A short, human-readable label of this object. * </BLOCKQUOTE>
48+
*/
49+
50+
java.util.Optional<String> getLabel();
51+
/**
52+
* Getter for property <I>https://w3id.org/cwl/salad#Documented/doc</I><BR>
53+
* <BLOCKQUOTE>
54+
* A documentation string for this object, or an array of strings which should be concatenated. * </BLOCKQUOTE>
55+
*/
56+
57+
Object getDoc();
58+
/**
59+
* Getter for property <I>https://w3id.org/cwl/cwl#CommandLineBindable/inputBinding</I><BR>
60+
* <BLOCKQUOTE>
61+
* Describes how to turn this object into command line arguments. * </BLOCKQUOTE>
62+
*/
63+
64+
java.util.Optional<CommandLineBinding> getInputBinding();
65+
}

0 commit comments

Comments
 (0)