[Mono-list] Eclipse assembly reference

Mark DevGood dirkroel at gmail.com
Wed Jul 29 05:23:41 EDT 2009


Hello

I have managed to achieve this, and its more down to how Eclipse works than
a mono issue per se. That is assuming you are compiling in Eclipse of
course. I am using a 'nant' task with the mono-2.0 assembly.

What you need to do is three things
- include the dll in the 'references' section of your csc nant task
- copy the dll to your bin folder using the nant task
- Right click the Project in Eclipse >> Properties >> Project References >>
Tick the relevant project. This step is not required if your referenced
project is not in eclipse, but if it is it will tell Eclipse to compile this
project as well when needed.

To give you a bit more help with steps 1 and 2 take a look at this sample
build file. What it does is to copy two dlls from two projects (called
Project1 and Project2), place the dlls in the bin folder, and to include
them when compiling:

<?xml version='1.0'?>
<project basedir='.' default='all' name='xline.Website.Tasks.Website'>
  <property name='nant.settings.currentframework' value='mono-2.0'/>
  <property name='build' value='bin'/>
  <property name='src' value='src'/>
  <property name='lib-project1' value='../project1/bin'/>
  <property name='lib-project2' value='../project2/bin'/>
  <target depends='Controls' name='all'/>
  <target name='Controls'>
    <copy todir='${build}'>
      <fileset basedir='${lib-project1}'>
      	<include name='*.dll*'/> 
      </fileset>
    </copy>
    <copy todir='${build}'>
      <fileset basedir='${lib-project2}'>
      	<include name='*.dll*'/>
      </fileset>
    </copy>
    <csc debug='true' optimize='true' output='${build}/Library.dll'
target='library' warninglevel='4'>
      <sources>
        <include name='test.aspx.cs'/>
        <include name='test.aspx.designer.cs'/>
      </sources>
      <references>
        <include name='System.Data.dll'/>
        <include name='System.Web.dll'/>
        <include name='System.Web.Services.dll'/>
        <include name='${build}/Project1.dll'/>
        <include name='${build}/Project2.dll'/>
      </references>
    </csc>
  </target>
</project>

Hope this helps!
- Mark
-- 
View this message in context: http://www.nabble.com/Eclipse-assembly-reference-tp23970689p24715550.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list