Search in sources :

Example 1 with CommandLineParseException

use of net.jangaroo.jooc.cli.CommandLineParseException in project jangaroo-tools by CoreMedia.

the class Exmlc method run.

public static int run(String[] argv) {
    ExmlcCommandLineParser parser = new ExmlcCommandLineParser();
    ExmlConfiguration exmlConfiguration;
    try {
        exmlConfiguration = parser.parse(argv);
    } catch (CommandLineParseException e) {
        // NOSONAR this is a commandline tool
        System.err.println(e.getMessage());
        return e.getExitCode();
    }
    if (exmlConfiguration != null) {
        Exmlc exmlc = new Exmlc(exmlConfiguration);
        if (exmlConfiguration.isConvertToMxml()) {
            exmlc.convertAllExmlToMxml();
        } else {
            exmlc.generateAllConfigClasses();
            exmlc.generateAllComponentClasses();
            exmlc.generateXsd();
        }
    }
    return 0;
}
Also used : ExmlcCommandLineParser(net.jangaroo.exml.cli.ExmlcCommandLineParser) CommandLineParseException(net.jangaroo.jooc.cli.CommandLineParseException) ExmlConfiguration(net.jangaroo.exml.config.ExmlConfiguration)

Example 2 with CommandLineParseException

use of net.jangaroo.jooc.cli.CommandLineParseException in project jangaroo-tools by CoreMedia.

the class Jooc method run.

public static int run(String[] argv, CompileLog log) {
    try {
        JoocCommandLineParser commandLineParser = new JoocCommandLineParser();
        JoocConfiguration config = commandLineParser.parse(argv);
        if (config != null) {
            return new Jooc(config, log).run().getResultCode();
        }
    } catch (CommandLineParseException e) {
        // NOSONAR this is a commandline tool
        System.out.println(e.getMessage());
        return e.getExitCode();
    }
    return CompilationResult.RESULT_CODE_OK;
}
Also used : CommandLineParseException(net.jangaroo.jooc.cli.CommandLineParseException) JoocCommandLineParser(net.jangaroo.jooc.cli.JoocCommandLineParser) JoocConfiguration(net.jangaroo.jooc.config.JoocConfiguration)

Example 3 with CommandLineParseException

use of net.jangaroo.jooc.cli.CommandLineParseException in project jangaroo-tools by CoreMedia.

the class ExmlcCommandLineParser method parse.

public ExmlConfiguration parse(String[] args) throws CommandLineParseException {
    ExmlConfiguration config = new ExmlConfiguration();
    CmdLineParser parser = new CmdLineParser(config);
    try {
        // parse the arguments.
        parser.parseArgument(args);
    } catch (CmdLineException e) {
        StringBuilder msg = extendedUsage(parser, e);
        throw new CommandLineParseException(msg.toString(), -1);
    }
    return parseConfig(parser, config);
}
Also used : CmdLineParser(org.kohsuke.args4j.CmdLineParser) CommandLineParseException(net.jangaroo.jooc.cli.CommandLineParseException) ExmlConfiguration(net.jangaroo.exml.config.ExmlConfiguration) CmdLineException(org.kohsuke.args4j.CmdLineException)

Aggregations

CommandLineParseException (net.jangaroo.jooc.cli.CommandLineParseException)3 ExmlConfiguration (net.jangaroo.exml.config.ExmlConfiguration)2 ExmlcCommandLineParser (net.jangaroo.exml.cli.ExmlcCommandLineParser)1 JoocCommandLineParser (net.jangaroo.jooc.cli.JoocCommandLineParser)1 JoocConfiguration (net.jangaroo.jooc.config.JoocConfiguration)1 CmdLineException (org.kohsuke.args4j.CmdLineException)1 CmdLineParser (org.kohsuke.args4j.CmdLineParser)1