My NAnt builds have been broken for some time because my <csc> task was generating the 
wrong name for an embedded .XML resources file.
However, I noticed that some flexibility was added to NAnt in 0.8.4, so I've upgraded 
NAnt and I'm now trying to use the dynamicprefix=
attribute on the <resources> tag of <csc>, but to no avail.

Without dynamicprefix=, NAnt builds the .resources file name as: 
<Namespace>.<ResxFilename>.resources, which doesn't match VS.NET's
behaviour. So, I added dynamicprefix="true" and a prefix= attribute. Now I have no 
idea what NAnt is doing. Now the .resources file name
seems to be: <nameOfFirstClassFromCorrespondingC#File>.resources. No, I'm not kidding: 
the name in the assembly is
Agama.AgamaLibrary.CommandLineArgumentParser.resources, and the only thing called 
"CommandLineArgumentParser" in my code base is an abstract
base class. I'm absolutely baffled. Can someone please help me out?

Here is my build file:

<?xml version="1.0" encoding="utf-8"?>
<project default="test" name="AgamaLibrary">
  <property name="agama.root" value="c:\agama\net" />
  <property name="documentation.lib" value="c:\agama\net\doc" />
  <property name="target.type" value="library">
  </property>
  <property name="project.FormalName" value="AgamaLibrary" />
  <target name="init" description="Initialize properties for the build">
    <tstamp />
    <mkdir dir="${documentation.lib}" />
    <property name="project.output" value="${project.FormalName}.dll" />
    <property name="vbc.optionCompare" value="" />
    <property name="vbc.optionExplicit" value="false">
    </property>
    <property name="vbc.optionStrict" value="false">
    </property>
    <property name="rootNamespace" value="AgamaLibrary" />
    <property name="crystalDecisionsLib" value="c:\Program Files\Common Files\Crystal 
Decisions\1.1\Managed" />
  </target>
  <target name="init-Debug" depends="init">
    <property name="dir.output" value=".\bin\Debug" />
    <mkdir dir="${dir.output}" />
    <property name="dir.lib" value="${agama.root}\Debug" />
    <mkdir dir="${dir.lib}" />
    <copy todir="${dir.lib}">
      <fileset basedir="${crystalDecisionsLib}">
        <includes name="*.dll" />
      </fileset>
    </copy>
    <property name="define" value="DEBUG;TRACE" />
    <property name="optimize" value="false" />
    <property name="incremental" value="false" />
    <property name="unsafe" value="/unsafe-">
    </property>
    <property name="debug" value="true" />
    <property name="doc" value="${dir.output}/AgamaLibrary.xml" />
    <property name="docisset" value="true" />
    <property name="removeintchecks" value="false" />
  </target>
  <target name="init-Release" depends="init">
    <property name="dir.output" value=".\bin\Release" />
    <mkdir dir="${dir.output}" />
    <property name="dir.lib" value="${agama.root}\Release" />
    <mkdir dir="${dir.lib}" />
    <copy todir="${dir.lib}">
      <fileset basedir="${crystalDecisionsLib}">
        <includes name="*.dll" />
      </fileset>
    </copy>
    <property name="define" value="TRACE" />
    <property name="optimize" value="true" />
    <property name="incremental" value="false" />
    <property name="unsafe" value="/unsafe-">
    </property>
    <property name="debug" value="false" />
    <property name="doc" value="${dir.output}/AgamaLibrary.xml" />
    <property name="docisset" value="true" />
    <property name="removeintchecks" value="false" />
  </target>
  <target name="compile-Debug" description="Compile project" depends="init-Debug">
    <csc target="${target.type}" output="${dir.output}\${project.output}" 
