Re: NAnt.Core.Project
"Macdiarmid, James D." <[email protected]> Tue, 28 Jun 2011 08:13:00 -0400
| Newsgroups | gmane.comp.windows.dotnet.nant.user |
|---|---|
| Message-ID | <F7A8C27240D1154593A0F16214BF0BBD02D157C4@0015-its-exmb14.us.saic.com> |
Thanks for posting that, Keston! From: [email protected] [mailto:[email protected]] On Behalf Of Obendorf, Keston Sent: Monday, June 27, 2011 4:47 PM To: Wilson, Brian; [email protected] Subject: Re: [NAnt-users] NAnt.Core.Project 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:[email protected]] Sent: Monday, June 27, 2011 12:03 PM To: Obendorf, Keston; [email protected] 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: <mailto:[email protected]> [email protected] From: Obendorf, Keston [mailto:[email protected]] Sent: Monday, June 27, 2011 1:01 PM To: Wilson, Brian; [email protected] Subject: RE: NAnt.Core.Project The call is being made from a custom NAnt task I coded in C#. From: Wilson, Brian [mailto:[email protected]] Sent: Monday, June 27, 2011 5:43 AM To: Obendorf, Keston; [email protected] 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: <mailto:[email protected]> [email protected] From: Obendorf, Keston [mailto:[email protected]] Sent: Friday, June 24, 2011 5:26 PM To: [email protected] 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 [email protected] https://lists.sourceforge.net/lists/listinfo/nant-users