ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Judy Pearson" <judy.pear...@conducivetech.com>
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"
classname="net.sourceforge.cruisecontrol.ModificationSet"
classpath="${ccHome}"/>
    <modificationset lastbuild="${lastGoodBuildTime}"
      quietperiod="30"
      dateformat="yyyy-MMM-dd HH:mm:ss">
      <cvselement
      localworkingcopy="./junit/samples"/>
    </modificationset>
  </target>


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.*"/>
      </fileset>
    </cc>

- Judy
  -----Original Message-----
  From: Martin Gainty [mailto:mgainty@hotmail.com]
  Sent: Tuesday, July 09, 2002 4:01 PM
  To: ant-user@jakarta.apache.org
  Cc: judy.pearson@conducivetech.com
  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
interference.

               _______________________________________________



  >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 nagoya.betaversion.org ([192.18.49.131]) by
mc1-f19.law16.hotmail.com 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 ant-user-help@jakarta.apache.org; run by ezmlm
  >Precedence: bulk
  >List-Unsubscribe:
  >List-Subscribe:
  >List-Help:
  >List-Post:
  >List-Id: "Ant Users List"
  >Delivered-To: mailing list ant-user@jakarta.apache.org
  >X-Antivirus: nagoya (v4198 created Apr 24 2002)
  >Message-ID: <005401c22772$d62f6320$2a1f6bc6@judy.sight-n-sound.com>
  >X-Priority: 3 (Normal)
  >X-MSMail-Priority: Normal
  >X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
  >In-Reply-To:
  >Importance: Normal
  >X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
  >X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
  >Return-Path: ant-user-return-22618-mgainty=hotmail.com@jakarta.apache.org
  >X-OriginalArrivalTime: 09 Jul 2002 18:02:09.0488 (UTC)
FILETIME=[BE74DD00:01C22772]
  >
  >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:
  > >
ant-user-return-22617-judy.pearson=conducivetech.com@jakarta.apache.org
  > >
[mailto:ant-user-return-22617-judy.pearson=conducivetech.com@jakarta.apa
  > > che.org]On Behalf Of Jennifer Moter
  > > Sent: Tuesday, July 09, 2002 10:47 AM
  > > To: ant-user@jakarta.apache.org
  > > 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

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