|
From: Julian C. D. <Jul...@cb...> - 2005-08-29 21:57:18
|
On Mon, 2005-08-29 at 14:00 -0700, Carlos Sanchez wrote:
> Hi,
>
> Jelly can be very desperating at some times. Something that usually works is
> ${context.getVariable('maven.sdocbook.src.dir')}
> instead of
> ${maven.sdocbook.src.dir}
>
> if you can send a patch in unified diff format I'll try to fix it in CVS.
Yes, that fixed it... silly Jelly. Anyway, here's a patch. I still have to fix the PDF targets which have the same problem. This isn't the nicest way of doing it but I find Jelly so fragile I didn't want to do anything too adventurous :-/
===================================================================
RCS file: /cvsroot/maven-plugins/maven-plugins/sdocbook/plugin.jelly,v
retrieving revision 1.19
diff -u -r1.19 plugin.jelly
--- plugin.jelly 1 Aug 2005 21:52:14 -0000 1.19
+++ plugin.jelly 29 Aug 2005 21:51:25 -0000
@@ -189,10 +189,20 @@
<j:forEach var="file" items="${scanner.iterator()}">
- <!-- strip the extension from the file name -->
- <j:set var="index" value="${file.name.lastIndexOf('.')}"/>
- <j:set var="maven.sdocbook.out" value="${maven.sdocbook.generated}/${file.name.substring(0,index)}.html"/>
-
+ <!-- Ensure that the output file has the right hierarchy. -->
+ <!-- ofile initially contains the right path, wrong output extension,
+ which we fix just before attainGoal -->
+ <j:set var="ofile" value="${file.absolutePath.replaceFirst(context.getVariable('maven.sdocbook.src.dir'),context.getVariable('maven.sdocbook.generated'))}"/>
+
+ <j:set var="oindex" value="${ofile.lastIndexOf('/')}"/>
+ <j:set var="odir" value="${ofile.substring(0,oindex)}"/>
+
+ <!-- create target hierarchy -->
+ <mkdir dir="${odir}"/>
+
+ <!-- fix up extension on output file before running transform goal -->
+ <j:set var="index" value="${ofile.lastIndexOf('.')}"/>
+ <j:set var="maven.sdocbook.out" value="${ofile.substring(0,index)}.html"/>
<attainGoal name="sdocbook:transform"/>
</j:forEach>
--
-- Julian C. Dunn, B.A.Sc, P.Eng. <Jul...@cb...>
-- Platform Administrator, CBC.ca Production & Operations
-- Office: 2C310-Q * Tel.: (416) 205-3311 x5592
|