views:

315

answers:

2

Is there a NAnt task that will echo out all property names and values that are currently set during a build? Something equivalent to ant's echoproperties task maybe.

+1  A: 

You can't prove a negative, but I can't find one and haven't seen one. I've traditionally rolled my own property echoes.

John Rudy
+6  A: 

Try this snippet:

<project>
    <property name="foo" value="bar"/>
    <property name="fiz" value="buz"/>

    <script language="C#" prefix="util" >
        <code>
            <![CDATA[
            public static void ScriptMain(Project project) 
            {
                foreach (DictionaryEntry entry in project.Properties)
                {
                    Console.WriteLine("{0}={1}", entry.Key, entry.Value);
                }
            }
            ]]>
        </code>
    </script>
</project>

You can just save and run with nant.

And no, there isn't a task or function to do this for you already.

craigb
That's pretty neat. Cheers.
serg10
That may well be the coolest thing I've read this week! +1!
John Rudy