sheofir / maven-replacer-plugin

Automatically exported from code.google.com/p/maven-replacer-plugin
0 stars 0 forks source link

multi-file replacements should allow to transform output filename #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use multiple file replacements e.g. via <includes>*.template</includes>
2. run maven build

What is the expected output? What do you see instead?
since you have used <includes> you can not specify an <outputFile>, this
means that the replacement is done directly in the input files.
it would be great if there would be a possibility to write to different
output files. For example, they could be based on the input filename:
<include>
   <includes>*.template</includes>
</include>
<outputFiles>
   <inputFilePattern>(.*).template</inputFilePattern>
   <replacement>$1.xml</replacement>
</outputFilePattern>

internally, this could be done like that for example:
inFile.getAbsolutePath().replaceAll(inputFilePattern, replacement)

What version of the product are you using? On what operating system?
1.3

Please provide any additional information below.

Original issue reported on code.google.com by deru...@gmail.com on 5 Mar 2010 at 4:55

GoogleCodeExporter commented 9 years ago
instead of overwriting the .template files this should produce .xml files with 
the
tokens being replaced.

Original comment by deru...@gmail.com on 5 Mar 2010 at 4:58

GoogleCodeExporter commented 9 years ago
Interesting idea, I will experiment with this and let you know.

Original comment by baker.st...@gmail.com on 6 Mar 2010 at 7:18

GoogleCodeExporter commented 9 years ago
I've experimented with the plugin source code and added a new property 
"outputdir". Example:

<filesToInclude>*.sql</filesToInclude>
<basedir>src/main/sql</basedir>
<outputdir>target/processedsql</outputdir>

This allows me to leave the input files unmodified and save the processed files 
into target/processedsql

Original comment by maff...@gmail.com on 1 Nov 2010 at 3:22

GoogleCodeExporter commented 9 years ago
I think this enhancement would still be useful in cases where the output file 
names need some pattern specified.

Original comment by baker.st...@gmail.com on 27 Nov 2010 at 5:22

GoogleCodeExporter commented 9 years ago

Original comment by baker.st...@gmail.com on 12 Mar 2012 at 7:01

GoogleCodeExporter commented 9 years ago
Code changes made. New paramters: inputFilePattern and outputFilePattern added. 
These must be used together to take effect.

e.g. inputFilePattern of 'test-(.+)-file' and outputFilePattern of: test-$1-new 
with a file named: test-template-file will have it's replacements written to: 
'test-template-new'.

This is currently in trunk and awaits the next release.

Original comment by baker.st...@gmail.com on 12 Mar 2012 at 7:23

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Just issue clean up.

Original comment by baker.st...@gmail.com on 17 Sep 2012 at 12:41