Grokbase Groups Ant user May 2002
FAQ
Hello,

I have tweaked <property> task a little to load values from XML file. The
loaded property names are: node1/node2/node2.Attribute or node/1/node2#TEXT.
If there are several nodes with the same names the first node's value will
be taken. Attached please find the source and a diff from version 1.48 .
This is an example how it works:

build2.xml:

<project default="main" basedir=".">
<property xmlFile="build2.xml"/>
<target name="main">
<echo message="Target.name=${project/target.name}">
Basedir=${project.basedir}
Target.name=${project/target.name}
Message=${project/target/echo.message}
</echo>
<echo>
Text:
${project/target/echo#TEXT}
======================================================
</echo>
</target>
<target name="main3">
<echo>
Basedir=${project.basedir}
Target.name=${project/target.name}
Message=${project/target/echo.message}
</echo>
</target>
</project>

Output:

Buildfile: build2.xml

main:
[echo] Target.name=main
[echo] Basedir=.
[echo] Target.name=main
[echo] Message=Target.name=main
[echo]
[echo] Text:
[echo] Basedir=.
[echo] Target.name=main
[echo] Message=Target.name=main
[echo]
[echo] ======================================================
[echo]

BUILD SUCCESSFUL
Total time: 1 second

--
{ http://trelony.cjb.net/ } Alexey N. Solofnenko
{ http://www.inventigo.com/ } Inventigo LLC
Pleasant Hill, CA (GMT-8 usually)

Search Discussions

  • Erik Hatcher at May 6, 2002 at 8:32 pm
    Sort of like this one?

    http://jakarta.apache.org/ant/manual/CoreTasks/xmlproperty.html

    Thats a new task in Ant 1.5. Could you compare/contrast your work with this
    tasks capabilities and perhaps get your work merged in with it if it
    provides additional features?

    The <property> task is so overloaded now that it was thought best to make it
    a separate task rather than adding one more feature to it.

    Erik

    ----- Original Message -----
    From: "Alexey Solofnenko" <alexeys@mdli.com>
    To: "Ant Users List" <ant-user@jakarta.apache.org>
    Sent: Monday, May 06, 2002 3:23 PM
    Subject: [SUBMIT] <property> to read XML file

    Hello,

    I have tweaked <property> task a little to load values from XML file. The
    loaded property names are: node1/node2/node2.Attribute or
    node/1/node2#TEXT.
    If there are several nodes with the same names the first node's value will
    be taken. Attached please find the source and a diff from version 1.48 .
    This is an example how it works:

    build2.xml:

    <project default="main" basedir=".">
    <property xmlFile="build2.xml"/>
    <target name="main">
    <echo message="Target.name=${project/target.name}">
    Basedir=${project.basedir}
    Target.name=${project/target.name}
    Message=${project/target/echo.message}
    </echo>
    <echo>
    Text:
    ${project/target/echo#TEXT}
    ======================================================
    </echo>
    </target>
    <target name="main3">
    <echo>
    Basedir=${project.basedir}
    Target.name=${project/target.name}
    Message=${project/target/echo.message}
    </echo>
    </target>
    </project>

    Output:

    Buildfile: build2.xml

    main:
    [echo] Target.name=main
    [echo] Basedir=.
    [echo] Target.name=main
    [echo] Message=Target.name=main
    [echo]
    [echo] Text:
    [echo] Basedir=.
    [echo] Target.name=main
    [echo] Message=Target.name=main
    [echo]
    [echo] ======================================================
    [echo]

    BUILD SUCCESSFUL
    Total time: 1 second

    --
    { http://trelony.cjb.net/ } Alexey N. Solofnenko
    { http://www.inventigo.com/ } Inventigo LLC
    Pleasant Hill, CA (GMT-8 usually)

    ----------------------------------------------------------------------------
    ----

    --
    To unsubscribe, e-mail: For additional commands, e-mail:

    --
    To unsubscribe, e-mail:
    For additional commands, e-mail:
  • Diane Holt at May 6, 2002 at 8:39 pm

    --- Erik Hatcher wrote:
    Sort of like this one?

    http://jakarta.apache.org/ant/manual/CoreTasks/xmlproperty.html
    Looks like it needs to be added to the overview tables page -- is that on
    your "doc to-do" list (or have I just added yet another item :)?

    Diane

    =====
    (holtdl@yahoo.com)



    __________________________________________________
    Do You Yahoo!?
    Yahoo! Health - your guide to health and wellness
    http://health.yahoo.com

    --
    To unsubscribe, e-mail:
    For additional commands, e-mail:
  • Erik Hatcher at May 6, 2002 at 8:51 pm
    I'll add it to my to-do list, which won't even start getting looked at for
    another several weeks.

    Erik


    ----- Original Message -----
    From: "Diane Holt" <holtdl@yahoo.com>
    To: "Ant Users List" <ant-user@jakarta.apache.org>
    Sent: Monday, May 06, 2002 4:39 PM
    Subject: Re: [SUBMIT] <property> to read XML file

    --- Erik Hatcher wrote:
    Looks like it needs to be added to the overview tables page -- is that on
    your "doc to-do" list (or have I just added yet another item :)?

    Diane

    =====
    (holtdl@yahoo.com)



    __________________________________________________
    Do You Yahoo!?
    Yahoo! Health - your guide to health and wellness
    http://health.yahoo.com

    --
    To unsubscribe, e-mail: For additional commands, e-mail:

    --
    To unsubscribe, e-mail:
    For additional commands, e-mail:

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriesant
postedMay 6, '02 at 7:24p
activeMay 6, '02 at 8:51p
posts4
users3
websiteant.apache.org

People

Translate

site design / logo © 2017 Grokbase