ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject datatypes, references and classpaths
Date Tue, 30 Apr 2002 06:58:16 GMT

I was filing this against the <cc> stuff in sourceforge, but now I think it
may be our problem.

Take a custom datatype, like say <defineset>, and declare it with a
classpath.

  <path id="cc.classpath">
    <pathelement location="lib/cpptasks.jar"/>
  </path>
  <taskdef name="cc"
    classname="net.sf.antcontrib.cpptasks.CCTask"
    classpathref="cc.classpath" />
  <typedef name="defineset"
    classname="net.sf.antcontrib.cpptasks.types.DefineSet"
    classpathref="cc.classpath" />

then declare one of these types with an ID

    <defineset id="build.defines">
      <define name="DEBUG" if="build.debug" />
      <define name="RELEASE" unless="build.debug" />
    </defineset>

then, later on, use it

 <target name="cc-windows" depends="headers" if="is-windows" >
    <cc debug="${build.debug}"
        link="shared"
        outfile="something"
        objdir="."
        multithreaded="true"
        exceptions="true"
        >
        <compiler name="msvc" />
        <fileset dir="src"/>
        <defineset refid="build.defines"/>
        <linker name="msvc" >
          <syslibset libs="kernel32,user32"/>
        </linker>
    </cc>
  </target>

run this and you get an error: build.defines doesn't denote a DefineSet

Add the appropriate jar file to ANT_HOME/lib and it all works.


Although I originally thought this was a cc funny (*), I think it an ant
classpath problem instead. Are we trying to do some datatype validation that
doesnt work with types on a different classpath?



(*) see:
https://sourceforge.net/tracker/index.php?func=detail&aid=550507&group_id=36
177&atid=416920


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message