Browse Source

Make <style> search relative to the project's basedir first - if it

cannot be found, fall back to the task's basedir and print a
deprecation warning.

Submitted by:	Jesse Glick <Jesse.Glick@netbeans.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268850 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 24 years ago
parent
commit
d7b8f63f01
2 changed files with 12 additions and 2 deletions
  1. +4
    -1
      docs/manual/CoreTasks/style.html
  2. +8
    -1
      src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java

+ 4
- 1
docs/manual/CoreTasks/style.html View File

@@ -53,7 +53,10 @@ inclusion/exclusion of files works, and how to write patterns.</p>
<tr>
<td valign="top">style</td>
<td valign="top">name of the stylesheet to use - given either relative
to the basedir attribute or as an absolute path.</td>
to the project's basedir or as an absolute path
<em><strong>DEPRECATED</strong> - can be specified as a path relative
to the basedir attribute of this task as well</em>.
</td>
<td align="center" valign="top">Yes</td>
</tr>
<tr>


+ 8
- 1
src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java View File

@@ -153,7 +153,14 @@ public class XSLTProcess extends MatchingTask {
long styleSheetLastModified = 0;
if (xslFile != null) {
try {
File file = project.resolveFile(xslFile, baseDir);
File file = project.resolveFile(xslFile, project.getBaseDir());

if (!file.exists()) {
log("DEPRECATED - the style attribute should be relative to the project\'s");
log(" basedir, not the tasks\'s basedir.");
file = project.resolveFile(xslFile, baseDir);
}
// Create a new XSL processor with the specified stylesheet
styleSheetLastModified = file.lastModified();
log( "Loading stylesheet " + file, Project.MSG_INFO);


Loading…
Cancel
Save