The main function I wanted was something to evaluate expressions so I could
write tasks like this:

<cc>
  <sources>
    <includes name="cmn/*.cpp"/>
    <includes name="xbox/*.cpp" if="${platform} == xbox"/>
    <includes name="ps2/*.cpp"  if="${platform} == ps2"/>
  </sources>
</cc>

I figured this was a two step process:
1. Getting a function that could evaluate expressions
2. Changing how if/unless work so that the string passed in gets passed to
the Evaluate function.

Without point 2 the above would look like:
    <includes name="xbox.cpp" if="${Evaluate(${platform} == xbox)"/>


I'm not sure about others but this seems a lot cleaner than this:
<script>
        // some goop I can't remember

        switch (Project.Properties["platform"]) {
        case "xbox":
                Project.Properties.Add("platform.xbox", "true");
                break;
        case "ps2":
                Project.Properties.Add("platform.ps2", "true");
                break;
        case "win":
                Project.Properties.Add("platform.win", "true");
                break;
        // ...
        }
        // some goop I can't remember
</script>
<cc>
  <sources>
    <includes name="cmn/*.cpp"/>
    <includes name="win/*.cpp"  if="${platform.win}"/>
    <includes name="xbox/*.cpp" if="${platform.xbox}"/>
    <includes name="ps2/*.cpp"  if="${platform.ps2}"/>
  </sources>
</cc>

And this still wouldn't allow me to write:
    <includes name="shared/foo.cpp"  if="${platform} == ps2 || ${platform}
== xbox"/>


Also how about doing something if a file or directory exist?

<include buildfile="UserSettings.xml" if="${FileExists(UserSettings.xml)}"/>


I do understand the slipperly slope of this but what I'm trying to do is
make writing complicated tasks feasible.  I totally understand where xslt
went and I pulled my hair out there as well.  What I'm proposing is just a
different way of running 'tasks' that return information in a way that is
more intuitive than the xml way of doing things.  To prevent something like
this from happending:

        <available propertyname="UserSettings-available"
file="UserSettings.xml"/>
        <include buildfile="UserSettings.xml" if="UserSettings-available"/>

Maybe we can find a better solution? 


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to