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 22Commandline interface to work with Cucumber Messages
33
44## TODO:
5+ - Build as standalone artifact
56 - 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 2020 <java .version>21</java .version>
2121 <project .build.outputTimestamp>1719064372</project .build.outputTimestamp>
2222 <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>
2326 </properties >
2427
2528 <scm >
5962 <dependency >
6063 <groupId >io.cucumber</groupId >
6164 <artifactId >junit-xml-formatter</artifactId >
62- <version >0.5.0 </version >
65+ <version >${junit-xml-formatter.version} </version >
6366 </dependency >
6467 <dependency >
6568 <groupId >io.cucumber</groupId >
6669 <artifactId >testng-xml-formatter</artifactId >
67- <version >0.2.0 </version >
70+ <version >${testng-xml-formatter.version} </version >
6871 </dependency >
6972 <dependency >
7073 <groupId >io.cucumber</groupId >
7174 <artifactId >gherkin</artifactId >
72- <version >28.0.0 </version >
75+ <version >${gherkin.version} </version >
7376 </dependency >
7477 <dependency >
7578 <groupId >com.fasterxml.jackson.core</groupId >
106109 </dependencies >
107110
108111 <build >
112+ <resources >
113+ <resource >
114+ <directory >src/main/resources</directory >
115+ <filtering >true</filtering >
116+ </resource >
117+ </resources >
118+
109119 <plugins >
110120 <plugin >
111121 <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 66@ Command (
77 name = "messages" ,
88 mixinStandardHelpOptions = true ,
9- description = "Work with Cucumber messages" ,
10- versionProvider = ManifestVersionProvider .class ,
9+ headerHeading = "Work with Cucumber messages" ,
10+ versionProvider = VersionProvider .class ,
1111 subcommands = {
1212 GherkinCommand .class ,
1313 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 88import java .io .PrintStream ;
99import java .io .PrintWriter ;
1010import java .io .StringWriter ;
11+ import java .util .regex .Pattern ;
1112
12- import static java .nio .file .Files .readString ;
1313import static org .assertj .core .api .Assertions .assertThat ;
1414import static org .junit .jupiter .api .Assertions .assertAll ;
1515
@@ -48,7 +48,15 @@ void version() {
4848 assertAll (
4949 () -> assertThat (exitCode ).isZero (),
5050 () -> 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+ ))
5260 );
5361 }
5462
You can’t perform that action at this time.
0 commit comments