Hooray for open source. I checked out the 'nant' task source code and it
appears that this is the proper way to use Project to run something:
NAnt.Core.Project buildProject = new NAnt.Core.Project(...);
buildProject.BuildTargets.Add(...);
buildProject.Run();
Everything's working now.
Thanks,
Keston
From: Wilson, Brian [mailto:brian.wil...@dhr.alabama.gov]
Sent: Monday, June 27, 2011 12:03 PM
To: Obendorf, Keston; nant-users@lists.sourceforge.net
Subject: RE: NAnt.Core.Project
I have never used the C# references before, so I am not able to confirm if they
work. For calling another Nant build, I use the <nant> task.
http://nant.sourceforge.net/release/latest/help/tasks/nant.html
I'll look and see if anyone has used this before.
Brian Wilson
Department of Human Resources
Email: brian.wil...@dhr.alabama.gov<mailto:brian.wil...@dhr.alabama.gov>
From: Obendorf, Keston [mailto:keston.obend...@intel.com]
Sent: Monday, June 27, 2011 1:01 PM
To: Wilson, Brian; nant-users@lists.sourceforge.net
Subject: RE: NAnt.Core.Project
The call is being made from a custom NAnt task I coded in C#.
From: Wilson, Brian [mailto:brian.wil...@dhr.alabama.gov]
Sent: Monday, June 27, 2011 5:43 AM
To: Obendorf, Keston; nant-users@lists.sourceforge.net
Subject: RE: NAnt.Core.Project
Are you making this call from a C# program? Or, do you have a task in your
build file that is coded in C#?
Brian Wilson
Department of Human Resources
Email: brian.wil...@dhr.alabama.gov<mailto:brian.wil...@dhr.alabama.gov>
From: Obendorf, Keston [mailto:keston.obend...@intel.com]
Sent: Friday, June 24, 2011 5:26 PM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] NAnt.Core.Project
I'm trying to make a custom Nant task that may end up calling another Nant
build file.
I create the project like so:
NAnt.Core.Project buildProject = new NAnt.Core.Project(BuildfilePath,
NAnt.Core.Level.Info, 1);
buildProject.Execute(BuildfileTarget);
This will not execute the target, giving the error log message that the target
was not found.
foreach (string s in buildProject.BuildTargets)
{
this.Project.Log(NAnt.Core.Level.Info, "BuildTarget: " + s);
}
foreach (NAnt.Core.Target t in buildProject.Targets)
{
this.Project.Log(NAnt.Core.Level.Info, "Target: " + t.Name);
}
Yields no results for either property.
I don't see a bug in for this, nor any documentation so I don't know if this is
expected behavior.
Does anyone have experience using the Project object?
_Keston
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users