Re: Property resolution broken in nested property definition

Alexander Röhnsch <[email protected]>
Newsgroups gmane.comp.java.cruise-control.user
Message-ID <[email protected]>
In the meantime I had second thoughts about the matter.

Apparently, inside plugin templates no variable properties can be 
defined, i.e properties that derive from template parameters.

It seems that CruiseControl evaluates properties and plugin 
preconfigurations only once and immediatly upon reading the config file. 
The only exception being template parameters. They parametrize instances 
of the plugin preconfiguration. Confusingly they are implemented as 
property.

Template parameters can not be used to define another property inside 
the plugin preconfiguration as you would expect from a 
template/parameter concept normally. The point is that all properties 
(that is all properties that are not template parameters) have already 
been evaluated when the plugin templates get evaluated. That goes for 
properties inside templates as well. In my original example below, the 
broken-parameter-expansion property always evaluates to "${parameter}" 
literally. That makes it somewhat difficult to use the template 
mechanism comfortably.

I wish properties inside templates and even nested plugin 
preconfigurations were evaluated anew for each template instance. That 
would add a huge reuse benefit.

Regards,
Alexander Röhnsch


Am 27.08.2010 16:43, schrieb Alexander Röhnsch:
> Hi,
>
> I'm using the Project plugin preconfiguration method as described in the
> wiki (http://confluence.public.thoughtworks.org/display/CC/ConfigFiles).
>
> Apparently, a property given as parameter to a preconfigured project
> instance is not always resolved inside the preconfiguration.
>
> Please see the example below. The<exec>  command calls echo by means of
> a windows cmd /c call. Can be changed to a sh call on unix systems.
>
> Couldn't find the issue on the archive. What's your opinion?
>
>
> Kind Regards,
>       Alexander Röhnsch
>
>
> Example CruiseControl config script:
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <cruisecontrol>
>     <plugin name="project.new"
> classname="net.sourceforge.cruisecontrol.ProjectConfig">
>
>       <!-- Apparently, plugin template parameter properties are neither
> expanded
>            in a<plugin>  attribute, nor in a<property>  attribute. -->
>       <property name="broken-parameter-expansion" value="${parameter}"/>
>
>       <!-- Expected output would be:
>
>               Parameter: This is a project parameter string.
>               Broken Parameter: This is a project parameter string.
>
>            But it is:
>
>               Parameter: This is a project parameter string.
>               Broken Parameter: ${parameter}
>       -->
>       <schedule interval="600">
>         <composite>
>           <exec command="cmd" args="/c echo Parameter: ${parameter}"/>
>           <exec command="cmd" args="/c echo Broken Parameter:
> ${broken-parameter-expansion}"/>
>         </composite>
>       </schedule>
>     </plugin>
>
>     <project.new name="Template Property Demonstration">
>       <property name="parameter" value="This is a project parameter
> string."/>
>     </project.new>
> </cruisecontrol>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
> Be part of this innovative community and reach millions of netbook users
> worldwide. Take advantage of special opportunities to increase revenue and
> speed time-to-market. Join now, and jumpstart your future.
> http://p.sf.net/sfu/intel-atom-d2d
> _______________________________________________
> Cruisecontrol-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user
>    


-- 
Viele Grüße
     Alexander Röhnsch

---------------------------------------------------------
  Model Engineering Solutions GmbH
  Dipl.-Inf. Alexander Röhnsch
  Friedrichstr. 50
  D-10117 Berlin (Germany)

  Tel.: +49(0)30 20659-172
  Fax:  +49(0)30 20659-200
  mailto:[email protected]
  http://www.model-engineers.com/

  Model Engineering Solutions GmbH
  Inhaber/Managing Directors:
     Dr.-Ing. Ingo Stürmer, Dr.-Ing. Hartmut Pohlheim
  Sitz/Domicile: Berlin
  Registergericht/Court of Registry:
     Amtsgericht Berlin Charlottenburg
  Handelsregister/Commercial Register No.: HRB 114038 B
---------------------------------------------------------


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.