I'm having a problem with the <include /> task trying to load a local
properties file from a global properties file. The following build files
should explain the problem:
===========================
C:\Dev\project\ui\ui.build
===========================
<? xml version="1.0" encoding="utf-8" ?>
<project name="project.ui" basedir="." default="build" xmlns="
http://nant.sf.net/release/0.86-beta1/nant.xsd">
<property name="root.dir" value=".." />
<include buildfile="${root.dir}/properties.build" />
<target name="build" depends="init">
... compile project etc etc ... this works just fine ...
</target>
<target name="dist" depends="build">
<echo message="Property is needed here: ${server.base}" />
</target>
</project>
===========================
C:\Dev\project\properties.build
===========================
<?xml version="1.0" encoding="utf-8"?>
<project name="global.properties" xmlns="
http://nant.sf.net/release/0.86-beta1/nant.xsd">
<property name="src.dir"
value="${path::get-full-path(project::get-base-directory())}" />
<property name="build.dir" value="${src.dir}\build" />
<!-- Load local properties if it exists -->
<property name="local.properties" value="${root.dir}\local.properties.xml"
/>
<if test="${file::exists(local.properties)}">
<echo message="Local properties file exists!" />
<include buildfile="${path::get-full-path(local.properties)}" />
</if>
</project>
===========================
C:\Dev\project\local.properties.xml
===========================
<?xml version="1.0" encoding="utf-8"?>
<project name="local.properties" xmlns="
http://nant.sf.net/release/0.86-beta1/nant.xsd">
<property name="server.base" value="http://localhost:8080/server/" />
</project>
===========================
BUILD OUTPUT - C:\Dev\project\ui>nant.exe -buildfile:ui.build -nologo dist
===========================
Buildfile: file:///C:/Dev/project/ui/ui.build
Target framework: Microsoft .NET Framework 3.5
Target(s) specified: dist
[echo] Local properties file exists!
init:
compile.models:
compile.views:
compile.presenters:
compile:
build:
dist:
BUILD FAILED
C:\Dev\project\ui\ui.build (46,8):
Property evaluation failed.
Expression: ${server.base}
^^^^^^^^^^^
Property 'server.base' has not been set.
Total time: 0.3 seconds.
===========================
When running the ui build script, everything works until it needs to
reference properties that are found in local.properties.xml. I reference
properties that are defined in properties.build and those work just fine. I
can't find anything on the nant website that would explain this problem. Any
suggestions would be very welcome!
Thank You,
BF
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users