From: Bob A. <Bob...@am...> - 2008-12-08 17:50:57
|
<include buildfile="${path::get-full-path(local.properties)}" /> Wouldn't you need a .xml here since that is your file name? BOb ________________________________ From: Ben Floyd [mailto:dat...@gm...] Sent: Monday, December 08, 2008 12:45 PM To: nan...@li... Subject: [NAnt-users] Including properties from another build file incurrent build file 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 |