• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

only default is working!

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have written the following in build.xml
==========================================
<?xml version="1.0" encoding="UTF-8"?>
<project name="helloworld" default="compile" basedir=".">
<description>
Build file for the Hello World application.
</description>

<target name="compile" description="Compile all sources.">
<mkdir dir="classes" />
<javac srcdir="src" destdir="classes" />
</target>

<target name="clean" description="Clean up output directories.">
<delete dir="classes" />
</target>

<target name="rebuild" depends="clean,compile"
description="Cleanly compiles all sources." />
</project>

==================================================
But only the default "compile" seems to be working.
when i am putting the delete task in compile target it's working fine.
which proves target set in default attribute of project is working.
what should i do to make all the targets work.
i am new to ant and i am using 1.5.4 version.
[ February 21, 2006: Message edited by: Bear Bibeault ]
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the error you see, or the behaviour that you expect to happen and is not?

(And why are you using v1.5.4 when 1.6.5 is the current version?)
[ February 21, 2006: Message edited by: Paul Sturrock ]
 
subho saha
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I expect the "rebuild" target to work first which will call targets clean and then compile. But by default only compile is happening.
rebuild and clean is not getting called.
It is a bit problematic to download and work with 1.6 version from where i run this ant.
[ February 21, 2006: Message edited by: subho saha ]
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
rebuild will work if you call it. Your default is compile, so unless you tell ant otherwise it will only ever call compile. How do you run ant?
 
subho saha
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just by typing
ant in the command promt of the directory containing the build.xml.
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you do that Ant looks for a file called build.xml, then calls the default target in that build file. It will not call any of the other targets unless you explicitly ask it to. Run Ant with the -help option to see what other option you can run Ant with.
 
subho saha
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the suggestion paul.
 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
change your default to "rebuild", so everytime you run it will first clean the classes directory and then compiles it.

else, you can give like this:

ant (takes the default compile)
ant clean (takes the target clean)
ant rebuild (takes the target rebuild)

Thanks, Guru
 
reply
    Bookmark Topic Watch Topic
  • New Topic