• 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

Building with ant

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everybody!

I was wondering if it makes sence to build the application using an ant-script? If yes, does anyone have any good guidelines for it? I have used it before, but never wrote it myself.

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


I assume I am allowed post this as it is not a required part of the submission process. Here is the build file I have been working on. It compiles the java files in the code directory into the classes directory. It then runs javadoc and builds a runme.jar executable. Finally it jars all the directories and files (except the classes directory which is not needed because of runme.jar) into a submission jar called srXXXXXX.jar

Feel free to use and modify all,
Mark
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just found this. Yes it's OK, but don't forget guys - Disclaimer: don't blame Mark or JR if this script does not do things the way that your assignment requires. Modify and use at your own risk.
 
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's so small

But mine does more, like running unit tests.
 
Mark Smyth
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeroen T Wenting:
It's so small

But mine does more, like running unit tests.



Yeah I had junit tests in for a while until I was happy with the code (like I will ever be happy with it) :roll: . I Left them out of the sumbission build tho.

Agree with Barry verify that it does put everything in the submission jar correctly according to your spec and I agree even more strongly with the not blaming me bit too .

Bear in mind that all the userguide.txt, choices.txt should be in the correct folders (docs), version.txt and original bd file in the same directory as the build.xml which will be the jar root.

Mark.

[ December 11, 2006: Message edited by: Mark Smyth ]
[ December 11, 2006: Message edited by: Mark Smyth ]
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!
What about running 'rmic'?
Didn't your requirement state that:

You must provide all classes pre-installed so that no dynamic class downloading occurs.


That means that I can't rely on the new RMI feature "dynamic generation of stubs", or have I misunderstood?
I can add the ant task myself I'm just wondering if I need to do the 'rmic' compilation.
Regards, Calle
PS This is my first post here, and I want to thank everybody that answers questions it is really helpful!! I've found lots of good information by searching the forum.
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yup, that's something else he forgot in his antfile.
 
Mark Smyth
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeroen T Wenting:
yup, that's something else he forgot in his antfile.



Damn you Java 5!! There is a good chance I would have submitted the project without that stub .

Phew!! Cheers Guys
 
Mark Smyth
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Been thinking some more about this. Is it dynamically generating the stub on the fly really the same as dynamically downloading it though? After all the classes are already in the clients jar file so it does have access to all the class files it needs to generate the stubs from locally.

Shouldn't we take advantage a cool new feature of the Java 5 runtime environment?

Mark.
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the server may be able to generate the stub on the fly, but you still need to download it to the client if you choose that...
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now I know why I scored 0 for the 'network server' section of my SCJD submission. I forgot to provide the stub.

I totally agree with Mark now: 'Damn you java 5'.

But at least I know now what the problem is. I feel relieved. Would have been really stupid if I would have failed because of that. Guess I'm a lucky bastard after all.
 
Mark Smyth
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Luc Feys:
Now I know why I scored 0 for the 'network server' section of my SCJD submission. I forgot to provide the stub.

I totally agree with Mark now: 'Damn you java 5'.

But at least I know now what the problem is. I feel relieved. Would have been really stupid if I would have failed because of that. Guess I'm a lucky bastard after all.



Guess I have my answer now!

Cheers all, I had a lucky escape here.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeroen T Wenting:
It's so small

But mine does more, like running unit tests.




I bet you can even type "ant make", Jeroen.
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can type it, but it won't do much. There's no make target
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hy gyus. I'm strugglying through developer exam as well. As I got a lot of good ideas from here, I provide something from me. Here we go..

Missing rmi targets:

<target name="rmic" description="Run rmic to compile stubs and skeletons" depends="compile">
<rmic classname="suncertify.urlybird.rmi.URLYBIRDImpl" classpath="${classes.dir}" base="${classes.dir}" />
</target>

OK - this is not needed, but I like to do everything from ANT.

<target name="rmiregistry" description="Start up rmiregistry">
<echo message="Start up the rmi registry" />
<exec executable="rmiregistry">
<arg value="-J-classpath"/>
<arg value="-Jrunme.jar"/>
</exec>
</target>
[ January 08, 2007: Message edited by: Jan Heideken ]
 
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems that jdk 5 makes a trap. For this reason, I decide to get rid of all new features of 5.0 and first run under jdk4.x and later jdk 5.0.
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I cannot get this to work with javadoc. How do I set that up in ant with eclipse?
 
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Try Window->Show -> Ant and you get the ant view add here your ant file and you can see a list wit all your tasks. Just click on a task the magic is happen.

Regards M.
reply
    Bookmark Topic Watch Topic
  • New Topic