Hi Jason,
Not much work has been done yet. I have created a really minimal version
of the plugin. Thats 7 lines of real code. Have a look at the plugin if
you want to, its attached to
https://issues.apache.org/jira/browse/GERONIMO-1659 . It may not be the
best way of doing it, but doubt there is any simpler way.
/Anders
Jason van Zyl wrote:
Anders Hessellund Jensen wrote:
I would like to be able to substitute timestamps with the build time
into a resource file. As I understand it, there is currently no plugin
to to this, so I consider writing one.
Sorry for not responding to this earlier, and I know that you've started
working on this plugin and I'd like to harness the work you've done but
I think what you are doing should be an extension to the resources
plugin. We should figure out how to augment filtering of resources. I
think the easiest way to do this is to filter the resources using Velocity.
This way additional tools can be created for swizzling resources and
this can all happen in one pass through velocity instead of having N
plugins which need to make N passes over the resources to filter them.
So I don't want to discourage you at all. Work on the plugin and I will
try to integrate your code into the resources plugin when you are done.
The other advantage of using Velocity in the resources plugin will allow
you to use Velocity directives in your resources so you can do any sort
of conditional logic you may want to have instead of simple
substitution. So I think we would benefit in two ways using Velocity
here: scalable addition of tools that can be used to swizzle resources
(a timestamp tool is a perfect example) and conditional logic which can
sometimes be useful like looking at a property introduced by a profile
and behave a certain way for example.
The plugin should leverage the existing resource filtering mechanism
of M2. The plugin would take a configuration like this:
<configuration>
<timestamps>
<timestamp>
<propertyName>build.date</propertyName>
<pattern>yyyy.MM.dd</pattern>
<timestamp>
<timestamps>
</configuration>
Running the plugin with this configuration would define the M2
property build.date, and any filtered resource file would get
${build.date} substituted with 2006.02.28 or whatever the date at
build time is.
WDYT?
Best regards,
Anders
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]