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-ffa450edef68master
| @@ -53,7 +53,10 @@ inclusion/exclusion of files works, and how to write patterns.</p> | |||||
| <tr> | <tr> | ||||
| <td valign="top">style</td> | <td valign="top">style</td> | ||||
| <td valign="top">name of the stylesheet to use - given either relative | <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> | <td align="center" valign="top">Yes</td> | ||||
| </tr> | </tr> | ||||
| <tr> | <tr> | ||||
| @@ -153,7 +153,14 @@ public class XSLTProcess extends MatchingTask { | |||||
| long styleSheetLastModified = 0; | long styleSheetLastModified = 0; | ||||
| if (xslFile != null) { | if (xslFile != null) { | ||||
| try { | 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 | // Create a new XSL processor with the specified stylesheet | ||||
| styleSheetLastModified = file.lastModified(); | styleSheetLastModified = file.lastModified(); | ||||
| log( "Loading stylesheet " + file, Project.MSG_INFO); | log( "Loading stylesheet " + file, Project.MSG_INFO); | ||||