Search in sources :

Example 1 with Main

use of uk.me.parabola.mkgmap.main.Main in project mkgmap by openstreetmap.

the class MKGMapTask method execute.

public void execute() {
    List<String> args = new ArrayList<String>();
    try {
        CommandArgsReader argsReader = new CommandArgsReader(new Main());
        if (configFile != null)
            args.add("--read-config=" + configFile);
        for (Path path : paths) {
            String[] includedFiles = path.list();
            for (String filename : includedFiles) {
                log("processing " + filename);
                args.add("--input-file=" + filename);
            }
        }
        argsReader.readArgs(args.toArray(new String[args.size()]));
    } catch (Exception ex) {
        // log(ex, 1);
        throw new BuildException(ex);
    }
}
Also used : Path(org.apache.tools.ant.types.Path) CommandArgsReader(uk.me.parabola.mkgmap.CommandArgsReader) ArrayList(java.util.ArrayList) BuildException(org.apache.tools.ant.BuildException) Main(uk.me.parabola.mkgmap.main.Main) BuildException(org.apache.tools.ant.BuildException)

Aggregations

ArrayList (java.util.ArrayList)1 BuildException (org.apache.tools.ant.BuildException)1 Path (org.apache.tools.ant.types.Path)1 CommandArgsReader (uk.me.parabola.mkgmap.CommandArgsReader)1 Main (uk.me.parabola.mkgmap.main.Main)1