If your using the latest nightly build, you can setup a patternset.
Other than that I don't know a way.

 

I assume you tried to use two references sections? Not sure if this is
supported... the doc doesn't always say?

 

You could create a target and put your fileset in it. Something like
this:

 

<target name="SetReferences">

<assemblyfileset id="sys.assemblies">

    <include name="System.dll" />

    <include name="System.Data.dll" />

    <include name="System.Xml.dll" />

    <include name="System.Security.dll" if="IncludeSecurity" />

</assemblyfileset>

</target>

 

<property name="IncludeSecurity" value="False" />

<call target="SetReferences" />

<csc target="exe" output="HelloWorld_standard.exe">

    <sources>

        <include name="**/*.cs" />

    </sources>

    <references refid="sys.assemblies" /> <!-standard assembly reference
-->

</csc>

 

<property name="IncludeSecurity" value="True" />

<call target="SetReferences" />

<csc target="exe" output="HelloWorld_secure.exe">

    <sources>

        <include name="**/*.cs" />

    </sources>

    <references refid="sys.assemblies">

                <include name="System.Security.dll" />
<!-additional reference for specific program-->

   </references>

</csc>

 

Although it doesn't seem to buy you a lot. It seems that just including
the references in each csc task would be much cleaner and more readable!

 

BOb

 

 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris
Snider
Sent: Wednesday, January 23, 2008 11:12 AM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] Assembly File Sets and Additions

 

The NAnt documentation lists the following example for modules type
parameter of the csc/vbc task:

<assemblyfileset id="sys.assemblies">

    <include name="System.dll" />

    <include name="System.Data.dll" />

    <include name="System.Xml.dll" />

</assemblyfileset>

    

 

Use the predefined set of assemblies to compile a C# assembly.

 

<csc target="exe" output="HelloWorld.exe">

    <sources>

        <include name="**/*.cs" />

    </sources>

    <references refid="sys.assemblies" />

</csc>

    

 

How can I define an assembly set (or a reference set for that matter)
then add to it in the task itself as follows:

<csc target="exe" output="HelloWorld_standard.exe">

    <sources>

        <include name="**/*.cs" />

    </sources>

    <references refid="sys.assemblies" /> <!-standard assembly reference
-->

</csc>

 

<csc target="exe" output="HelloWorld_secure.exe">

    <sources>

        <include name="**/*.cs" />

    </sources>

    <references refid="sys.assemblies">

                <include name="System.Security.dll" />
<!-additional reference for specific program-->

   </references>

</csc>

 

 

I tried this example and it failed to build indicating that the
System.Security.dll was not found.  When I move the reference to the
sys.assemblies setup, then it compiles.  However, since I probably only
need the System.Security.dll in 1 of many targets, I cannot find a way
to standardize the common references then add the extra ones as required
in the target itself.

 

Thanks,

 

Chris

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to