views:

183

answers:

3

I have the following Nant Script snippet.

<zip zipfile="${devEnvironment}..\dev-${datetime::get-year(datetime::now())}${datetime::get-month(datetime::now())}${datetime::get-day(datetime::now())}.zip">
    <fileset basedir="${devEnvironment}">
        <include name="**/*"/>
    </fileset>
</zip>

The devEnvironment property is set to a valid UNC path used in copy tasks in other places of the script. When I run the above zip task, it tells me that there are 0 files to archive (in essence, it makes an empty zip file). If I replace the devEnvironment variable in the basedir attribute with the UNC path, it works without any issues.

I've looked at examples online and most show a variable being used for the basedir; however, my attempts do not seem to work.

Am I doing something wrong?

EDIT: For completion sake, here's the UCN path contained in the devEnvironment variable with specific info left out.

\\serverName\wwwroot\appName\site\
+1  A: 

Run it verbose. I'll bet a dollar the macro expansion is evaluating to something you don't expect.

Charlie Martin
A: 

After running the script in verbose mode without making any changes to the script itself (not even hitting save again), it worked fine. I'll try it again without verbose mode. Weird but at least it's working now.

Thanks

JamesEggers
A: 

What does Nant do with backslashes in strings? My first guess would be that the string really expands to

\serverNamewwwroot[BEL]ppNamesite
Charlie Martin