Jump to content

  • Log In with Google      Sign In   
  • Create Account


Another Neat Tool (ANT): It's better than batch files :)

  • You cannot reply to this topic
No replies to this topic

#1 AngleWyrm   Members   -  Reputation: 553

Like
0Likes
Like

Posted 31 July 2013 - 11:48 PM

So there I was, just a hackin' and a codin' a mod for Minecraft in Eclipse. And at the end, there's a bunch of stuff to do: Run a couple special external tools, relocate a bunch of files into a new folder tree, and then zip them up, add comments to the zip file, and so on. And I had a pretty cool batch file to do all that. Then someone showed me ANT, and I'm sold.

 

Ant does all the stuff I was doing, but much more elegantly. The tool uses an xml file, usually called build.xml, and it looks like this:

<project>
   <target>
       <!-- do some stuff -->
   </target>
 
   <target>
      <!-- do some other stuff -->
   </target>
</project>

The build.xml that I made for my Minecraft modding endeavors looks like so:

Spoiler

 

It can do advanced stuff, like substituting a token string during a copy operation. Within my source files is @VERSION@, but when copied by the build.xml, that string gets replaced.


Edited by AngleWyrm, 31 July 2013 - 11:54 PM.

--"I'm not at home right now, but" = lights on, but no ones home

Sponsor:




PARTNERS