throw new BuildException("the template file attribute is required"
+" when mode is \"" +mode.getValue() +"\"");
}
Manifest manifestProps = new Manifest();
if (!mode.getValue().equals("templateOnly")) {
addAttributesFromProperties(manifestProps);
}
Manifest manifestToWrite = Manifest.getDefaultManifest();
Manifest manifestTemplate = null;
if (null!=manifestTemplateFile && manifestTemplateFile.exists()) {
FileInputStream is = null;
InputStreamReader ir = null;
try {
is = new FileInputStream(manifestTemplateFile);
if (encoding == null) {
ir = new InputStreamReader(is, "UTF-8");
} else {
ir = new InputStreamReader(is, encoding);
}
manifestTemplate = new Manifest(ir);
} catch (ManifestException me) {
throw new BuildException("Template manifest " + manifestTemplateFile
+ " is invalid", me, getLocation());
} catch (IOException ioe) {
throw new BuildException("Failed to read " + manifestTemplateFile,