|
Download [ Spiritbot] - Download.html
|
|
Spirit Code Generator
|
This application, similar to XDoclet,Eclipse, other CodeGenerators, takes a
template and based on configuration settings generates code and creates workspaces.
(disclaimer: dont expect the same level of quality or configuration as XDoclet)
This is one technology that should help out right away. Type the correct command,
and you have a ready to run application. It basically does your homework for you.
It writes the code, creates the directory structure, and deploys the code.
The code templates are simple but you save a lot of time from creating directory structures
and tedious default headers, etc.
Here are some template or workspace types :
- Session/Entity EJB workspaces
- JDBC workspaces
- Web page creation
- Simple classes and interfaces
And I recommend using XDoclet, XDoclet this is not.
And this will not replace 'learning java' but I think it may be useful if you want to
get started some example java projects with a 'single' command as opposed to do
100 google searches for code.
SourceForge Download
|
Walkthrough of example use on a Windows2000 system:
Note : This file contains a walkthrough of example operation for
SpiritCodeGen, typically download a java VM and just type 'runit',
I have included some walkthrough of DOS commands to show full
use of the system, don't get confused about what is a DOS command
and what is a SpiritCodeGen command, example 'dir'.
changes to runit.bat :
java -classpath "%LOCALCLASSPATH%" org.retro.gis.gen.CodeGen -help
* 1. View the usage and help output.
-->Spirit-Code-Gen..... [ RUNNING ]
..... INFO - Configfile exists ... [ OK ]
..... INFO - WorkSet-Dir exists ... [ OK ]
usage: java org.retro.gis.gen.CodeGen <-h/-help>
..... <-listbuffers-xml>
..... [ List current code generation buffers in the config file ]
..... <-listbuffers-file>
..... [ List current code *.java buffer-files in 'output' dir ]
..... <-coderead>
..... [ Used for recompling complete system(see 'help') ]
..... <-newproject [type] [new-name]>
..... [ Create one of a number of workspaces ]
type : none ; entity-ejb ; session-ejb ; servlet ; jdbc
..... <-writebuffer [buffer-name] [new-name.extension] {-force}>
..... [ Write a buffer to file and replace tags from config file ]
example-buffers : ZMakefileGen ; ZSimpleMainGen
..... <-writejava [buffer-name] [class/interface] [new-name.extension] {-force}>
..... [ Write a buffer to file and replace tags from config file ]
example-buffers : YSimpleMainGen
ex : org.retro.gis.gen.CodeGen -writejava class YSimpleMainGen ABC.java -force
* 2. Check what buffers the user can write to file, only use buffers starting
with Z or Y.
java -classpath "%LOCALCLASSPATH%" org.retro.gis.gen.CodeGen -listbuffers-xml
-->Spirit-Code-Gen..... [ RUNNING ]
..... INFO - Configfile exists ... [ OK ]
..... INFO - WorkSet-Dir exists ... [ OK ]
------------------------------------------
Buffer-List
--> BufRetroBankHomeGen
--> BufjbossXMLGen
--> BufBuildXMLGen
--> BufRetroBankLocalHomeGen
--> BufRunWindowsGen
--> BufServletwebXMLGen
--> ZWebPageGen
--> BufRetroBankGen
--> BufejbjarXMLGen
--> BufRetroBankHelperGen
--> BufRetroBankHelperBeanGen
--> BufRetroBankBeanGen
--> BufRetroBankHelperHomeGen
--> BufRetroBankPKGen
--> BufSessionLocalHomeGen
--> BufSessionGen
--> BufRunLinuxGen
--> BufServletBuildGen
--> ZSimpleMainGen
--> BufDefaultWebGen
--> BufjbosswebXMLGen
--> BufSessionHomeGen
--> BufRetroBankClientGen
--> BufSessionLocalGen
--> BufwebXMLGen
--> ZMakefileGen
--> BufSessionClientGen
--> BufSessionBeanGen
--> BufServletSimpleGen
--> BufSessionjbossXMLGen
--> YSimpleMainGen
--> BufRetroBankExceptionGen
--> BufJDBCSimpleGen
--> BufRetroBankLocalGen
--> BufJBOSSBuildGen
--> BufMakefileGen
--> BufSessionejbjarXMLGen
------------------------------------------
* 3. This command writes a simple buffer to the 'code' directory
java -classpath "%LOCALCLASSPATH%" org.retro.gis.gen.CodeGen
-writejava class YSimpleMainGen ABC.java -force
-->Spirit-Code-Gen..... [ RUNNING ]
..... INFO - Configfile exists ... [ OK ]
..... INFO - WorkSet-Dir exists ... [ OK ]
..... INFO - Output-Code-Dir exists ... [ OK ]
---+ File : ABC.java created... see the 'code' directory.
C:\berlin11\ecl\eclipse\workspace\SpiritCodeGenSrc\SpiritCodeGen>dir
07/02/2004 09:20p DIR build
07/01/2004 08:02p 2,482 build.x
07/03/2004 12:23p DIR code
07/02/2004 08:00p DIR config
07/01/2004 08:13p DIR CVS
07/01/2004 08:13p DIR docs
07/03/2004 12:15p DIR gen
GenSrc\SpiritCodeGen>cd code
07/03/2004 12:23p DIR .
07/03/2004 12:23p DIR ..
07/03/2004 12:46p 278 ABC.java +----- New-File Here
07/01/2004 08:13p DIR CVS
07/03/2004 12:30p 428 NOTSET.java
07/01/2004 08:02p 0 README.txt
* 4. Create a workspace for a entity bean JBOSS project
-->Spirit-Code-Gen..... [ RUNNING ]
..... INFO - Configfile exists ... [ O
..... INFO - WorkSet-Dir exists ... [
..... INFO - Creating a new workspace
..... TYPE - entity-ejb
Package-Name : org.retro.gis.system
-+ Building... : 4
+ org
---+ retro
------+ gis
---------+ system
user: Berlin Brown
name: http://www.retroevolution.com
\SpiritCodeGenSrc\SpiritCodeGen>cd workset
SpiritCodeGen\workset>dir
07/01/2004 08:13p DIR CVS
07/03/2004 12:50p DIR NewEntity
* Note : before this directory was empty, we created a directory 'NewEntity'
07/03/2004 12:50p DIR ..
07/03/2004 12:50p 4,012 build.xml
07/03/2004 12:50p DIR docs
07/03/2004 12:50p DIR lib
07/03/2004 12:50p 673 Makefile
07/03/2004 12:50p DIR output
07/03/2004 12:50p 40 README.tx
07/03/2004 12:50p DIR resources
07/03/2004 12:50p 1,428 runit.bat
07/03/2004 12:50p 833 runit.sh
07/03/2004 12:50p DIR scripts
07/03/2004 12:50p DIR src
* Wow, all these files get created, of course you need 'ANT to build the project *
... see build.xml to get an idea of the ANT tasks available.
|
*Bugs*
Using the option '-newproject session.ejb', in the ejb-jar.xml file,
change the SomeProjectName.SomeProjectName to the package name used, for example
'org.retro.gis.system.SomeProjectName.
The linux scripts will not work very well because they were created in windows, to convert
the script:
tr -d '(slash)015' < runit.sh > A
mv A runit.sh
chmod 755 runit.sh
|
|
|