use of org.apache.tools.ant.BuildException in project processdash by dtuma.
the class MergeJars method execute.
public void execute() throws BuildException {
validate();
try {
log("Building jar: " + outputFile);
run();
} catch (Exception e) {
throw new BuildException(e);
}
}
use of org.apache.tools.ant.BuildException in project processdash by dtuma.
the class JLexBatch method execute.
public void execute() throws BuildException {
DirectoryScanner ds = fileset.getDirectoryScanner(getProject());
String[] srcFilenames = ds.getIncludedFiles();
if (srcFilenames.length == 0)
throw new BuildException("You must designate at least one input lexer file.");
for (int j = 0; j < srcFilenames.length; j++) {
String inputFilename = srcFilenames[j];
File inputFile = new File(ds.getBasedir(), inputFilename);
String outputFilename = getOutputFilename(inputFilename);
File outputFile = new File(ds.getBasedir(), outputFilename);
if (outputFile.lastModified() > inputFile.lastModified())
// file is already up-to-date
continue;
try {
JLex.Main.main(new String[] { inputFile.getAbsolutePath(), outputFile.getAbsolutePath() });
} catch (IOException ioe) {
throw new BuildException("Cannot create file '" + outputFile + "'");
}
}
}
use of org.apache.tools.ant.BuildException in project processdash by dtuma.
the class OrphanedResources method execute.
public void execute() throws BuildException {
DirectoryScanner ds = getDirectoryScanner(dir);
String[] srcFiles = ds.getIncludedFiles();
HashMap props = new HashMap();
for (int j = 0; j < srcFiles.length; j++) {
String key = getFileKey(srcFiles[j]);
if (key != null)
props.put(key, loadProps(srcFiles[j]));
}
numOrphans = 0;
Iterator i = props.keySet().iterator();
while (i.hasNext()) {
String key = (String) i.next();
checkForOrphans(key, props);
}
if (numOrphans > 0)
throw new BuildException(numOrphans + " orphaned resources found.");
}
use of org.apache.tools.ant.BuildException in project processdash by dtuma.
the class UpdateIzPackResourceFile method execute.
public void execute() {
validate();
if (noUpdatesNeeded())
return;
ResourceBundle bundle;
try {
bundle = readResourceBundle();
} catch (Exception e) {
throw new BuildException("Can't load resource bundle.", e);
}
try {
updateLangpack(bundle);
} catch (Exception e) {
throw new BuildException("Couldn't update langpack.", e);
}
}
use of org.apache.tools.ant.BuildException in project megameklab by MegaMek.
the class Launch4jTask method execute.
public void execute() throws BuildException {
try {
if (tmpdir != null) {
System.setProperty("launch4j.tmpdir", tmpdir.getPath());
}
if (bindir != null) {
System.setProperty("launch4j.bindir", bindir.getPath());
}
if (_configFile != null && _config != null) {
throw new BuildException(Messages.getString("Launch4jTask.specify.config"));
} else if (_configFile != null) {
ConfigPersister.getInstance().load(_configFile);
Config c = ConfigPersister.getInstance().getConfig();
if (jar != null) {
c.setJar(jar);
}
if (outfile != null) {
c.setOutfile(outfile);
}
if (fileVersion != null) {
c.getVersionInfo().setFileVersion(fileVersion);
}
if (txtFileVersion != null) {
c.getVersionInfo().setTxtFileVersion(txtFileVersion);
}
if (productVersion != null) {
c.getVersionInfo().setProductVersion(productVersion);
}
if (txtProductVersion != null) {
c.getVersionInfo().setTxtProductVersion(txtProductVersion);
}
} else if (_config != null) {
_config.unwrap();
ConfigPersister.getInstance().setAntConfig(_config, getProject().getBaseDir());
} else {
throw new BuildException(Messages.getString("Launch4jTask.specify.config"));
}
final Builder b = new Builder(Log.getAntLog());
b.build();
} catch (ConfigPersisterException e) {
throw new BuildException(e);
} catch (BuilderException e) {
throw new BuildException(e);
}
}
Aggregations