Browse Source

Fix new style test so that it pases on Linux. There appeared

to be a clock granularity problem where the output and the stylesheet
both have the same timestamp. I have change the test in XSLTProcess to
run the xslt in this case. Also added a more meaningful message


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275221 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 21 years ago
parent
commit
eb409a2265
2 changed files with 7 additions and 3 deletions
  1. +1
    -1
      src/etc/testcases/taskdefs/style/testNewerStylesheet.xsl
  2. +6
    -2
      src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java

+ 1
- 1
src/etc/testcases/taskdefs/style/testNewerStylesheet.xsl View File

@@ -3,7 +3,7 @@
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output type="text"/>
<xsl:output method="text"/>

<xsl:template match="/">
${xsl.value}


+ 6
- 2
src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java View File

@@ -523,13 +523,17 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger {
Project.MSG_DEBUG);
log("Style file " + xslFile + " time: " + styleSheetLastModified,
Project.MSG_DEBUG);
if (force || inFile.lastModified() > outFile.lastModified()
|| styleSheetLastModified > outFile.lastModified()) {
if (force || inFile.lastModified() >= outFile.lastModified()
|| styleSheetLastModified >= outFile.lastModified()) {
ensureDirectoryFor(outFile);
log("Processing " + inFile + " to " + outFile,
Project.MSG_INFO);
configureLiaison(stylesheet);
liaison.transform(inFile, outFile);
} else {
log("Skipping input file " + inFile
+ " because it is older than output file " + outFile
+ " and so is the stylesheet " + stylesheet, Project.MSG_DEBUG);
}
} catch (Exception ex) {
log("Failed to process " + inFile, Project.MSG_INFO);


Loading…
Cancel
Save