use of net.jangaroo.exml.config.ExmlConfiguration in project jangaroo-tools by CoreMedia.
the class AbstractExmlMojo method createExmlConfiguration.
protected ExmlConfiguration createExmlConfiguration(List<File> classPath, List<File> sourcePath, File outputDirectory) throws MojoExecutionException {
if (configClassPackage == null) {
throw new MojoExecutionException("parameter 'configClassPackage' is missing");
}
ExmlConfiguration exmlConfiguration = new ExmlConfiguration();
exmlConfiguration.setConfigClassPackage(configClassPackage);
exmlConfiguration.setClassPath(classPath);
exmlConfiguration.setOutputDirectory(outputDirectory);
try {
exmlConfiguration.setSourcePath(sourcePath);
} catch (IOException e) {
throw new MojoExecutionException("could not determine source directory", e);
}
return exmlConfiguration;
}
use of net.jangaroo.exml.config.ExmlConfiguration in project jangaroo-tools by CoreMedia.
the class ExmlToMxmlMojo method execute.
@Override
public void execute() throws MojoExecutionException {
if (!renameOnly && hasExmlConfiguration()) {
getLog().info("removing exml-maven-plugin from POM");
PomConverter.removeExmlPlugin(getProject().getBasedir());
}
if (!renameOnly && "jangaroo".equals(getProject().getPackaging())) {
getLog().info("changing packaging from jangaroo to jangaroo-pkg");
PomConverter.changePackaging(getProject().getBasedir());
}
if (!isExmlProject()) {
getLog().info("not an EXML project, skipping MXML conversion");
return;
}
if (renameOnly) {
getLog().info("Renaming EXML files to MXML files");
try {
renameFiles(getSourceDirectory(), "exml", "mxml");
renameFiles(getTestSourceDirectory(), "exml", "mxml");
} catch (IOException e) {
throw new MojoExecutionException("error while renaming EXML files", e);
}
return;
}
if (alreadyRenamed) {
getLog().info("Renaming MXML files back to EXML files before running the conversion");
try {
renameFiles(getSourceDirectory(), "mxml", "exml");
renameFiles(getTestSourceDirectory(), "mxml", "exml");
} catch (IOException e) {
throw new MojoExecutionException("error while renaming files", e);
}
}
if (extAsJar != null && !extAsJar.exists()) {
throw new MojoExecutionException("error: extAsJar " + extAsJar.getAbsolutePath() + " does not exist.");
}
// Convert main EXML sources to MXML:
ExmlConfiguration config = createExmlConfiguration(getActionScriptClassPath(), Collections.singletonList(getSourceDirectory()), getGeneratedSourcesDirectory());
config.setExtAsJar(extAsJar);
new Exmlc(config).convertAllExmlToMxml();
// Also convert test EXML sources to MXML:
if (getTestSourceDirectory() != null && getTestSourceDirectory().exists()) {
ExmlConfiguration testConfig = createExmlConfiguration(getActionScriptTestClassPath(), Collections.singletonList(getTestSourceDirectory()), getGeneratedTestSourcesDirectory());
testConfig.setExtAsJar(extAsJar);
new Exmlc(testConfig).convertAllExmlToMxml();
}
}
use of net.jangaroo.exml.config.ExmlConfiguration 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);
}
Aggregations