I am in need of some help using the <include> tag.  Perhaps this is not an
issue with the tag, but nonetheless, I am still confused.  I will state my
case as brief as possible and give more information further down.

I am trying to do the following:  

FILE1 <include> FILE2, FILE2 <include> FILE3, and FILE3 <include> FILE4.
All of these files are in different locations.  This works like a champ.

The problem is if I try to <include> more than 1 file in a file far down the
include chain, the location where the <include> looks changes.  For
instance, this does NOT seem to work:

FILE1 <include> FILE2, FILE2 <include> FILE3, FILE3 <include> FILE4, and
FILE3 <include> FILE5 (which in my case is in the same directory as FILE4).
In this case, everything is included properly except FILE5 because for some
reason, the path of where the include looks is INSTANTLY changed…  Is this
odd?  I do not understand why this occurs…  If interested, I give more
information below.

Thanks,

Shane


Here is the contents of FILE4:

<?xml version="1.0" encoding="UTF-8"?>
<project name="Common.targets">
        <description>Common targets for projects</description>

        <!--
===================================================================== -->
        <!-- Public Common Targets
-->
        <!--
===================================================================== -->
        <target name="noop">
                <echo>Executing the noop common target</echo>
        </target>
        <target name="build" depends="-build-init, -build-windows,
-build-mono">
                <echo>Executing the build common target</echo>
        </target>
        <target name="clean" depends="-clean-build-windows,
-clean-build-mono">
                <echo>Executing the clean common target</echo>
        </target>

        <!--
===================================================================== -->
        <!-- Include the Supporting Targets
-->
        <!--
===================================================================== -->
        <property name="supporting.targets.dir" value="./SupportingTargets"
readonly="true"/>

        <echo>BEFORE INCLUDE:
nant.project.basedir=${nant.project.basedir}</echo>
        <echo>BEFORE INCLUDE:
nant.project.buildfile=${nant.project.buildfile}</echo>
        <echo>BEFORE INCLUDE:
supporting.targets.dir=${supporting.targets.dir}</echo>

        <include buildfile="${supporting.targets.dir}/Build.targets"/>
        
        <echo>AFTER INCLUDE:
nant.project.basedir=${nant.project.basedir}</echo>
        <echo>AFTER INCLUDE:
nant.project.buildfile=${nant.project.buildfile}</echo>
        <echo>AFTER INCLUDE:
supporting.targets.dir=${supporting.targets.dir}</echo>
        
        <!-- For some reason this include doesn't look in the same directory
as    -->
        <!-- above include... hence, Clean.targets is not found...
-->
        <include verbose="true"
buildfile="${supporting.targets.dir}/Clean.targets"/>

</project>


And here is the output of the file when main build file is FILE1:

NAnt version 0.8.3 Copyright (C) 2001-2003 Gerry Shaw
http://nant.sourceforge.net

settings warning: frameworkinfo netcf-1.0 is invalid and has not been
loaded: framework Assembly Dir C:\Program Files\Microsoft Visual Studio .NET
2003\CompactFrameworkSDK\v1.0.5000\Windows CE does not exist
settings warning: frameworkinfo mono-1.0 is invalid and has not been loaded:
frameworkDir C:\Program Files\Mono-0.25\bin does not exist
settings warning: frameworkinfo sscli-1.0 is invalid and has not been
loaded: frameworkDir C:\sscli\build\v1.x86fstchk.rotor does not exist
Buildfile: file:///C:/Documents and Settings/staylor/Desktop/Working
Copy/Golf/Core/Core.build
Base Directory: C:\Documents and Settings\staylor\Desktop\Working
Copy\Golf\Core.
  [sysinfo] Setting system information properties under sys.*
  [sysinfo] nant.version = 0.8.3.23326
  [sysinfo] sys.os = Microsoft Windows NT 5.1.2600.0
  [sysinfo] sys.os.platform = Win32NT
  [sysinfo] sys.os.folder.programfiles = C:\Program Files
  [sysinfo] sys.os.folder.commonapplicationData = C:\Documents and
Settings\All Users\Application Data
  [sysinfo] sys.os.folder.temp = C:\DOCUME~1\staylor\LOCALS~1\Temp\
  [sysinfo] sys.clr.version = 1.1.4322.573
  [sysinfo] sys.os.version = 5.1.2600.0
  [sysinfo] sys.os.folder.commonprogramFiles = C:\Program Files\Common Files
  [sysinfo] sys.os.folder.applicationdata = C:\Documents and
Settings\staylor\Application Data
  [sysinfo] sys.os.folder.desktopdirectory = C:\Documents and
Settings\staylor\Desktop
  [sysinfo] sys.os.folder.system = C:\WINDOWS\System32
  [include] Including file C:\Documents and Settings\staylor\Desktop\Working
Copy\Golf\Core\Core.properties.
  [include] Including file C:\Documents and Settings\staylor\Application
Data\User.properties.
  [include] Including file C:\Documents and Settings\staylor\Desktop\Working
Copy\Golf\Core\Master.properties.
  [include] Including file C:\Documents and Settings\staylor\Desktop\Working
Copy\Golf\Master.properties.
  [include] Including file C:\Documents and Settings\staylor\Desktop\Working
