srizzo / code2code
- Source
- Commits
- Network (1)
- Issues (0)
- Wiki (8)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Thu May 28 19:38:30 -0700 2009 | |
| |
CHANGES | Wed Jun 17 08:21:04 -0700 2009 | |
| |
README.markdown | Thu Jun 18 12:58:04 -0700 2009 | |
| |
code2code.feature/ | Wed Jun 17 08:21:04 -0700 2009 | |
| |
code2code.tests/ | Wed Jun 17 08:21:04 -0700 2009 | |
| |
code2code/ | Wed Jun 17 08:21:04 -0700 2009 |
What it is
code2code is an eclipse plugin to generate source code from templates.
You can easily create your custom generators using known template engines: Groovy (JSP like), Freemarker or Velocity.
See it in action here.
Creating a Generator
The files:
HelloWorld.generator
|-- templates
|-- HelloWorldTemplate.txt.ftl
|-- templates.ftl
|-- params.ftl
Contents of HelloWorldTemplate.txt.ftl:
Hello ${name}!!!
Contents of params.ftl:
name=World
Contents of templates.ftl:
templates/HelloWorldTemplate.txt.ftl=src/destinationPath/HelloWorld.txt
Usage
Installing generators: just create a folder named "generators" at the root of your project, and place your generators there.
Running generators: The plugin adds a “Generate…” option to your project context menu (right-click menu). Run it, choose one of your installed generators, set its parameters, and the plugin will generate the files to the right place.
See it in action here: Quickly cruding with code2code plugin and VRaptor2.
Installation
Current version is 0.9.2 beta, tested against Eclipse Ganymede 3.4.2.
You can install it from the Update Site
Documentation
http://wiki.github.com/srizzo/code2code
Issues/Features
http://github.com/srizzo/code2code/issues
Generator Examples
http://github.com/srizzo/code2code-example-generators/downloads
