Create Properties folder task automatically

Posts   
 
    
webbsk
User
Posts: 17
Joined: 24-Sep-2009
# Posted on: 27-Feb-2011 19:00:17   

Hi,

I've been trying to bring our LLBLGen generated code in line with the rest of our architecture. One of those things is to add a Properties directory underneath both the DatabaseGeneric and DatabaseSpecific folders and output their respective AssemblyInfo.cs files into those directories. We are using v2.6 still.

I've looked at the SD.PresetsAdapter.General2008.preset file and made a change to add the extra folders to the list. I also changed the SD.Tasks.Generic.tasks file to create my extra task preset.

Although I know that we probably shouldn't be modifying the base task lists like this, I don't see another clear choice. I don't want to be adding a task when it's the original tasks that I want to change. Am I going about this all wrong? Why was it originally designed so that there wouldn't be a Properties directory created with the AssemblyInfo underneath?

Thanks, Sam.

Attachments
Filename File size Added on Approval
SD.Presets.Adapter.General2008.preset 11,622 27-Feb-2011 19:12.48 Approved
webbsk
User
Posts: 17
Joined: 24-Sep-2009
# Posted on: 27-Feb-2011 19:02:33   

This message is just a placeholder. I'm attaching my modified SD.Tasks.Generic.tasks file attachment to this message since there is a limit of one file per post.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 27-Feb-2011 23:24:49   

webbsk wrote:

I've been trying to bring our LLBLGen generated code in line with the rest of our architecture. One of those things is to add a Properties directory underneath both the DatabaseGeneric and DatabaseSpecific folders and output their respective AssemblyInfo.cs files into those directories. We are using v2.6 still.

I've looked at the SD.PresetsAdapter.General2008.preset file and made a change to add the extra folders to the list. I also changed the SD.Tasks.Generic.tasks file to create my extra task preset.

Although I know that we probably shouldn't be modifying the base task lists like this, I don't see another clear choice. I don't want to be adding a task when it's the original tasks that I want to change. Am I going about this all wrong?

If you want to add additional files to the generation process, I recommend:

  1. Create separate templates, templatebinddings and tasks files for your templates. You can place them into an AdditionalTemplates/AdditionalTasks folders.

  2. Create a new preset based on the original one. For instance you can create SD.Presets.Adapter.General2008.WithCustomAssemblyInfo.preset.

  3. You can modify that template to include your custom tasks. You have to include the tasks in the correct root (DBGeneric or DBSpecific) so that files would be included in the correct VSNet project.

webbsk wrote:

Why was it originally designed so that there wouldn't be a Properties directory created with the AssemblyInfo underneath?.

There is a task for AssemblyInfo. The template is in Templates\SharedTemplates\Net2.x\C# folder. So in my opinion you could create your own AssemblyInfo template (with same templateID) and put it into high priority level at Template Bindings.

David Elizondo | LLBLGen Support Team