• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

help in Ant makefiles

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
could u guys help me in gettin accustomed in Ant ....i prefer to do the compiling part of the scjd through Ant..

thanx
abhi
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Abhi,

Perhaps you could provide us with an example of some task you are currently doing manually, then we might be able to offer an example of how to do it with ant.

Regards, Andrew
 
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Abhi Chat:
could u guys help me in gettin accustomed in Ant ....i prefer to do the compiling part of the scjd through Ant..

thanx
abhi



Here's the build.xml that I use to compile, jar and javadoc my project. Its pretty simple, no fancy dependencies or anything like that.
 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not a fan of Ant. Found gnu make is quite easy and works for me. Actually it will have me write a short script.
 
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Although I am working on an ANT build file...
JBuilder the free version, can handle all the building part if you dont want to or dont have time of learning ANT. Whats more the editor is briliantly good since it detects and underlines syntax errors saves me a bunch of time.
 
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using WSAD for the URLyBird.You may donload the freeware ide eclipse from eclipse.org which is what WSAD is using.

Other choices are NetBeans which Sun prefers but not IBM.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which version og JBuilder is free?
 
peter wooster
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by vydhehi paruchuri:
Which version og JBuilder is free?



The Foundation Edition, but don't use JBuilder for the SCJD, it will do too much to help build your GUI.
 
Andrew Monkhouse
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Andy Zhu:
Not a fan of Ant. Found gnu make is quite easy and works for me. Actually it will have me write a short script.



I am a convert to Ant.

I used to use make extensively to the point where I was asked to provide training to other companies and to help out other development teams with it. And I know from experience the difficulties you can get when dealing with the different variants (is the platform I am writing for using GNU make or POSIX or ???). But when writing C programs that were being compiled under many different Unix variants, it was great.

Ant's large number of built in tasks, but the add on tasks makes life so much easier than using make. And then the ant script can usually be run directly from the command line and/or many of the popular IDEs.

Regards, Andrew
 
Andrew Monkhouse
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Abhi,

Did Peter's ant file help you? Or are you thinking about posting a command line you would like converted into an ant script so you can see how it is done?

Regards, Andrew
 
peter wooster
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Andrew Monkhouse:
I am a convert to Ant.

I used to use make extensively ...



Same here, I've used so many different make utilities, I can't keep them straight, there's make, gmake, nmake, not to mention polytron pmake and make like utilities in other systems.

Ant is great for building java, it has all sorts of built in tasks that do much of what you need, and none of the Unix strange syntax (only known by shell programming gurus). Some people, myself included, aren't certain the XML syntax is the best, but it sure beats shell.
 
Inuka Vincit
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by peter wooster:


The Foundation Edition, but don't use JBuilder for the SCJD, it will do too much to help build your GUI.

]

Agreed. But you dont have to use the built in GUI Builder
But its the editor that got me. I tried eclipse and JEdit... but cant beat the built in sytax highlighting and checking. Its nice to have 0 syntax every time you do a complie .

I am also a convert from Make... I changed over for practicle reasons could get the winblows make port to work properly.
 
Abhi Chat
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Andrew,

Thanx guys for all your help....Andrew it would be nice if you could help me
with an ANT script of the project 2 version of Mehrams Habibis book...it would be really a good startin point for me...

Thanx

Abhi
 
Andrew Monkhouse
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Abhi,

This is a very simple ant build file, which is designed to just compile the source files in the project. I have not gone into the RMIC or JAR commands in this first build file, as I want to keep the first part simple. A little further down this post you will see the more advanced version of the ant script.



Save this as "build.xml" in your base directory (the one containing the "sampleproject" directory). Then you can use this to compile the source code just by typing "ant" at the command line. This is a little easier than retyping the entire set of compilation commands each time a single file changes!

Make sure you understand what is happening in that build file before going on. If there is something you don't understand, then the following won't help.

Here is a slightly longer version of that XML file, which includes targets to run the RMIC compiler, and to make the executable jar file:




If you run the command "ant -projecthelp" in the directory containing the above build.xml file, you will get the following output:



If you look through the build.xml file above, you will see that the compile and dist targets are the only two targets that I created a description for. That is why they are the only two targets that appear when you ask for project help. However there is nothing to stop you running one of the other targets directly. You could, for example, run ant rmic and it will run the rmic target.

I have tried to make this readable, without writing an entire book on the subject.

Please ask questions if you are unsure of anything.

Regards, Andrew
 
Abhi Chat
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx Andrew...this would surely get me started .....
 
reply
    Bookmark Topic Watch Topic
  • New Topic