Copy\Master.properties.
  [sysinfo] Setting system information properties under sys.*
  [sysinfo] nant.version = 0.8.3.23326
  [sysinfo] sys.os = Microsoft Windows NT 5.1.2600.0
  [sysinfo] sys.os.platform = Win32NT
  [sysinfo] sys.os.folder.programfiles = C:\Program Files
  [sysinfo] sys.os.folder.commonapplicationData = C:\Documents and
Settings\All Users\Application Data
  [sysinfo] sys.os.folder.temp = C:\DOCUME~1\staylor\LOCALS~1\Temp\
  [sysinfo] sys.clr.version = 1.1.4322.573
  [sysinfo] sys.os.version = 5.1.2600.0
  [sysinfo] sys.os.folder.commonprogramFiles = C:\Program Files\Common Files
  [sysinfo] sys.os.folder.applicationdata = C:\Documents and
Settings\staylor\Application Data
  [sysinfo] sys.os.folder.desktopdirectory = C:\Documents and
Settings\staylor\Desktop
  [sysinfo] sys.os.folder.system = C:\WINDOWS\System32
     [echo] load.common.targets = true
  [include] Including file C:\Documents and Settings\staylor\Desktop\Working
Copy\Common.targets.
     [echo] BEFORE INCLUDE: nant.project.basedir=C:\Documents and
Settings\staylor\Desktop\Working Copy\Golf\Core
     [echo] BEFORE INCLUDE: nant.project.buildfile=file:///C:/Documents and
Settings/staylor/Desktop/Working Copy/Golf/Core/Core.build
     [echo] BEFORE INCLUDE: supporting.targets.dir=./SupportingTargets
  [include] Including file C:\Documents and Settings\staylor\Desktop\Working
Copy\SupportingTargets\Build.targets.
     [echo] root.dir=C:\Documents and Settings\staylor\Desktop\Working
Copy\Golf\Core
     [echo] root.dir=C:\Documents and Settings\staylor\Desktop\Working
Copy\Golf\Core
     [echo] AFTER INCLUDE: nant.project.basedir=C:\Documents and
Settings\staylor\Desktop\Working Copy\Golf\Core
     [echo] AFTER INCLUDE: nant.project.buildfile=file:///C:/Documents and
Settings/staylor/Desktop/Working Copy/Golf/Core/Core.build
     [echo] AFTER INCLUDE: supporting.targets.dir=./SupportingTargets
  [include] Including file C:\Documents and Settings\staylor\Desktop\Working
Copy\Golf\Core\SupportingTargets\Clean.targets.  <----- Why is it looking
here???
Total time: 0 seconds.

BUILD FAILED

C:\Documents and Settings\staylor\Desktop\Working Copy\Common.targets(35,3):
 Could not include build file C:\Documents and
Settings\staylor\Desktop\Working
Copy\Golf\Core\SupportingTargets\Clean.targets:
NAnt.Core.BuildException: C:\Documents and Settings\staylor\Desktop\Working
Copy\Common.targets(35,3):
 Could not include build file C:\Documents and
Settings\staylor\Desktop\Working
Copy\Golf\Core\SupportingTargets\Clean.targets --->
System.IO.DirectoryNotFoundException: Could not find a part of the path
"C:\Documents and Settings\staylor\Desktop\Working
Copy\Golf\Core\SupportingTargets\Clean.targets".
   at System.IO.__Error.WinIOError(Int32 errorCode, String str)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath,
Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share)
   at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials
credentials)
   at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type
ofObjectToReturn)
   at System.Xml.XmlTextReader.CreateScanner()
   at System.Xml.XmlTextReader.Init()
   at System.Xml.XmlTextReader.Read()
   at System.Xml.XmlValidatingReader.ReadWithCollectTextToken()
   at System.Xml.XmlValidatingReader.Read()
   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean
preserveWhitespace)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at System.Xml.XmlDocument.Load(String filename)
   at NAnt.Core.Tasks.IncludeTask.ExecuteTask()
   --- End of inner exception stack trace ---
   at NAnt.Core.Tasks.IncludeTask.ExecuteTask()
   at NAnt.Core.Task.Execute()
   at NAnt.Core.Project.InitializeProjectDocument(XmlDocument doc)
   at NAnt.Core.Tasks.IncludeTask.ExecuteTask()
   at NAnt.Core.Task.Execute()
   at NAnt.Core.Project.InitializeProjectDocument(XmlDocument doc)
   at NAnt.Core.Tasks.IncludeTask.ExecuteTask()
   at NAnt.Core.Task.Execute()
   at NAnt.Core.Project.InitializeProjectDocument(XmlDocument doc)
   at NAnt.Core.Tasks.IncludeTask.ExecuteTask()
   at NAnt.Core.Task.Execute()
   at NAnt.Core.Project.InitializeProjectDocument(XmlDocument doc)
   at NAnt.Core.Tasks.IncludeTask.ExecuteTask()
   at NAnt.Core.Task.Execute()
   at NAnt.Core.Project.InitializeProjectDocument(XmlDocument doc)
   at NAnt.Core.Project.Execute()
   at NAnt.Core.Project.Run()




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.530 / Virus Database: 325 - Release Date: 10/22/2003
 



-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to