The Source for Java Technology Collaboration
User: Password:



James Duncan Davidson

James Duncan Davidson's Blog

Ant dot-Next

Posted by duncan on June 12, 2003 at 04:33 PM | Comments (19)

One of the surprising things about JavaOne for me this year is the amount of talk about Ant. Not the normal "Ant is cool" buzz that I hear (and which still amazes me), but a different kind of talk. There's talk of experimentation and trying out new things. And it all seems to be focusing on how to alleviate the burden that the decision to use XML as the Ant configuration format has caused.

When I first chose XML as the configuration format for Ant, I figured it was a great way to replace the simple properties files that I was using before with a structure that could define hierarchical data. However, as time goes on the XML format becomes more and more burdensome to actually getting something done. Other people in other fields have noticed this XML burden as well and have come up with innovative solutions. One excellent example is the Textile human web text generator which turns a simple text format into HTML markup.

For a long time, I've thought that the way to alleviate the burden for Ant would be to use some sort of scripting language to front end the Ant task object model under the covers. After all, Ant build files have been picking up more and more logic control primitives and it's become a scripting language—even though many people including myself have cried out against it. In fact, as noted by Ken Arnold in a conversation yesterday, it was probably inevitable that the language has become as procedural as it has.

In that conversation with Ken, he forwarded his idea that the thing to do would be to figure out how to use the current Ant object model from some sort of scripting layer and that if he had a few months to spare, he'd go play with it. The funny thing is that I've been getting email from Jonathan Simon over the last couple of weeks about doing exactly this. Turns out that Jonathan is one of the contributors here on Java.net and wrote a piece about scripting with Jython instead of XML. I ran into him here at JavaOne and after my apologizing for my not keeping up with his mail (I'm so in need of a mail-only day), we talked a bit more about his ideas and where he's at. I think he's onto something. And based on the conversations I've had with Ken and several other people, I'm really enthusiastic to see what happens.

Jonathan has taken these thoughts to the next level in an email to the ant-dev mailing list. While I'm no longer involved in the day-to-day development of Ant, I wish Jonathan well in his efforts to look at different and potentially better ways to use Ant. And I think he's onto something great here. Hopefully his ideas will be well received by the Ant developer and user communities and will grow into a great implementation.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • scons
    It seems to me that as you move to jython to script ant, you might as well just go whole hog to python and use the scons system. After a build script or a buid system seems perfect for a language like python, as opposed to java.

    Posted by: dancingprog on June 13, 2003 at 12:46 PM

  • But XML Has a Scripting Language
    I think it'd be interesting to think of XSLT as the scripting language. It's got everything you need. It loops, it's extensible, there's even examples of how to do functional programming a la ML. I've done some projects with XSLT and WXS (schema) that look a lot like LISP projects. Very familiar.

    Posted by: billb on June 14, 2003 at 03:19 PM

  • Great idea
    For a long time I was thinking that writing complex scripts in ANT is taking longer then it should. One of the reason for that is that XML is too verbose and not suitable as a procedural language. I am really glad that the idea of finding better scripting language like Python is getting traction with in the community.

    Also I would like to point out on existing project which uses the same ideas already

    http://pynt.sourceforge.net/

    Posted by: apolenur on June 15, 2003 at 12:21 PM

  • Not yet convinced...
    ... that is what I am. The verbosity hasn't bothered me. Solving the problem has mostly been the bigger problem than coding it into ant.

    We have had some nice benfits, XSLT-ing build.xml scripts as well was web.xml files in webapps. Doing the same to a pure text file with the unix tools would have been so painful. Is there kind of a metalanguage to transform Python into a new Python similar to XSLT?

    Bashing XML seems to be getting common now. A bit too common for my taste. But I'm looking forward to every improvement though!

    Posted by: nestefan on June 16, 2003 at 01:17 AM

  • Please don't!!!
    I think you could most accurately sum your statement by 'when the only tool you have is a hammer, everything looks like a nail'. And since your hammer doesn't do something easily you are going to fix it so it does.

    When I put together a project I try to keep as much business logic in one language as possible. I prefer Java so that one language is usually Java.

    Now as soon as I write an Ant script I know that at least some of my logic has been split between two languages but the split is very one sided (99% Java, 1% Ant). If Ant had a more powerful scipting language, people will start create abominations. Like operator overloading in C++.

    Please spend more time on things like adding namespaces and tighter script validation. And while you are at it could you change the default filename to build.ant? XML files that use the .xml extension are so pass.

    Posted by: myshkin5 on June 16, 2003 at 09:06 AM

  • How Ant can contain business logic ?
    I don't see how Ant script can have any business logic at all. It just a facility to help build the software. So what ever is used for build Ant or Python business logic is still implemented using 100% Java, right?

    I understand that the advantages of XML is that we can apply XSLT and transform it to another XML.

    At the same time nobody is offering to change Java language in a way that java file would be written as an XML so we can convert it to anything using XSLT. In my opinion Ant gradually changing from being data centric to being execution centric and more and more looks like procedural language that is why I think it makes sense to use something more procedural then XML.

    I also would be curious to see practice example of XSLT usage with Ant script. I mean what kind of useful document we can get by transforming Ant script? I can see may be one one example when one can apply XSLT to Ant script to produce HTML documentation.

    Posted by: apolenur on June 16, 2003 at 04:14 PM

  • I thinks it's a great idea and a very reasonable consecuence.
    Really I can't understand why people can be against this..
    Even if you mantain ant as a pure specification. A language oriented to human beings is much more reasonable..
    There is not reason for something that can be clearly specified and that you use frecuently to be in XML.
    Except that you are too lazy to write a parser ...

    Posted by: emiliolg on June 17, 2003 at 11:28 AM

  • Have a look at Maven
    Maven may already have what you're looking for. htt://maven.apache.org . I'm currently senior developer for a group of analysts (not programmers) and programmers who haven't used any build tool before. I'm hoping maven will save them from learning the basics of ant. It uses jelly as a scripting language. (I've never touched it, but expect to next week.)

    Hope that saves you some work and helps cross-polinate apache better.

    Dave

    Posted by: dwalend on June 17, 2003 at 07:46 PM

  • choice
    I think the real cocnept here is adding more choices to how to use ant which can always be a good thing..especially considering that there is a large set of devlopers out there in the scripting world that have to touch java..

    This would make ant more accessible to tha tcore set of developers Sun is trying to get or obtain..


    Posted by: shareme on June 18, 2003 at 05:08 AM

  • Irony...
    So now we have a pure XML tool (Ant) that is problematic because it needs more scripting functionality, while at the same time JSF and JSTL are trying to banish scripting from JSPs.

    My biggest concern is with validation. Back in the horrible old days of generating HTML directly from Servlets, we were at least able to get compile time validation of our code. If Ant does adopt scripting (I like Python, by the way), we must also develop pervasive tools to validate the procedural code against the declarative portions.

    Posted by: johnreynolds on June 18, 2003 at 06:37 AM

  • More object-oriented
    I'm a great fan of Ant so I would like to see a radically improves my one big criticism: Ant is too procedural. For every project I do I end up rewriting my old Ant scripts and any improvements I make I can't rejoin to the old ones. Ofcourse I can link to a common ant script but that's very klunky and I end up doing all kinds of sophisticated stuff to define relevant things only in one place. That's fun ofcourse but I don't want to do this for every project before I can get going.
    I think that could be changed for the better by making Ant more OO. Ofcourse Maven does provide some solutions in this direction. For instance it's file that provides a project definition. That way you plug you project specific things just in. THinking along the lines of OO analysis I gues apart from 'project' one would expext 'library' and what not.
    Maven ofcourse provides a solution in this direction but the great part about Ant is that it has such a large following: most IDE's now know about Ant, most developers do, lots of software products provide Ant tasks. That's invaluable.
    So an upgrade of Ant would preferably provide some backwards compatibility.
    And Maven's repository is to heavy handed: it dictates a specific way to store my libraries/dependencies. I find it hard to install the version I found myself instead of Maven downloading all kinds of librariy versions that I know are not necessary.
    I'd think more along the lines of library definitions in jBuilder.

    Oh, and please don't use jython. I love python and jython but I shudder to think what people would do if it were a complete programming language.
    Let people just write their plugins and keep the 'makefile' as declarative as possible.

    greetings from the Netherlands,
    Josot

    Posted by: yoozd on June 18, 2003 at 11:27 AM

  • Maybe I'm missing something...?
    Could Mr. Davidson or someone else please elaborate on the deficencies of Ant? I've seen horrible Ant scripts, but I've also seen horrible C, C++, Java, etc. I've found Ant to be a wonderful tool for managing the building, packaging and deployment of small to medium-sized projects. The XML doesn't seem to be such an awful hindrance, so long as you write small, focused targets. If you're feeling the need for scripting constructs such as loops, I'd have to ask what it is that you're trying to do in your build process.

    Posted by: kurtc on June 19, 2003 at 11:15 PM

  • leave it alone!
    When I first read the Ant home page it was suggested that Ant is a better / simpler Make and I totally agree.

    However if you add scripting, things are just going to get a lot more complicated.

    I tend to agree with yoozd and have always felt some nice OO features of Ant (i.e. Task inheritance) might make things simpler. However with xml include and XSLT it is possible to create a base script and drive Ant through a simple .properties file now...

    Posted by: darrenr on June 20, 2003 at 04:07 AM

  • XML vs Python
    Using XML as the configuration format for Ant is great. You can generate configuration file by XSLT (ie translate a .NET project in an Ant project), validate etc. (NetBeans help a lot in writing XML file for Ant)
    Python and other scripting language are very useful if you already use them.
    I think that the standard format must remain the XML, and to support other scripting languages create tool to convert from the script language to XML and viceversa

    Posted by: teg on June 20, 2003 at 07:43 AM

  • Not yet convinced...
    Yours is the first story I've heard about XSLTing build.xml or web.xml scripts. I was reading this thread wondering if ant xml files really CAN make use of XML technology.

    I have no problems with Ant's xml format, and I agree with you that xml bashing is getting too commonplace. I still think xml is a great markup language for structured data.

    The problem is, as with Ant, its not data that is being structured with the use of xml. Ant is structured commands, primarily using tag attributes. Its not exactly how xml was intended to be used, and I wonder if maybe there isn't a better way to format an Ant build script.

    However I don't want to see a scripting language. I think many people use Ant because they don't want their build scripts to be another imperative program. I can't put my finger on why this might be so, but having a build script that acts more like a data file makes me more comfortable as a developer.

    Posted by: jkauzlar on June 23, 2003 at 11:21 AM

  • Why Jython
    I always wondered if there was any thought to making ant as a pure Java tool. Since all the tasks are java classes, and ant is primarily a java build envronment, why not make an option for bootstrapping java files. Along with build.xml there could be build.java as well as build.py. XML could still be the default script with ant -java and ant -python options.

    Posted by: dand on June 25, 2003 at 10:45 AM

  • Got a non-profit link that offers some Ant Scripts. The site itself has all sorts of articles and common configurations for building java applications in general.

    Ant Scripts

    Posted by: screenedtwenty on May 23, 2007 at 02:39 PM

  • 网络营销软件
    网络营销软件
    网络营销软件
    群发软件
    群发软件
    ---
    群发软件
    网络营销软件网络推广软件网站推广软件下载引擎登陆软件论坛群发软件下载免费版
    论坛群发软件,信息群发软件,群发软件,网络营销软件,网站推广软件引擎登陆软件下载
    网站排名软件网站推广软件信息群发软件博客群发软件论坛群发软件免费下载
    群发软件,信息群发软件,博客群发软件,论坛群发软件,免费下载:群发软件系统
    推广小助手破解版
    论坛群发软件
    网站排名软件
    群发软件
    推荐给你很好的群发软件和信息群发软件和供求群发软件
    推荐给你很好的群发软件和信息群发软件和供求群发软件博客群发软件网络营销软件网络营销软件
    网站排名软件网站排名软件网站优化软件信息群发软件信息群发软件信息群发软件论坛群发软件网站推广软件网站推广软件博客群发软件博客群发软件

    群发软件群发软件博客群发软件论坛群发软件网络营销软件论坛群发软件
    信息群发软件推广软件网站推广软件网络营销软件网站推广软件群发软件网站排名软件网站推广软件博客群发软件论坛群发软件群发软件网站排名软件网站推广软件博客群发软件论坛群发软件
    网站排名软件
    博客群发软件
    网站排名软件
    网站推广软件
    群发软件信息群发软件
    免费论坛群发软件
    论坛群发软件
    网站排名软件
    免费博客群发软件
    网站推广软件

    群发软件
    博客群发软件
    网站排名软件
    网站推广软件
    群发软件信息群发软件
    免费论坛群发软件
    论坛群发软件
    网站排名软件
    免费博客群发软件
    博客群发软件

    Posted by: 3ufblog9 on November 28, 2007 at 09:01 PM

  • wow power leveling
    wow powerleveling
    wow power leveling
    wow gold
    wow items
    feelingame.com
    wow tips
    Most Valuable WOW Power Leveling Service
    wow power leveling faq
    cheap wow power leveling
    wow power leveling
    wow powerleveling
    wow power lvl

    Posted by: wowpower on December 11, 2007 at 11:30 PM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds