Mauro,
 
The Nant task in question here is actually <script>. The <code> element contains the C# source for a method called ScriptMain.
 
What the C# code appears to do is set the program_files property (presumably accessed elsewhere in the script as ${program_files}) to the user/machine specific Program Files folder (typically C:\Program Files).
 
Hope this helps,
Regards,
Richard


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mauro Ciaccio
Sent: Monday, May 09, 2005 10:02
To: nant-users@lists.sourceforge.net
Subject: [Nant-users] (no subject)

Hi,

 

I’m trying to maintain someone else’s Nant script and have found the following which I don’t understand:

 

  <target name='init' description='preps the program_files property'>

    <script language="C#">

      <code><![CDATA[

        public static void ScriptMain(Project project) {

           if (project.Properties["program_files"] == null)

               project.Properties["program_files"] =

                   Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);

        }

      ]]></code>

    </script>

  </target>

 

I have looked for <code> under tasks and functions, but not found anything. I’d appreciate any clarification on the purpose of the above.

 

Thanks

 

Mauro Ciaccio

 

**********************************************************
Mauro Ciaccio
Software Engineer
E-mail:[EMAIL PROTECTED]
Web: www.beacon-ct.co.uk

Beacon Computer Technology Ltd
43 Clifton Road
Cambridge
Cambridgeshire CB1 7ED
Tel: 01223 506616
Fax: 01223 506620 **********************************************************

 

Reply via email to