File tree Expand file tree Collapse file tree 8 files changed +63
-39
lines changed
java/io/cucumber/messages/cli
resources/io/cucumber/messages/cli
test/java/io/cucumber/messages/cli Expand file tree Collapse file tree 8 files changed +63
-39
lines changed Original file line number Diff line number Diff line change 2
2
Commandline interface to work with Cucumber Messages
3
3
4
4
## TODO:
5
+ - Build as standalone artifact
5
6
- Publish as a CLI tool
6
- - Write README.
7
+ - Write README.
8
+ - Tidelift
9
+ - Support JSON Formatter
Original file line number Diff line number Diff line change 20
20
<java .version>21</java .version>
21
21
<project .build.outputTimestamp>1719064372</project .build.outputTimestamp>
22
22
<project .Automatic-Module-Name>io.cucumber.messages.cli</project .Automatic-Module-Name>
23
+ <junit-xml-formatter .version>0.5.0</junit-xml-formatter .version>
24
+ <testng-xml-formatter .version>0.2.0</testng-xml-formatter .version>
25
+ <gherkin .version>28.0.0</gherkin .version>
23
26
</properties >
24
27
25
28
<scm >
59
62
<dependency >
60
63
<groupId >io.cucumber</groupId >
61
64
<artifactId >junit-xml-formatter</artifactId >
62
- <version >0.5.0 </version >
65
+ <version >${junit-xml-formatter.version} </version >
63
66
</dependency >
64
67
<dependency >
65
68
<groupId >io.cucumber</groupId >
66
69
<artifactId >testng-xml-formatter</artifactId >
67
- <version >0.2.0 </version >
70
+ <version >${testng-xml-formatter.version} </version >
68
71
</dependency >
69
72
<dependency >
70
73
<groupId >io.cucumber</groupId >
71
74
<artifactId >gherkin</artifactId >
72
- <version >28.0.0 </version >
75
+ <version >${gherkin.version} </version >
73
76
</dependency >
74
77
<dependency >
75
78
<groupId >com.fasterxml.jackson.core</groupId >
106
109
</dependencies >
107
110
108
111
<build >
112
+ <resources >
113
+ <resource >
114
+ <directory >src/main/resources</directory >
115
+ <filtering >true</filtering >
116
+ </resource >
117
+ </resources >
118
+
109
119
<plugins >
110
120
<plugin >
111
121
<groupId >org.apache.maven.plugins</groupId >
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 6
6
@ Command (
7
7
name = "messages" ,
8
8
mixinStandardHelpOptions = true ,
9
- description = "Work with Cucumber messages" ,
10
- versionProvider = ManifestVersionProvider .class ,
9
+ headerHeading = "Work with Cucumber messages" ,
10
+ versionProvider = VersionProvider .class ,
11
11
subcommands = {
12
12
GherkinCommand .class ,
13
13
JunitXmlCommand .class ,
Original file line number Diff line number Diff line change
1
+ package io .cucumber .messages .cli ;
2
+
3
+ import picocli .CommandLine .IVersionProvider ;
4
+
5
+ import java .io .IOException ;
6
+ import java .util .Properties ;
7
+
8
+ class VersionProvider implements IVersionProvider {
9
+
10
+ @ Override
11
+ public String [] getVersion () {
12
+ try {
13
+ var properties = loadVersions ();
14
+ return properties .stringPropertyNames ()
15
+ .stream ()
16
+ .sorted ()
17
+ .map (artifact -> artifact + " " + properties .getProperty (artifact ))
18
+ .toArray (String []::new );
19
+ } catch (IOException e ) {
20
+ return new String [0 ];
21
+ }
22
+ }
23
+
24
+ private static Properties loadVersions () throws IOException {
25
+ var properties = new Properties ();
26
+ properties .load (VersionProvider .class .getResourceAsStream ("versions.properties" ));
27
+ return properties ;
28
+ }
29
+
30
+ }
Original file line number Diff line number Diff line change
1
+ messages-cli =${project.version}
2
+ gherkin =${gherkin.version}
3
+ junit-xml-formatter =${junit-xml-formatter.version}
4
+ testng-xml-formatter =${testng-xml-formatter.version}
Original file line number Diff line number Diff line change 8
8
import java .io .PrintStream ;
9
9
import java .io .PrintWriter ;
10
10
import java .io .StringWriter ;
11
+ import java .util .regex .Pattern ;
11
12
12
- import static java .nio .file .Files .readString ;
13
13
import static org .assertj .core .api .Assertions .assertThat ;
14
14
import static org .junit .jupiter .api .Assertions .assertAll ;
15
15
@@ -48,7 +48,15 @@ void version() {
48
48
assertAll (
49
49
() -> assertThat (exitCode ).isZero (),
50
50
() -> assertThat (out .toString ())
51
- .isEqualToIgnoringNewLines ("messages-cli DEVELOPMENT" )
51
+ .hasLineCount (4 )
52
+ .matches (Pattern .compile ("""
53
+ gherkin \\ d+\\ .\\ d+\\ .\\ d+(-SNAPSHOT)?
54
+ junit-xml-formatter \\ d+\\ .\\ d+\\ .\\ d+(-SNAPSHOT)?
55
+ messages-cli \\ d+\\ .\\ d+\\ .\\ d+(-SNAPSHOT)?
56
+ testng-xml-formatter \\ d+\\ .\\ d+\\ .\\ d+(-SNAPSHOT)?
57
+ """ ,
58
+ Pattern .MULTILINE
59
+ ))
52
60
);
53
61
}
54
62
You can’t perform that action at this time.
0 commit comments