Re: Slightly more advanced resource filtering (templating)?

2017-01-03 Thread org . apache . maven . user
On 2017-01-03T19:32:59 +0100
Guillaume Boué  wrote:

> It sounds like you're looking for the parse-version goal of the 
> build-helper-maven-plugin: 

On 2017-01-03T19:36:16 +0100
Karl Heinz Marbaise  wrote:
> Hi,
> 
> have you taken a look at the build-helper-maven-plugin

On 2017-01-03T12:45:19 -0600
Curtis Rueden  wrote:

> Hi,
> 
> In addition to the suggestion of others to use parse-version...

Thanks to all of you!

build-helper-maven-plugin looks to be exactly what I need.

M


pgp2negKEm8Wd.pgp
Description: OpenPGP digital signature


Re: Slightly more advanced resource filtering (templating)?

2017-01-03 Thread Curtis Rueden
Hi,

In addition to the suggestion of others to use parse-version, the
build-helper-maven-plugin also has the regex-property goal, which lets you
assign a property based on a regex. Here is an example:


  sanitize-version
  
regex-property
  
  
sanitizedVersion
${project.version}
^([0-9]+)\.([0-9]+)\.([0-9]+).*$
$1.$2.$3
false
  


Regards,
Curtis

--
Curtis Rueden
LOCI software architect - http://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - http://imagej.net/User:Rueden


On Tue, Jan 3, 2017 at 12:32 PM, Guillaume Boué 
wrote:

> Hi,
>
> It sounds like you're looking for the parse-version goal of the
> build-helper-maven-plugin: http://www.mojohaus.org/build-
> helper-maven-plugin/parse-version-mojo.html. It can decompose the project
> version into several Maven properties. There is an example of usage here
> http://www.mojohaus.org/build-helper-maven-plugin/usage.html
> #Access_the_parsed_components_of_a_project_version.
>
> Guillaume
>
>
>
> Le 03/01/2017 à 19:25, org.apache.maven.u...@io7m.com a écrit :
>
>> Hello.
>>
>> I have a small project that contains a plugin for Blender[0]. Plugins
>> in Blender are Python files that must contain a hash value at the top
>> of the file containing version information. The version information has
>> to be numeric constants as Blender actually parses this data rather
>> than evaluating it in an interpreter.
>>
>> https://github.com/io7m/smf/blob/develop/io7m-smfj-blender/
>> src/main/resources/__init__.py
>>
>> Right now, I'm having to remember to manually insert the right version
>> number each time I increment the Maven version. I'd much rather filter
>> the Python source file as a resource instead, but unfortunately I'd
>> need to transform the Maven version string:
>>
>>2.3.1 → (2, 3, 1)
>>
>> Is there an existing plugin that can do this? I assume that it'd be
>> some sort of templating engine. Unfortunately, all of the search
>> results for that seem to be in regards to the site plugin.
>>
>> M
>>
>> [0] http://blender.org
>>
>
>
> ---
> L'absence de virus dans ce courrier électronique a été vérifiée par le
> logiciel antivirus Avast.
> https://www.avast.com/antivirus
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Slightly more advanced resource filtering (templating)?

2017-01-03 Thread Karl Heinz Marbaise

Hi,

have you taken a look at the build-helper-maven-plugin which has a goal 
parse-version which will result in appropriate properties which than can 
be used to achieve what you like.



Kind regards
Karl Heinz Marbaise

http://www.mojohaus.org/build-helper-maven-plugin/parse-version-mojo.html


On 03/01/17 19:25, org.apache.maven.u...@io7m.com wrote:

Hello.

I have a small project that contains a plugin for Blender[0]. Plugins
in Blender are Python files that must contain a hash value at the top
of the file containing version information. The version information has
to be numeric constants as Blender actually parses this data rather
than evaluating it in an interpreter.

https://github.com/io7m/smf/blob/develop/io7m-smfj-blender/src/main/resources/__init__.py

Right now, I'm having to remember to manually insert the right version
number each time I increment the Maven version. I'd much rather filter
the Python source file as a resource instead, but unfortunately I'd
need to transform the Maven version string:

  2.3.1 → (2, 3, 1)

Is there an existing plugin that can do this? I assume that it'd be
some sort of templating engine. Unfortunately, all of the search
results for that seem to be in regards to the site plugin.

M

[0] http://blender.org




-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Slightly more advanced resource filtering (templating)?

2017-01-03 Thread Guillaume Boué

Hi,

It sounds like you're looking for the parse-version goal of the 
build-helper-maven-plugin: 
http://www.mojohaus.org/build-helper-maven-plugin/parse-version-mojo.html. 
It can decompose the project version into several Maven properties. 
There is an example of usage here 
http://www.mojohaus.org/build-helper-maven-plugin/usage.html#Access_the_parsed_components_of_a_project_version.


Guillaume


Le 03/01/2017 à 19:25, org.apache.maven.u...@io7m.com a écrit :

Hello.

I have a small project that contains a plugin for Blender[0]. Plugins
in Blender are Python files that must contain a hash value at the top
of the file containing version information. The version information has
to be numeric constants as Blender actually parses this data rather
than evaluating it in an interpreter.

https://github.com/io7m/smf/blob/develop/io7m-smfj-blender/src/main/resources/__init__.py

Right now, I'm having to remember to manually insert the right version
number each time I increment the Maven version. I'd much rather filter
the Python source file as a resource instead, but unfortunately I'd
need to transform the Maven version string:

   2.3.1 → (2, 3, 1)

Is there an existing plugin that can do this? I assume that it'd be
some sort of templating engine. Unfortunately, all of the search
results for that seem to be in regards to the site plugin.

M

[0] http://blender.org



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org