Skip to content

Commit a6ac216

Browse files
committed
Minor tweaks
1 parent 3fe8d63 commit a6ac216

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

java/cli/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,17 @@
101101
</compilerArgs>
102102
</configuration>
103103
</plugin>
104+
<plugin>
105+
<groupId>org.apache.maven.plugins</groupId>
106+
<artifactId>maven-jar-plugin</artifactId>
107+
<configuration>
108+
<archive>
109+
<manifest>
110+
<mainClass>io.cucumber.junitxmlformatter.cli.JunitXmlFormatter</mainClass>
111+
</manifest>
112+
</archive>
113+
</configuration>
114+
</plugin>
104115
</plugins>
105116
</build>
106117
</project>

java/cli/src/main/java/io/cucumber/junitxmlformatter/cli/ToJUnitXml.java renamed to java/cli/src/main/java/io/cucumber/junitxmlformatter/cli/JunitXmlFormatter.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,20 @@
1818
import picocli.CommandLine.Spec;
1919

2020
import java.io.InputStream;
21-
import java.io.PrintWriter;
2221
import java.io.Writer;
2322
import java.nio.file.Files;
2423
import java.nio.file.Path;
2524
import java.util.concurrent.Callable;
2625

2726
import static io.cucumber.query.NamingStrategy.ExampleName.NUMBER_AND_PICKLE_IF_PARAMETERIZED;
2827

29-
@Command(name = "to-junit-xml", mixinStandardHelpOptions = true, version = "to-junit-xml 4.0",
30-
description = "Converts Cucumber messages to JUnit XML")
31-
class ToJUnitXml implements Callable<Integer> {
28+
// TODO: Read version from manifest?
29+
@Command(
30+
name = "junit-xml-formatter",
31+
mixinStandardHelpOptions = true,
32+
description = "Converts Cucumber messages to JUnit XML"
33+
)
34+
class JunitXmlFormatter implements Callable<Integer> {
3235
@Spec
3336
private CommandSpec spec;
3437

@@ -49,6 +52,7 @@ public Integer call() throws Exception {
4952

5053
// TODO: Use the CLI options.
5154
NamingStrategy.ExampleName exampleNameStrategy = NUMBER_AND_PICKLE_IF_PARAMETERIZED;
55+
// TODO: Read from standard in, or read/write from files.
5256
Writer out = spec.commandLine().getOut();
5357

5458
try (InputStream in = Files.newInputStream(source)) {
@@ -64,10 +68,8 @@ public Integer call() throws Exception {
6468
return 0;
6569
}
6670

67-
// this example implements Callable, so parsing, error handling and handling user
68-
// requests for usage help or version help can be done with one line of code.
6971
public static void main(String... args) {
70-
int exitCode = new CommandLine(new ToJUnitXml()).execute(args);
72+
int exitCode = new CommandLine(new JunitXmlFormatter()).execute(args);
7173
System.exit(exitCode);
7274
}
73-
}
75+
}

0 commit comments

Comments
 (0)