imk / docbkx-tools

Automatically exported from code.google.com/p/docbkx-tools
0 stars 0 forks source link

Maven-Plugin: Process several books with same file name #120

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I have a project like

src
 |-- documentation1
      |-- index.xml
      |-- some other content
 |-- documentation2
      |-- index.xml
      |-- some other content

When running the maven plugin to export both index.xml to pdf
(using <includes> documentation1/index.xml, documentation2/index.xml</includes>)
I end up with one index.pdf.
-> the index.fo files are in the correct subdirectories!!!

In AbstractFoMojo.getOutputFile(File inputFile)
"targetDirectory + FileUtils.basename(inputFile.getAbsolutePath())" is done, 
which throws away the sub-directory information

I would suggest to do the following instead (inputFile is fo-file if I'm right) 
:
  String baseTargetFile = inputFile.getAbsolutePath().substring(0, inputFile.getAbsolutePath().lastIndexOf("."));
  return new File(baseTargetFile + "." + currentFileExtension);

best regards

PS.: yes, I know, the easy workaround is to give them different names ....

Original issue reported on code.google.com by karokir...@googlemail.com on 31 Mar 2015 at 4:42