ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Judy Pearson" <>
Subject RE: Can you compile C++ and C from ant
Date Wed, 10 Jul 2002 14:26:08 GMT
The tasks for compiling c/c++ are in the ant-contrib. (There's no Ant on my
browser. What I meant to say was: If you ask your browser to search for the
string "Build ant-contrib-cpptasks - C/C++ compilation tasks for Ant", you
should find the site with that title.)

As far as adding the task, you have to let ant know about it by adding a
taskdef to your build.xml file. Then you can use it like any other task.

Here's an example of adding a cruiseControl task called modificationset:
  <target name="modificationcheck" depends="init"
            description="--> cruiseControl repository check for
modifications since last good build">
    <echo message="Checking for modifications since last good build . . ."/>
    <!-- This is not a standard ant task, so add the taskdef here -->
    <taskdef name="modificationset"
    <modificationset lastbuild="${lastGoodBuildTime}"
      dateformat="yyyy-MMM-dd HH:mm:ss">

The taskdef can be placed outside of any target if that makes more sense.

I don't build c or c++, so I'm sure there are others out there who can speak
more clearly on any specifics about c c++ builds. I messed around a little
and got this trivial build to work using gcc - gcc and ar are in my path and
I placed the cpptasks.jar in the $ANT_HOME/lib directory:

    <taskdef name="cc" classname="net.sf.antcontrib/cpptasks/CCTask"  />
    <cc link="none" objdir=".">
      <compiler name="gcc"/>
      <includepath location="${cvs.home}"/>
      <includepath location="${cvs.home}/src"/>
      <includepath location="${cvs.home}/lib"/>
      <fileset dir="${cvs.home}/src/">
        <include name="*diff.*"/>

- Judy
  -----Original Message-----
  From: Martin Gainty []
  Sent: Tuesday, July 09, 2002 4:01 PM
  Subject: RE: Can you compile C++ and C from ant

  Where is Ant on your browser???
  How does one add gcc (for cpp) task???

  Martin Gainty


  Disclaimer and confidentiality note

  Everything in this e-mail and any attachments relating to the official
business of Laconia Data Systems (LDS) is proprietary to the company. It is
confidential, legally privileged and protected by law. LDS does not own and
endorse any other content. Views and opinions are those of the sender unless
clearly stated as being that of LDS.

  The person addressed in the e-mail is the sole authorised recipient.
Please notify the sender immediately if it has unintentionally reached you
and do not read, disclose or use the content in any way.

  LDS can not assure that the integrity of this communication has been
maintained nor that it is free of errors, virus, interception or


  >From: "Judy Pearson"
  >Reply-To: "Ant Users List"
  >To: "Ant Users List"
  >Subject: RE: Can you compile C++ and C from ant
  >Date: Tue, 9 Jul 2002 11:02:49 -0700
  >MIME-Version: 1.0
  >Received: from ([]) by with Microsoft SMTPSVC(5.0.2195.4905); Tue, 9 Jul
2002 11:02:07 -0700
  >Received: (qmail 27213 invoked by uid 97); 9 Jul 2002 18:03:02 -0000
  >Received: (qmail 27163 invoked by uid 98); 9 Jul 2002 18:03:01 -0000
  >Mailing-List: contact; run by ezmlm
  >Precedence: bulk
  >List-Id: "Ant Users List"
  >Delivered-To: mailing list
  >X-Antivirus: nagoya (v4198 created Apr 24 2002)
  >Message-ID: <005401c22772$d62f6320$>
  >X-Priority: 3 (Normal)
  >X-MSMail-Priority: Normal
  >X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
  >Importance: Normal
  >X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
  >X-Spam-Rating: 1.6.2 0/1000/N
  >X-OriginalArrivalTime: 09 Jul 2002 18:02:09.0488 (UTC)
  >Look for
  >Build ant-contrib-cpptasks - C/C++ compilation tasks for Ant
  >on your browser
  >go to home from there and you'll find the download for it.
  >- Judy
  > > -----Original Message-----
  > > From:
  > >
  > >
  > >]On Behalf Of Jennifer Moter
  > > Sent: Tuesday, July 09, 2002 10:47 AM
  > > To:
  > > Subject: Can you compile C++ and C from ant
  > >
  > >
  > > I have a project of mixed java, C and C++ files.
  > >
  > > Is there a way of compiling the C and C++ files other than calling
  > > exec make?
  > >
  > > --
  > > To unsubscribe, e-mail:
  > > For additional commands, e-mail:
  > >
  >To unsubscribe, e-mail:
  >For additional commands, e-mail:

  MSN Photos is the easiest way to share and print your photos: Click Here

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message