git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@710102 13f79535-47bb-0310-9956-ffa450edef68master
@@ -131,10 +131,11 @@ public class Ear extends Jar { | |||||
|| !FILE_UTILS.fileNameEquals(deploymentDescriptor, file) | || !FILE_UTILS.fileNameEquals(deploymentDescriptor, file) | ||||
|| descriptorAdded) { | || descriptorAdded) { | ||||
logOnFirstPass("Warning: selected " + archiveType | logOnFirstPass("Warning: selected " + archiveType | ||||
+ " files include a " + XML_DESCRIPTOR_PATH + " which will" | |||||
+ " be ignored (please use appxml attribute to " | |||||
+ archiveType + " task)", | |||||
Project.MSG_WARN); | |||||
+ " files include a " + XML_DESCRIPTOR_PATH | |||||
+ " which will" | |||||
+ " be ignored (please use appxml attribute to " | |||||
+ archiveType + " task)", | |||||
Project.MSG_WARN); | |||||
} else { | } else { | ||||
super.zipFile(file, zOut, vPath, mode); | super.zipFile(file, zOut, vPath, mode); | ||||
descriptorAdded = true; | descriptorAdded = true; | ||||
@@ -637,8 +637,9 @@ public class Jar extends Zip { | |||||
} | } | ||||
} else if (INDEX_NAME.equalsIgnoreCase(vPath) && index) { | } else if (INDEX_NAME.equalsIgnoreCase(vPath) && index) { | ||||
logOnFirstPass("Warning: selected " + archiveType | logOnFirstPass("Warning: selected " + archiveType | ||||
+ " files include a " + INDEX_NAME + " which will" | |||||
+ " be replaced by a newly generated one.", Project.MSG_WARN); | |||||
+ " files include a " + INDEX_NAME + " which will" | |||||
+ " be replaced by a newly generated one.", | |||||
Project.MSG_WARN); | |||||
} else { | } else { | ||||
if (index && vPath.indexOf("/") == -1) { | if (index && vPath.indexOf("/") == -1) { | ||||
rootEntries.addElement(vPath); | rootEntries.addElement(vPath); | ||||
@@ -672,7 +673,7 @@ public class Jar extends Zip { | |||||
&& !filesetManifestConfig.getValue().equals("skip")) { | && !filesetManifestConfig.getValue().equals("skip")) { | ||||
// we add this to our group of fileset manifests | // we add this to our group of fileset manifests | ||||
logOnFirstPass("Found manifest to merge in file " + file, | logOnFirstPass("Found manifest to merge in file " + file, | ||||
Project.MSG_VERBOSE); | |||||
Project.MSG_VERBOSE); | |||||
try { | try { | ||||
Manifest newManifest = null; | Manifest newManifest = null; | ||||
@@ -754,14 +755,14 @@ public class Jar extends Zip { | |||||
try { | try { | ||||
originalManifest = getManifestFromJar(zipFile); | originalManifest = getManifestFromJar(zipFile); | ||||
if (originalManifest == null) { | if (originalManifest == null) { | ||||
logOnFirstPass("Updating jar since the current jar has no manifest", | |||||
Project.MSG_VERBOSE); | |||||
logOnFirstPass("Updating jar since the current jar has" | |||||
+ " no manifest", Project.MSG_VERBOSE); | |||||
needsUpdate = true; | needsUpdate = true; | ||||
} else { | } else { | ||||
Manifest mf = createManifest(); | Manifest mf = createManifest(); | ||||
if (!mf.equals(originalManifest)) { | if (!mf.equals(originalManifest)) { | ||||
logOnFirstPass("Updating jar since jar manifest has changed", | |||||
Project.MSG_VERBOSE); | |||||
logOnFirstPass("Updating jar since jar manifest has" | |||||
+ " changed", Project.MSG_VERBOSE); | |||||
needsUpdate = true; | needsUpdate = true; | ||||
} | } | ||||
} | } | ||||
@@ -806,7 +807,7 @@ public class Jar extends Zip { | |||||
+ zipFile + " because no files were included.", | + zipFile + " because no files were included.", | ||||
Project.MSG_WARN); | Project.MSG_WARN); | ||||
} | } | ||||
return true; | |||||
return true; | |||||
} else if (emptyBehavior.equals("fail")) { | } else if (emptyBehavior.equals("fail")) { | ||||
throw new BuildException("Cannot create " + archiveType | throw new BuildException("Cannot create " + archiveType | ||||
+ " archive " + zipFile | + " archive " + zipFile | ||||
@@ -817,8 +818,8 @@ public class Jar extends Zip { | |||||
ZipOutputStream zOut = null; | ZipOutputStream zOut = null; | ||||
try { | try { | ||||
if (!skipWriting) { | if (!skipWriting) { | ||||
log("Building MANIFEST-only jar: " | |||||
+ getDestFile().getAbsolutePath()); | |||||
log("Building MANIFEST-only jar: " | |||||
+ getDestFile().getAbsolutePath()); | |||||
} | } | ||||
zOut = new ZipOutputStream(new FileOutputStream(getDestFile())); | zOut = new ZipOutputStream(new FileOutputStream(getDestFile())); | ||||
@@ -189,12 +189,13 @@ public class War extends Jar { | |||||
//check to see if we warn or not | //check to see if we warn or not | ||||
if (!FILE_UTILS.fileNameEquals(addedWebXmlFile, file)) { | if (!FILE_UTILS.fileNameEquals(addedWebXmlFile, file)) { | ||||
logOnFirstPass("Warning: selected " + archiveType | logOnFirstPass("Warning: selected " + archiveType | ||||
+ " files include a second " + XML_DESCRIPTOR_PATH | |||||
+ " which will be ignored.\n" | |||||
+ "The duplicate entry is at " + file + '\n' | |||||
+ "The file that will be used is " | |||||
+ addedWebXmlFile, | |||||
Project.MSG_WARN); | |||||
+ " files include a second " | |||||
+ XML_DESCRIPTOR_PATH | |||||
+ " which will be ignored.\n" | |||||
+ "The duplicate entry is at " + file + '\n' | |||||
+ "The file that will be used is " | |||||
+ addedWebXmlFile, | |||||
Project.MSG_WARN); | |||||
} | } | ||||
} else { | } else { | ||||
//no added file, yet | //no added file, yet | ||||
@@ -704,7 +704,7 @@ public class Zip extends MatchingTask { | |||||
if (doUpdate && !zipFile.exists()) { | if (doUpdate && !zipFile.exists()) { | ||||
doUpdate = false; | doUpdate = false; | ||||
logOnFirstPass("ignoring update attribute as " + archiveType | logOnFirstPass("ignoring update attribute as " + archiveType | ||||
+ " doesn't exist.", Project.MSG_DEBUG); | |||||
+ " doesn't exist.", Project.MSG_DEBUG); | |||||
} | } | ||||
} | } | ||||
@@ -721,7 +721,7 @@ public class Zip extends MatchingTask { | |||||
for (int j = 0; j < files.length; j++) { | for (int j = 0; j < files.length; j++) { | ||||
logOnFirstPass("Adding file " + files[j] + " to fileset", | logOnFirstPass("Adding file " + files[j] + " to fileset", | ||||
Project.MSG_VERBOSE); | |||||
Project.MSG_VERBOSE); | |||||
ZipFileSet zf = new ZipFileSet(); | ZipFileSet zf = new ZipFileSet(); | ||||
zf.setProject(getProject()); | zf.setProject(getProject()); | ||||
zf.setSrc(new File(basedir, files[j])); | zf.setSrc(new File(basedir, files[j])); | ||||
@@ -1153,12 +1153,13 @@ public class Zip extends MatchingTask { | |||||
if (emptyBehavior.equals("skip")) { | if (emptyBehavior.equals("skip")) { | ||||
if (doUpdate) { | if (doUpdate) { | ||||
logOnFirstPass(archiveType + " archive " + zipFile | logOnFirstPass(archiveType + " archive " + zipFile | ||||
+ " not updated because no new files were included.", | |||||
Project.MSG_VERBOSE); | |||||
+ " not updated because no new files were" | |||||
+ " included.", Project.MSG_VERBOSE); | |||||
} else { | } else { | ||||
logOnFirstPass("Warning: skipping " + archiveType + " archive " | |||||
+ zipFile + " because no files were included.", | |||||
Project.MSG_WARN); | |||||
logOnFirstPass("Warning: skipping " + archiveType | |||||
+ " archive " + zipFile | |||||
+ " because no files were included.", | |||||
Project.MSG_WARN); | |||||
} | } | ||||
} else if (emptyBehavior.equals("fail")) { | } else if (emptyBehavior.equals("fail")) { | ||||
throw new BuildException("Cannot create " + archiveType | throw new BuildException("Cannot create " + archiveType | ||||
@@ -1457,8 +1458,9 @@ public class Zip extends MatchingTask { | |||||
int mode, ZipExtraField[] extra) | int mode, ZipExtraField[] extra) | ||||
throws IOException { | throws IOException { | ||||
if (doFilesonly) { | if (doFilesonly) { | ||||
logOnFirstPass("skipping directory " + vPath + " for file-only archive", | |||||
Project.MSG_VERBOSE); | |||||
logOnFirstPass("skipping directory " + vPath | |||||
+ " for file-only archive", | |||||
Project.MSG_VERBOSE); | |||||
return; | return; | ||||
} | } | ||||
if (addedDirs.get(vPath) != null) { | if (addedDirs.get(vPath) != null) { | ||||
@@ -1515,7 +1517,8 @@ public class Zip extends MatchingTask { | |||||
if (entries.contains(vPath)) { | if (entries.contains(vPath)) { | ||||
if (duplicate.equals("preserve")) { | if (duplicate.equals("preserve")) { | ||||
logOnFirstPass(vPath + " already added, skipping", Project.MSG_INFO); | |||||
logOnFirstPass(vPath + " already added, skipping", | |||||
Project.MSG_INFO); | |||||
return; | return; | ||||
} else if (duplicate.equals("fail")) { | } else if (duplicate.equals("fail")) { | ||||
throw new BuildException("Duplicate file " + vPath | throw new BuildException("Duplicate file " + vPath | ||||
@@ -1524,7 +1527,7 @@ public class Zip extends MatchingTask { | |||||
} else { | } else { | ||||
// duplicate equal to add, so we continue | // duplicate equal to add, so we continue | ||||
logOnFirstPass("duplicate file " + vPath | logOnFirstPass("duplicate file " + vPath | ||||
+ " found, adding.", Project.MSG_VERBOSE); | |||||
+ " found, adding.", Project.MSG_VERBOSE); | |||||
} | } | ||||
} else { | } else { | ||||
logOnFirstPass("adding entry " + vPath, Project.MSG_VERBOSE); | logOnFirstPass("adding entry " + vPath, Project.MSG_VERBOSE); | ||||
@@ -1745,7 +1748,8 @@ public class Zip extends MatchingTask { | |||||
v.addElement(orig[i]); | v.addElement(orig[i]); | ||||
} else { | } else { | ||||
logOnFirstPass("Ignoring directory " + orig[i].getName() | logOnFirstPass("Ignoring directory " + orig[i].getName() | ||||
+ " as only files will be added.", Project.MSG_VERBOSE); | |||||
+ " as only files will be added.", | |||||
Project.MSG_VERBOSE); | |||||
} | } | ||||
} | } | ||||