debug="${debug}" define="${define}" doc="${doc}"
optioncompare="${vbc.optionCompare}" optionexplicit="${vbc.optionExplicit}" 
optionstrict="${vbc.optionStrict}"
removeintchecks="${removeIntChecks}" rootnamespace="${rootNamespace}">
      <arg value="${unsafe}">
      </arg>
      <sources>
        <includes name="AgamaRegistry.cs" />
        <includes name="AgamaUtilities.cs" />
        <includes name="AgamaXML.cs" />
        <includes name="ApplicationProgrammingErrorException.cs" />
        <includes name="ArgumentParser.cs" />
        <includes name="AssemblyInfo.cs" />
        <includes name="GDI32.cs" />
        <includes name="UUEncode.cs" />
      </sources>
      <resources prefix="${rootNamespace}" dynamicprefix="true">
        <includes name="ArgumentParser.resx" />
      </resources>
      <references>
        <includes name="System.dll" />
        <includes name="System.Data.dll" />
        <includes name="System.Xml.dll" />
        <includes name="System.Drawing.dll" />
        <includes name="System.Windows.Forms.dll" />
      </references>
    </csc>
  </target>
  <target name="build-Debug" description="Do an incremental Debug build" 
depends="compile-Debug">
    <copy file="${dir.output}\${project.output}" todir="${dir.lib}" verbose="true" />
    <copy file="${dir.output}\${project.FormalName}.pdb" todir="${dir.lib}" 
verbose="true" failonerror="false" if="${debug}" />
  </target>
  <target name="clean-Debug" depends="init-Debug" description="Delete output of a 
Debug build">
    <delete file="${dir.output}\${project.output}" verbose="true" failonerror="false" 
/>
    <delete file="${dir.output}\${project.FormalName}.pdb" verbose="true" 
failonerror="false" />
    <delete file="${doc}" verbose="true" failonerror="false" if="${docisset}" />
    <delete dir="${dir.output}" />
  </target>
  <target name="compile-Release" description="Compile project" depends="init-Release">
    <csc target="${target.type}" output="${dir.output}\${project.output}" 
debug="${debug}" define="${define}" doc="${doc}"
optioncompare="${vbc.optionCompare}" optionexplicit="${vbc.optionExplicit}" 
optionstrict="${vbc.optionStrict}"
removeintchecks="${removeIntChecks}" rootnamespace="${rootNamespace}">
      <arg value="${unsafe}">
      </arg>
      <sources>
        <includes name="AgamaRegistry.cs" />
        <includes name="AgamaUtilities.cs" />
        <includes name="AgamaXML.cs" />
        <includes name="ApplicationProgrammingErrorException.cs" />
        <includes name="ArgumentParser.cs" />
        <includes name="AssemblyInfo.cs" />
        <includes name="GDI32.cs" />
        <includes name="UUEncode.cs" />
      </sources>
      <resources prefix="${rootNamespace}" dynamicprefix="true">
        <includes name="ArgumentParser.resx" />
      </resources>
      <references>
        <includes name="System.dll" />
        <includes name="System.Data.dll" />
        <includes name="System.Xml.dll" />
        <includes name="System.Drawing.dll" />
        <includes name="System.Windows.Forms.dll" />
      </references>
    </csc>
  </target>
  <target name="build-Release" description="Do an incremental Release build" 
depends="compile-Release">
    <copy file="${dir.output}\${project.output}" todir="${dir.lib}" verbose="true" />
    <copy file="${dir.output}\${project.FormalName}.pdb" todir="${dir.lib}" 
verbose="true" failonerror="false" if="${debug}" />
    <copy file="${doc}" todir="${documentation.lib}" verbose="true" if="${docisset}" />
    <copy file="${dir.output}\${project.output}" todir="${documentation.lib}" 
verbose="true" if="${docisset}" />
  </target>
  <target name="clean-Release" depends="init-Release" description="Delete output of a 
Release build">
    <delete file="${dir.output}\${project.output}" verbose="true" failonerror="false" 
/>
    <delete file="${dir.output}\${project.FormalName}.pdb" verbose="true" 
failonerror="false" />
    <delete file="${doc}" verbose="true" failonerror="false" if="${docisset}" />
    <delete dir="${dir.output}" />
  </target>
  <target name="compile" depends="compile-Debug,compile-Release">
  </target>
  <target name="build" depends="build-Debug,build-Release">
  </target>
  <target name="clean" depends="clean-Debug,clean-Release">
    <delete dir="./obj" verbose="true" failonerror="false" />
  </target>
  <target name="test" depends="build">
  </target>
</project>


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to