Skip to content

Commit

Permalink
Minor refactoring in validator-repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
klakegg committed Aug 31, 2015
1 parent 3bac9bc commit b7a775c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 14 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

## Next release

* Allow tracing successful test.
* Allow tracing successful tests.
* Adding FlagType.SUCCESS in API.
* Added more logging.
* Updating version of no.difi.commons:commons-schematron.
* Functionality to sign validation artifacts defined by parameters.
* Fixing UTF-8 thing in presentation of rendered documents in sample application.
* Allow override of implementations of checker og renderer to use.

## 2.0.0-RC2

Expand Down
2 changes: 1 addition & 1 deletion validator-repo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<configuration>
<archive>
<manifest>
<mainClass>no.difi.vefa.validator.Repo</mainClass>
<mainClass>no.difi.vefa.validator.Cli</mainClass>
</manifest>
</archive>
<descriptorRefs>
Expand Down
29 changes: 29 additions & 0 deletions validator-repo/src/main/java/no/difi/vefa/validator/Cli.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package no.difi.vefa.validator;

import org.apache.commons.cli.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.nio.file.Paths;

public class Cli {

private static Logger logger = LoggerFactory.getLogger(Cli.class);

public static void main(String... args) throws Exception {
if (args.length == 0) {
logger.info("Usage:");
logger.info(" Generate artifacts.xml in repo-folder:");
logger.info(" validator-repo --target repo-folder");
System.exit(0);
}

Options options = new Options();
options.addOption("t", "target", true, "Target");

CommandLineParser parser = new DefaultParser();
CommandLine cmd = parser.parse(options, args);

Repo.generateArtifacts(Paths.get(cmd.getOptionValue("target")), true);
}
}
12 changes: 0 additions & 12 deletions validator-repo/src/main/java/no/difi/vefa/validator/Repo.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,6 @@ public class Repo {
}
}

/**
* Entry point when using cli.
*
* @param args Cli arguments.
* @throws Exception
*/
public static void main(String... args) throws Exception {
// Loop over input. Normally just one folder, but multiple is supported.
for (String directory : args)
generateArtifacts(Paths.get(directory), true);
}

/**
* Generates list of artifacts for a given directory.
*
Expand Down

0 comments on commit b7a775c

Please sign in to comment.