Skip to content

Commit 1baeef0

Browse files
authored
Merge pull request #3 from dockstore/main
Update for Dockstore 1.16 and Java 17/21
2 parents 21a4871 + fd492f3 commit 1baeef0

File tree

4 files changed

+23
-20
lines changed

4 files changed

+23
-20
lines changed

.github/workflows/maven.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
name: Java CI
22

3-
on: [push]
3+
on:
4+
push:
45

56
jobs:
67
build:
78

89
runs-on: ubuntu-latest
910

1011
steps:
11-
- uses: actions/checkout@v1
12-
- name: Set up JDK 11
13-
uses: actions/setup-java@v1
12+
- uses: actions/checkout@v4
13+
- name: Set up JDK 21
14+
uses: actions/setup-java@v4
1415
with:
15-
java-version: 11.0.x
16+
java-version: 21
17+
distribution: 'adopt'
1618
- name: Build with Maven
1719
run: mvn -B package --file pom.xml

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<properties>
1212
<github.url>scm:git:git@github.com:dockstore/silly-workflow-language-interface.git</github.url>
13-
<dockstore.version>1.9.0-alpha.0</dockstore.version>
13+
<dockstore.version>1.16.0</dockstore.version>
1414
<plugin.id>${project.artifactId}</plugin.id>
1515
<plugin.class>io.dockstore.language.SillyWorkflowLanguagePlugin</plugin.class>
1616
<plugin.version>${project.version}</plugin.version>
@@ -67,7 +67,7 @@
6767
<artifactId>maven-compiler-plugin</artifactId>
6868
<version>3.8.0</version>
6969
<configuration>
70-
<release>11</release>
70+
<release>17</release>
7171
<showDeprecation>true</showDeprecation>
7272
</configuration>
7373
</plugin>
@@ -174,7 +174,7 @@
174174
<dependency>
175175
<groupId>com.google.guava</groupId>
176176
<artifactId>guava</artifactId>
177-
<version>24.1.1-jre</version>
177+
<version>32.0.0-jre</version>
178178
</dependency>
179179
</dependencies>
180180
</project>

src/main/java/io/dockstore/language/SillyWorkflowLanguagePlugin.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@
1616
package io.dockstore.language;
1717

1818
import java.util.HashMap;
19-
import java.util.List;
2019
import java.util.Map;
2120
import java.util.regex.Pattern;
2221

2322
import io.dockstore.common.DescriptorLanguage;
2423
import io.dockstore.common.VersionTypeValidation;
25-
import org.apache.commons.lang3.tuple.ImmutablePair;
26-
import org.apache.commons.lang3.tuple.Pair;
2724
import org.pf4j.Extension;
2825
import org.pf4j.Plugin;
2926
import org.pf4j.PluginWrapper;
@@ -56,8 +53,9 @@ public String launchInstructions(String trsID) {
5653
return null;
5754
}
5855

56+
5957
@Override
60-
public VersionTypeValidation validateWorkflowSet(String initialPath, String contents, Map<String, Pair<String, GenericFileType>> indexedFiles) {
58+
public VersionTypeValidation validateWorkflowSet(String initialPath, String contents, Map<String, FileMetadata> indexedFiles) {
6159
VersionTypeValidation validation = new VersionTypeValidation(true, new HashMap<>());
6260
for (String line : contents.split("\\r?\\n")) {
6361
if (!line.startsWith("import") && !line.startsWith("author") && !line.startsWith("description")) {
@@ -69,13 +67,14 @@ public VersionTypeValidation validateWorkflowSet(String initialPath, String cont
6967
}
7068

7169
@Override
72-
public VersionTypeValidation validateTestParameterSet(Map<String, Pair<String, GenericFileType>> indexedFiles) {
70+
public VersionTypeValidation validateTestParameterSet(Map<String, FileMetadata> indexedFiles) {
7371
return new VersionTypeValidation(true, new HashMap<>());
7472
}
7573

74+
7675
@Override
77-
public DescriptorLanguage getDescriptorLanguage() {
78-
return DescriptorLanguage.SWL;
76+
public io.dockstore.common.DescriptorLanguage getDescriptorLanguage() {
77+
return null;
7978
}
8079

8180
@Override
@@ -84,20 +83,21 @@ public Pattern initialPathPattern() {
8483
}
8584

8685
@Override
87-
public Map<String, Pair<String, GenericFileType>> indexWorkflowFiles(String initialPath, String contents, FileReader reader) {
88-
Map<String, Pair<String, GenericFileType>> results = new HashMap<>();
86+
public Map<String, FileMetadata> indexWorkflowFiles(String initialPath, String contents, FileReader reader) {
87+
Map<String, FileMetadata> results = new HashMap<>();
8988
for (String line : contents.split("\\r?\\n")) {
9089
if (line.startsWith("import")) {
9190
final String[] s = line.split(":");
9291
final String importedFile = reader.readFile(s[1].trim());
93-
results.put(s[1].trim(), new ImmutablePair<>(importedFile, GenericFileType.IMPORTED_DESCRIPTOR));
92+
// use real language version
93+
results.put(s[1].trim(), new FileMetadata(importedFile, GenericFileType.IMPORTED_DESCRIPTOR, "1.0"));
9494
}
9595
}
9696
return results;
9797
}
9898

9999
@Override
100-
public WorkflowMetadata parseWorkflowForMetadata(String initialPath, String contents, Map<String, Pair<String, GenericFileType>> indexedFiles) {
100+
public WorkflowMetadata parseWorkflowForMetadata(String initialPath, String contents, Map<String, FileMetadata> indexedFiles) {
101101
WorkflowMetadata metadata = new WorkflowMetadata();
102102
for (String line : contents.split("\\r?\\n")) {
103103
if (line.startsWith("author")) {

src/test/java/io/dockstore/language/SillyWorkflowLanguagePluginTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.dockstore.language;
22

3+
import io.dockstore.language.MinimalLanguageInterface.FileMetadata;
34
import java.io.IOException;
45
import java.net.URL;
56
import java.nio.charset.StandardCharsets;
@@ -18,7 +19,7 @@ public class SillyWorkflowLanguagePluginTest {
1819
public void testWorkflowParsing() {
1920
SillyWorkflowLanguagePlugin.SillyWorkflowLanguagePluginImpl plugin = new SillyWorkflowLanguagePlugin.SillyWorkflowLanguagePluginImpl();
2021
HttpFileReader reader = new HttpFileReader();
21-
final Map<String, Pair<String, MinimalLanguageInterface.GenericFileType>> fileMap = plugin
22+
final Map<String, FileMetadata> fileMap = plugin
2223
.indexWorkflowFiles("/Dockstore.swl", reader.readFile("Dockstore.swl"), reader);
2324
Assert.assertEquals(1, fileMap.size());
2425
Assert.assertTrue(fileMap.containsKey("foo.swl"));

0 commit comments

Comments
 (0)