Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Specifying file creation paths
 

Specifying file creation paths

Hi,

I have a receipe that generates an entity class based on the schema information of a database table. Besides, the entity class I need to generate also Identity classes following the patterns used by some Software Factories defined by P&P. For instance, I need to create the Order entity class and the GetOrderById and GetAllOrders identity classes. These 3 files go into different folders.

Is there a way to specify the path where these files will be created? Because the files are created in the Target Folder of the recipe but I need some other files created in other folders.

Thanks

Jorge Flores  Tuesday, February 20, 2007 7:51 PM
Can you give some more detail on what specific built-in actions/etc you're using for this?
vga  Thursday, February 22, 2007 1:32 PM

You need to change the following argument on your actions:

<Input Name="Project" RecipeArgument="CurrentProject" />

With this argument you especify where to add the item.

Pablo

Pablo Galiano  Thursday, March 01, 2007 8:01 PM
Can you give some more detail on what specific built-in actions/etc you're using for this?
vga  Thursday, February 22, 2007 1:32 PM
I´m using almost the same format for the files I generate, for example:

** To generate a simple Entity class **

<!-- Generates code by rendering the T4 template using the received arguments -->
<Action Name="GenerateDAC"
Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
Template="Text\Entity.cs.t4">
<Input Name="Table" ActionOutput="GetTableSchema.TableSchema" />
<Input Name="Indexes" ActionOutput="GetTableSchema.Indexes" />
<Input Name="ListName" ActionOutput="GetTableSchema.ListName"/>
<Input Name="ClassName" RecipeArgument="ClassName" />
<Input Name="TargetNamespace" RecipeArgument="TargetNamespace" />
<Input Name="EntityClassName" RecipeArgument="EntityFullName" />
<Input Name="ConnectionName" RecipeArgument="ConnectionName" />
<Output Name="Content" />
</Action>
<!-- Adds the generated output from the T4 template to the project as an item -->
<Action Name="AddClass"
Type="Microsoft.Practices.RecipeFramework.Library.Actions.AddItemFromStringAction, Microsoft.Practices.RecipeFramework.Library"
Open="true">
<Input Name="Content" ActionOutput="GenerateDAC.Content" />
<Input Name="TargetFileName" RecipeArgument="TargetFile" />
<Input Name="Project" RecipeArgument="CurrentProject" />
</Action>


** To generate an XML ****

Action Name="GenerateDAC"
Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
Template="Text\Entity.cs.t4">
<Input Name="Table" ActionOutput="GetTableSchema.TableSchema" />
<Input Name="Indexes" ActionOutput="GetTableSchema.Indexes" />
<Input Name="ListName" ActionOutput="GetTableSchema.ListName"/>
<Input Name="ClassName" RecipeArgument="ClassName" />
<Input Name="TargetNamespace" RecipeArgument="TargetNamespace" />
<Input Name="EntityClassName" RecipeArgument="EntityFullName" />
<Input Name="ConnectionName" RecipeArgument="ConnectionName" />
<Output Name="Content" />
</Action>
<!-- Adds the generated output from the T4 template to the project as an item -->
<Action Name="AddClass"
Type="Microsoft.Practices.RecipeFramework.Library.Actions.AddItemFromStringAction, Microsoft.Practices.RecipeFramework.Library"
Open="true">
<Input Name="Content" ActionOutput="GenerateDAC.Content" />
<Input Name="TargetFileName" RecipeArgument="TargetFile" />
<Input Name="Project" RecipeArgument="CurrentProject" />
</Action>

I am able to generate all the files needed. In the end, I generate 8 different files but they are all created in the same root/directory. I´m aiming on finding a way to create them in different folders. For example, the Entities in the Entities folder (which is already created on the creation of the project) The XML in the XML folder, and so on.
Jorge Flores  Thursday, March 01, 2007 5:15 PM

You need to change the following argument on your actions:

<Input Name="Project" RecipeArgument="CurrentProject" />

With this argument you especify where to add the item.

Pablo

Pablo Galiano  Thursday, March 01, 2007 8:01 PM

You can use google to search for other answers

Custom Search

More Threads

• Project reference
• Creating a Project with a Static Project Folder Name.
• Update project references accross solution.
• Wizard data not replacing arguments correctly?
• Dec '06 WSSF fails to install after installing Feb 07 GAX and GAT
• Cannot bind recipe to customized project type in solution folder.
• Can't repair/uninstall GAT or GAX
• GAX VS 2005 - "Cannot find registration information for template "...". Package templates may not be properly registered. Run package installation again and verify template name and location.
• Set version for Guidance Package
• Copy WSSF and use as base for new GA package (formerly Where are the configuration files located?)