Jeremy Rayner on java and other stuff.

All | AudioDrama | Chatter | Fun | Groovy | Java | Life

megg: user defined project templates
Posted on 26 Mar 2004
Just added a new megg release that provides the ability to use your own project templates, this has been requested by a number of people, and hopefully is the hook that might get you using megg :-)

Rough guide to template writing

A project template is literally any directory that contains files you need for next project. The special bit comes when you go into one of your files and place the special parameters (velocity style) inside the source files and a controlling megg.xml in the root of the directory.

for example: put the text ${megg.foobar} in your source file, and add <arg name="foobar"/> to megg.xml in the root of the directory. megg will prompt user for this arg, then generate the project on this basis.

Just unpack megg.jar to look at the other templates for ideas...

The search strategy for templates is currently:

  • if you typed java -jar megg.jar foobar
  • megg will look in './foobar'
  • ...then '$MEGG_HOME/.megg/templates/java'
  • ...then '$user.home/.megg/templates/java'
  • ...then in the megg.jar file itself

Give megg a whirl today, and let me know your thoughts...

26 Mar 2004 |

megg: automatic downloading and unpacking
Posted on 26 Mar 2004
One issue when starting a new project, is getting hold of those pesky dependancies (jars/tld etc). I've updated megg to automatically grab them for you. megg will now take care of downloading a released file at any url, and unzipping or untaring the archive, and then copy the necessary into the right place for your project.

The best explanation is through an example.


java -jar megg-0.1.0.jar groovy

will create all necessary files for minimal groovy project and then unpack the three essential jar files needed in the lib dir from the auto downloaded groovy-1.0-beta-4.tar.gz


This is how this is declared, note use of ! to delimit url ! packedFile ! packedFile...
The dependancy declaration inside inherit the outer dependancy declarations
<dependancy from="http://dist.codehaus.org/groovy/distributions/groovy-1.0-beta-4.tar.gz!/groovy-1.0-beta-4/lib/"
  to="/lib/">
    <dependancy from="groovy-1.0-beta-4.jar"/>
    <dependancy from="asm-1.4.1.jar"/>
    <dependancy from="asm-util-1.4.1.jar"/>
</dependancy>

26 Mar 2004 |

 

 
March 2004
SunMonTueWedThuFriSat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Prev | Today | Next

rss:subscribe (All)



What I'm reading
my feed aggregator ->box

My websites
London Java Meetups
Programming Projects
Elite in Java
megg
Blogmento
Jez's Photos
Fantasy Stock Market
Cool Saxophonist
Doctor Who Audios
Pisces Audios

Other Blogs
Mike Cannon-Brookes
James Strachan
Joe Walnes
Sam Dalton
Simon Brown
Cameron Purdy
Mike Roberts
Erik C. Thauvin
John Martin
Manfred Riem

B5 d++ t++ k s+ u- f
i+ o+ x-- e+ l- c--

powered by blogmento