New plugin - regular expression based properties

Daniel Tihelka <[email protected]> Thu, 19 Apr 2012 23:30:39 +0200
Newsgroups gmane.comp.java.cruise-control.devel
Message-ID <[email protected]>
Hallo,
I have just committed change which allows to write 3rd party properties plugin 
(e.g. getting properties from a database).

I also have an implementation of "regular expression properties plugin" which 
parses a given text file and defines properties based on the regular 
expressions.

As an example, let us consider the file with lines as follows:
<pre>
   name1[value1]
   name2[value2]  Anything may follow ...
   
   there may be anything as well ...
   
   name3[value3]; name4[value4]; name5[value5]
</pre>
 
and we want to define properties based on this. Moreover, we want to alter the 
names into the form: <code>build.attrib.special_name_1</code>. To achieve 
this, we need to define regex pattern:
 <pre>
   \s*([a-zA-Z]+)(\d+)[(\S+)]
 </pre>
then, the template of property name must be set to (referring to groups 1 and 
2):
 <pre>
   build.attrib.special_\1_\2 
 </pre>
and the value of property value is simple reference to group 3:
 <pre>
   \3 
 </pre>


So, the plugin is configured as follows:

<regexpproperties file="the.file" pattern="\s*([a-zA-Z]+)(\d+)[(\S+)]" 
name="build.attrib.special_\1_\2" value="\3" />


We will use it in our builds to define properties used later as the config 
options of the building (python) scripts. Since the options are defined in the 
python, their automatic definition from the python file(s) is much more robust 
(change of the option will not break the build since it will be re-defined 
automatically).


Now, the question is: do you want to have this regexproperties plugin included 
in CC? I can manage it as 3rd party plugin, but I thing it may be quite useful 
for other uses as well.

Best regards,
Dan T.

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2

_______________________________________________
Cruisecontrol-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cruisecontrol-devel
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iEYEABECAAYFAk+QhAgACgkQuYlVhxo/P1H8GACcCV3aMKzZh2GF3w0nGvshpRUl
FHAAoJuN2VAwctGc/lLaVWqKZzaS3eDz
=jYae
-----END PGP SIGNATURE-----