Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#195 Missing includepath type definition needed with ant 1.7.0

open
Curt Arnold
cpptasks (103)
5
2007-01-02
2007-01-02
Mathieu Champlon
No

Hello,

The following build.xml file used to be valid with ant 1.6.5 :
<project>
<taskdef resource="net/sf/antcontrib/cpptasks/antlib.xml"/>
<includepath id="my-id"/>
</project>
(the cpptasks jar must be in the ant lib/ directory)

With ant 1.7.0 it generates the following error :
build.xml:3: Problem: failed to create task or type includepath
Cause: The name is undefined.

Adding one line to cpptasks.types solves the issue :
includepath=net.sf.antcontrib.cpptasks.types.IncludePath

MAT.

Discussion

  • Logged In: YES
    user_id=71590
    Originator: YES

    Oups sorry I mixed up my test build files...

    Actually the code that use to be valid with ant 1.6.5 and isn't anymore with ant 1.7.0 is :
    <project>
    <taskdef resource="net/sf/antcontrib/cpptasks/antlib.xml"/>
    <path id="my-id"/>
    <cc>
    <includepath refid="my-id"/>
    </cc>
    </project>

    Now with ant 1.7.0 the error is : build.xml:11: my-id doesn't denote a includepath
    Adding the type definition makes it possible to declare :
    <includepath id="my-id"/>

     
  • DanDevine
    DanDevine
    2007-06-21

    Logged In: YES
    user_id=1779317
    Originator: NO

    I think I may be getting something similar....

    Snip from build.xml that works under 1.6.5 but broken in 1.7.0

    <path id="public_include">
    <pathelement path="${basedir}/public"/>
    </path>

    <path id="private_include">
    <pathelement path="${basedir}/inc"/>
    <pathelement path="${basedir}/util"/>
    </path>

    <target name="build_core" description="Builds the Discovery Tool library (tdtlib)">
    <echo message="Building tdtlib"/>
    <mkdir dir="${build_dir}/tdtlib"/>
    <cc name="${compiler}" debug="${debug}" link="static" objdir="${build_dir}/tdtlib"
    optimize="${optimize_level}" outfile="${build_dir}/tdtlib/tdt">
    <compilerarg value="-ftest-coverage" if="define_gcov"/>
    <compilerarg value="-fprofile-arcs" if="define_gcov"/>
    <compilerarg value="${debug_level}" if="define_debug"/>
    <defineset define="_DEBUG" if="define_debug"/>

    <fileset refid="core_source"/>
    <fileset refid="util_source"/>
    <includepath refid="public_include"/>
    <includepath refid="private_include"/>
    </cc>

    </target>

    Build fails with "public_include doesn't denote a IncludePath"....

    After changing the above <path> elements for "public_include" and "private_include" to <includepath>, I receive the error listed above.

    Again, the <path> elements worked alright with the ccTask <includepath> input under 1.6.5 but broken in 1.7.0

    DD

     
  • DanDevine
    DanDevine
    2007-06-21

    Logged In: YES
    user_id=1779317
    Originator: NO

    Added "includepath=net.sf.antcontrib.cpptasks.types.IncludePath" to the file cpptasks.types and recompiled.

    After recompile, I added this to my apache-ant-1.7.0\lib directory and reran my build script.

    Still no difference, still error.

    Am I missing something?

    Thanks,
    DD

     
  • Logged In: YES
    user_id=71590
    Originator: YES

    Hello,

    I don't known why it doesn't seem to work for you.
    Here is the content of my cpptasks.types file for reference :

    defineset=net.sf.antcontrib.cpptasks.types.DefineSet
    compiler=net.sf.antcontrib.cpptasks.CompilerDef
    linker=net.sf.antcontrib.cpptasks.LinkerDef
    targetplatform=net.sf.antcontrib.cpptasks.TargetDef
    versioninfo=net.sf.antcontrib.cpptasks.VersionInfo
    distributer=net.sf.antcontrib.cpptasks.DistributerDef
    syslibset=net.sf.antcontrib.cpptasks.types.SystemLibrarySet
    libset=net.sf.antcontrib.cpptasks.types.LibrarySet
    includepath=net.sf.antcontrib.cpptasks.types.IncludePath

    Are your sure the cpptasks.jar file picked by ant is the patched one ?
    Did you try and uncompress the .jar to check the cpptask.types file ?

    MAT.

     
  • Garret
    Garret
    2007-10-17

    Logged In: YES
    user_id=1111186
    Originator: NO

    Hi,

    I just ran into this problem when I upgrade to ant 1.7.0 also. I tried the work-around of adding the includepath line to the cpptasks.types file, and like DD, this did not seem to fix my problem at first.

    Then I re-read mat007's post more carefully and there is actually a second change he made in the build file itself:

    <path id="my-id"/>

    to

    <includepath id="my-id"/>

    Once I did this everything started working! Thanks for the work-around and perhaps this will help clarify the work-around for others too.

    - Garret