I know web pages should be past this, but this site doesn't look right on IE.
I will fix it some day ( not for IE 6 though) but for now this is easier and a lot more fun.

Download firefox or chrome or hide this message forever...
<< Back to blog main

MyGeneration is an open source code generation tool. I love using it but I felt that opening up MyGeneration every time I needed to update or create a generated file was too time consuming. Yes I am that lazy. There is a command line tool that comes with MyGeneration called zeuscmd.exe. Documentaion on zuescmd is sparse. zeuscmd has four switches that I care about

Switch      Effect
-t the path to the template that zeuscmd is going to use
-o the path where the output from the template will be saved
-i the path for the xml based input
-c the path where the input params are saved

The -i switch is the one I am the most in; however, I couldn't find any documentation on the format of the xml input. After a little playing around with "MyGeneration":http://mygeneration.sourceforge.net/ I was able to figure it out and I figured I would put it on the web. < ?xml version="1.0" encoding="utf-8"?> < obj name="" uid=" the guid of the template " path=" the full path to the template "> < items> < item name="parameter name no spaces" type="System.String|System.Boolean|etc" val="the value of the input item" /> < item name="dbname" type="System.String" val="database_of_awesomeness" /> < item name="your_own_param" type="System.String" val="value_in_the_template" /> < /items> < /obj>

Note: the extra spaces in the tags are there so they will render on this website

Now there a few input values that MyGeneration uses and you probably have to pass them in order for the template to generate. These are the MyGeneration values for the template I am running on my computer. I am using sqlexpress as the db and vb as the template language.

Key Value
__dbConnectionString Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=myuser;Initial Catalog=mydatabase;Data Source=myserver
__dbDriver SQL
__dbLanguageMappingFileName C:\Program Files\MyGeneration13\Settings\Languages.xml
__dbTarget SqlClient
__dbTargetMappingFileName C:\Program Files\MyGeneration13\Settings\DbTargets.xml
__defaultOutputPath C:\Program Files\MyGeneration13\GeneratedCode\
__defaultTemplatePath C:\Program Files\MyGeneration13\Templates\
__domainOverride True
__language C#
__userMetaDataFileName C:\Program Files\MyGeneration13\Settings\UserMetaData.xml
__version 1.3.0.0