Menu

#377 Property macro expansion does not happen for Element types

closed-rejected
Core (183)
5
2005-05-29
2005-04-21
Copsey
No

In element.cs, in the CreateChildBuildElement method,
the parameter "properties" is not used.
Property macro expansion does not happen. In my
build, I have created a custom task which takes a
filename as a parameter

<blah>filename</blah>

but when i use it with a property, its not expanded

<blah>${filename}</blah>

(get "${filename} not found")

Discussion

  • Gert Driesen

    Gert Driesen - 2005-05-04

    Logged In: YES
    user_id=707851

    Can you send me a repro and provide more information on
    the behaviour you were expecting ?

     
  • Copsey

    Copsey - 2005-05-05
     
  • Copsey

    Copsey - 2005-05-05

    Logged In: YES
    user_id=1263750

    I've uploaded a test task .cs file [Test2Task.cs].

    If you look at, say, this property

    [BuildElement("size", Required=true)]
    public TextElement Size{...}

    When using this in an actual build, if I use a property instead
    of a literal in the build file, it is not expanded (it is treated as
    a literal).
    I would expect it to be expanded (as is the case when I use a
    TaskAttribute attribute on a property)

     
  • Gert Driesen

    Gert Driesen - 2005-05-29

    Logged In: YES
    user_id=707851

    I don't think we should be expanding properties in raw XML.

    This is something you can easily take care off yourself using
    Project.ExpandProperties.

    For the example you attached, you'd need to modify
    TextElement.Text to

    public string Text
    {
    get
    {
    Project.ExpandProperties(this.XmlNode.InnerText,
    Location);
    }
    }

     
  • Gert Driesen

    Gert Driesen - 2005-05-29
    • assigned_to: nobody --> drieseng
    • status: open --> closed-rejected
     

Log in to post a comment.