Using CodeSmith Generator Projects covers the following sections:
- Using a CodeSmith Generator Project to Generate Anywhere
- Using a CodeSmith Generator Project inside Visual Studio
- Using CodeSmith Generator Project from Windows Explorer
- Using a CodeSmith Generator Project from MSBuild
- Anatomy of a CodeSmith Generator Project File
- CodeSmith Generator Project Manage Outputs
- CodeSmith Generator Project Generate Outputs
- CodeSmith Generator Project Options
You can also check out this video tutorial on this subject:
...
CodeSmith Generator Projects manage groups of CodeSmith Generator templates and their outputs all in a single CodeSmith Generator Project file (.csp). CodeSmith Generator Projects are files that enable you to run an entire generation process at anytime in a simplistic manner from many different environments.
Widget Connector | ||||||
---|---|---|---|---|---|---|
|
About
A CodeSmith Generator Project file uses a .csp file windows extension, and stores XML metadata about your CodeSmith Generator Project.
Info |
---|
Learn more by reading Anatomy of a CodeSmith Generator Project File. |
CodeSmith Generator Project file can be generated or configured by right clicking on on a CodeSmith Generator Project File (.csp).
Generation Capabilities
CodeSmith Generator Project files enable the management and execution of a generation process in many environments.
Windows Explorer
Managing a CodeSmith Generator Project right from Windows Explorer is simple and doesn't require you to use CodeSmith Generator to manage a project. Options are available through the right-click context menu your CodeSmith Generator Project file (.csp).
The menu options include:
Info |
---|
Learn more by reading Using CodeSmith Generator Project from Windows Explorer. |
You can Generate Outputs of a CodeSmith Generator Project in the command line by using the CodeSmith Generator Console application. You would simply call:
Code Block |
---|
cs MyCodeSmithProject.csp |
Visual Studio
The tight integration with Visual Studio allows you to fully manage any CodeSmith Generator Project right from Visual Studio. To manage a CodeSmith Generator Project, you can use the Right-Click context menu of a CodeSmith Generator Project file from the Solution Explorer window.
The menu options include:
- Generate Outputs
- Manage Outputs
- Add Outputs
- Output OptionsYou can use ActiveGeneration quite easily in your Visual Studio projects now, simply by specifying the BuildAction of your CodeSmith Generator Project. Setting the BuildAction = "Generate" in the properties of you CodeSmith Generator Project file in the Solution Explorer will cause your entire build process to occur prior to your project building.
Info |
---|
Learn more by reading Using a CodeSmith Generator Project inside Visual Studio. |
MSBuild
CodeSmith Generator projects can be manually expected from your MSBuild project file by executing:
Code Block | ||
---|---|---|
| ||
<CodeSmith ProjectFile="MyProject.csp" /> |
When you set the BuildAction to Generate in Visual Studio, you're actually using the CodeSmith Generate Target, located in: C:\Program Files\MSBuild\CodeSmith\CodeSmith.targets or C:\Program Files (x86)\MSBuild\CodeSmith\CodeSmith.targets You can import this target in your Visual Studio Projects by using the Import tag.
Code Block | ||
---|---|---|
| ||
<Import Project="$(MSBuildExtensionsPath)\CodeSmith\CodeSmith.targets" /> |
Info |
---|
Learn more by reading Using a CodeSmith Generator Project from MSBuild. |