The Xomega Project is based on the standard MSBuild architecture, which means that you can build the project using the MSBuild.exe and pass the model project file to it. This will run all the generators included in the build. If you're running it during a continuous integration build then you want to include only rerunable generators in the build.
To run all the generators included in build, you can use the following command line (note the \\ at the end):
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe MyProject.Model.xomproj "/p:DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\\" To run only a specific generator, you can use the following command line:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe MyProject.Model.xomproj
"/p:CurrentGenerator=Enumeration Constants" "/p:DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\\"
To run a generator against specific files only, you need to set the Selection property to a semicolon separated list of the paths to those files as follows:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe MyProject.Model.xomproj "/p:CurrentGenerator=WCF Service Contracts" "/p:DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\\"
"/p:Selection=C:\MyProject\MyProject.Model\myfile.xom"You can even pass the generator arguments through a command line as properties for the MSBuild if you specify those properties as values for the generator's parameters.
For example, if you set the following value in the model project file for the WPF search form generator
Code:
<ListRowObject-param>$(WPFSearchRowObject)</ListRowObject-param>
then you can use the following command line to pass in the value of the list row object parameter:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe MyProject.Model.xomproj "/p:CurrentGenerator=WPF Search Form"
"/p:WPFSearchRowObject=MyRowObject" "/p:DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\\"
There is one gotcha though. Currently in order for it to work, you need to copy the Xomega license file to the location returned by the
System.Windows.Forms.Application.CommonAppDataPath constant for the running process (MSBuild.exe), which is the following location on Win7 or Vista:
C:\ProgramData\Microsoft Corporation\Microsoft® .NET Framework\4.0.30319.1\Xomega3.licWe will look into supporting ability to provide the location of the license file through the command line.