use of net.jangaroo.jooc.AbstractCompileLog in project jangaroo-tools by CoreMedia.
the class AbstractCompilerMojo method compile.
private int compile(JoocConfiguration config) throws MojoExecutionException {
File outputDirectory = config.getOutputDirectory();
// create output directory if it does not exist
if (!outputDirectory.exists()) {
if (!outputDirectory.mkdirs()) {
throw new MojoExecutionException("Failed to create output directory " + outputDirectory.getAbsolutePath());
}
}
// create api output directory if it does not exist
File apiOutputDirectory = getApiOutputDirectory();
if (apiOutputDirectory != null && !apiOutputDirectory.exists()) {
if (!apiOutputDirectory.mkdirs()) {
throw new MojoExecutionException("Failed to create api output directory " + apiOutputDirectory.getAbsolutePath());
}
}
final List<File> sources = config.getSourceFiles();
final Log log = getLog();
log.info("Compiling " + sources.size() + " joo source file" + (sources.size() == 1 ? "" : "s") + " to " + outputDirectory);
Jooc jooc = new Jooc(config, new AbstractCompileLog() {
@Override
protected void doLogError(String msg) {
log.error(msg);
}
@Override
public void warning(String msg) {
log.warn(msg);
}
});
return jooc.run().getResultCode();
}
Aggregations