You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by gr...@tpg.com.au on 2005/12/21 08:38:49 UTC

Can a velocity build tool solve my requirement for a TAG based build/replace approach??

Hi,

I'm after a means to perform some simple TAG based replacements for my
script files when I "build" them and I'm wondering if velocity could be
used for this?  (or whether it's overkill for this and there is an
easier way - I'm still trying to work out whether an existing ANT task
could help out).

I am working with some scripting languages where I'd like to identify
common code and keep these in separate files (e.g. like JSP TAG
replacement concept but simpler).  What I'm looking for is a way to
specific a TAG in the source file, which within the TAG it identified
the file which has the common code.  Then when running the build from
the SOURCE to the BUILD area the TAGS would be replaced by the contents
of the files. So as an example if one of the source files were: 
-------------------------
this
this and that
<INSERT_TOKEN:c:\test\snippet.txt>
this that
this that
<INSERT_TOKEN:c:\test\discalimer.txt>
------------------------
So the resultant file would be one where the TAGS are replaced by the
content of the files which are specified within the tag.  Kind of like a
JSP tag concept, but for the scripting language environment I'm dealing
with.

Also the build should be setup to basically say look in SRC and build to
BUILD, i.e. so all files of the appropriate type in SRC and its
sub-directories would undergo this check for <TAG...>s and associated
file contents replacement.

Any ideas?  (again haven't yet worked out if ANT can handle this, am
interested in knowing if a velocity build tool could be used to solve it)

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org