use of net.jangaroo.exml.api.ExmlcException in project jangaroo-tools by CoreMedia.
the class ExmlSourceFile method generateConfigClass.
public File generateConfigClass() {
if (generatedConfigClassFile == null) {
ConfigClass configClass = getConfigClass();
generatedConfigClassFile = configClassRegistry.getConfig().computeConfigClassTarget(configClass.getName());
// only recreate file if result file is older than the source file
if (mustGenerate(generatedConfigClassFile)) {
// generate the new config class ActionScript file
try {
new ExmlConfigClassGenerator().generateClass(configClass, generatedConfigClassFile);
} catch (Exception e) {
throw new ExmlcException("unable to generate config class: " + e.getMessage(), generatedConfigClassFile, e);
}
}
}
return generatedConfigClassFile;
}
use of net.jangaroo.exml.api.ExmlcException in project jangaroo-tools by CoreMedia.
the class AbstractExmlCompileMojo method execute.
public void execute() throws MojoExecutionException, MojoFailureException {
File gSourcesDirectory = getGeneratedSourcesDirectory();
if (!gSourcesDirectory.exists()) {
getLog().info("generating sources into: " + gSourcesDirectory.getPath());
getLog().debug("created " + gSourcesDirectory.mkdirs());
}
if (!generatedResourcesDirectory.exists()) {
getLog().info("generating resources into: " + generatedResourcesDirectory.getPath());
getLog().debug("created " + generatedResourcesDirectory.mkdirs());
}
List<File> sourcePath = getSourcePath();
ExmlConfiguration exmlConfiguration = createExmlConfiguration(getActionScriptClassPath(), sourcePath, gSourcesDirectory);
exmlConfiguration.setResourceOutputDirectory(generatedResourcesDirectory);
exmlConfiguration.setSourceFiles(getMavenPluginHelper().computeStaleSources(sourcePath, includes, excludes, gSourcesDirectory, Exmlc.EXML_SUFFIX, Jooc.AS_SUFFIX, staleMillis));
if (StringUtils.isNotEmpty(validationMode)) {
try {
exmlConfiguration.setValidationMode(ValidationMode.valueOf(validationMode.toUpperCase()));
} catch (IllegalArgumentException e) {
throw new MojoFailureException("The specified EXML validation mode '" + validationMode + "' is unsupported. " + "Legal values are 'error', 'warn', and 'off'.");
}
}
CompileLog compileLog = new MavenCompileLog();
exmlConfiguration.setLog(compileLog);
Exmlc exmlc;
try {
getLog().debug("Exmlc configuration: " + exmlConfiguration);
exmlc = new Exmlc(exmlConfiguration);
executeExmlc(exmlc);
} catch (ExmlcException e) {
throw new MojoFailureException(e.toString(), e);
}
if (compileLog.hasErrors()) {
throw new MojoFailureException("There were EXML compiler errors, see log for details.");
}
getProject().addCompileSourceRoot(gSourcesDirectory.getPath());
}
Aggregations