diff --git a/cli/src/main/java/de/pfeufferweb/gitcover/GCOptions.java b/cli/src/main/java/de/pfeufferweb/gitcover/GCOptions.java index 341efa6..ac94f0e 100644 --- a/cli/src/main/java/de/pfeufferweb/gitcover/GCOptions.java +++ b/cli/src/main/java/de/pfeufferweb/gitcover/GCOptions.java @@ -16,8 +16,11 @@ class GCOptions private String ignoreFile = null; private String repository = null; private String reference = null; + private boolean failed = false; + private CoverageTool coverageTool = CoverageTool.COBERTURA; + public void parse(String[] args) { Options options = buildOptions(); @@ -54,6 +57,16 @@ private void parse(String[] args, Options options, CommandLineParser parser) thr printHelp(options); failed = true; } + if(line.hasOption("ct")) + { + switch (line.getOptionValue("ct")){ + case "cobertura": coverageTool = CoverageTool.COBERTURA; + break; + case "jacoco": coverageTool = CoverageTool.JACOCO; + break; + default: break; + } + } } @SuppressWarnings("static-access") @@ -66,6 +79,8 @@ private Options buildOptions() .withDescription("use this to ignore files that have been modified").create("em"); Option excludeAddedOption = OptionBuilder.withLongOpt("exclude-added") .withDescription("use this to ignore files that have been modified").create("ea"); + Option coverageToolOption = OptionBuilder.withLongOpt("coverage-tool") + .withDescription("use this to select between cobertura and jacoco").create("ct"); options.addOption(ignoreFileOption); options.addOption(excludeModifiedOption); options.addOption(excludeAddedOption); diff --git a/cli/src/main/java/de/pfeufferweb/gitcover/GitCover.java b/cli/src/main/java/de/pfeufferweb/gitcover/GitCover.java index e6c990b..9247116 100644 --- a/cli/src/main/java/de/pfeufferweb/gitcover/GitCover.java +++ b/cli/src/main/java/de/pfeufferweb/gitcover/GitCover.java @@ -76,13 +76,13 @@ private void process(GCOptions options) throws Exception out.println("a.ignored {background:#CDF;}"); out.println("a.allCovered {background:#CFC;}"); out.println("a.coverageMissing {background:#FDC;}"); - out.println("a.exp::after {content:\"»\";float:right;}"); + out.println("a.exp::after {content:\"�\";float:right;}"); out.println("a.exp:focus {border-width: 1px 1px 0 1px;border-radius:4px 4px 0 0}"); out.println("a.exp + div {display:none;}"); out.println("a.exp:focus + div {display:block;border-width: 0 1px 1px 1px;border-style:solid; border-radius:0 0 4px 4px;border-color:black;}"); out.println("a.exp:focus::after {content:\"\";}"); out.println("div.exp *{padding:0.3em 10px 0em 10px;}"); - out.println("div.exp table:last-child::after {content:\"«\";float:right;}"); + out.println("div.exp table:last-child::after {content:\"�\";float:right;}"); out.println("div.exp *:first-child {margin-top:0;}"); out.println("tr.notCovered {background: orangered;}"); out.println("tr.covered {background: lightgreen;}"); @@ -91,9 +91,9 @@ private void process(GCOptions options) throws Exception out.println(""); ChangedLines changedLines = createChangedLinesBuilder(options, options.getRepository()).build( options.getReference()); - Coverage coverage = new CoverageBuilder().computeAll(new File(options.getRepository())); + Coverage coverage = new CoberturaCoverageBuilder().computeAll(new File(options.getRepository())); out.println("
"); - out.println("