Marcus wrote:
Frans,
I'm currently migrating my templates from V1 to V2 and am a little lost regarding how to "add tasks" via the designer.
1) I have copied all my .lpt files to the "C:\Program Files\Solutions Design\LLBLGen Pro v2.0\AdditionalTemplates" folder
2) I have created a new "templatebindings" as follows:
<?xml version="1.0"?>
<templateBindings xmlns="http://sd/llblgen/pro/templateBindingsDefinition.xsd" name="SDS.TemplateBindings.Adapter.NET20"
description ="Template bindings for SDS Custom templates" precedenceLevel="10">
<supportedPlatforms>
<platform name=".NET 2.0"/>
</supportedPlatforms>
<language name="C#">
<templateBinding templateID="SDS_EntityConcurrencyPredicateFactoryTemplate" filename="sds_EntityConcurrencyPredicateFactoryTemplate.lpt" />
<templateBinding templateID="SDS_EntityReaderBaseTemplate" filename="sds_EntityReaderBaseTemplate.lpt" />
<templateBinding templateID="SDS_EntityWriterBaseTemplate" filename="sds_EntityWriterBaseTemplate.lpt" />
<templateBinding templateID="SDS_EntityPrimaryKeyTemplate" filename="sds_EntityPrimaryKeyTemplate.lpt" />
<templateBinding templateID="SDS_EntityHelperBaseTemplate" filename="sds_EntityHelperBaseTemplate.lpt" />
</language>
</templateBindings>
Now Im not sure where the equivelant of the old TaskPerforms .config file goes... or is that something that can be added via the Designer?
In v1 you had 1 file: the generator config file. In there you defined the tasks to execute and in which order.
In v2 this is split up: you have .tasks files, which define the tasks you previously defined in the generator config file, and you have .preset files which define WHICH tasks to run, with WHICH parameter values and in WHICH order.
the .tasks files you create in an xml editor, if you need to. You don't have to do this, as you can also use the base tasks shipped with LLBLGen Pro and alter the parameter values in the preset.
The preset files you create in the generator configuration dialog, at tab 3: you add / remove tasks in the run queue which you can save as a preset for re-use later on.
So, say you had a .lpt template using task in your generator config file for v1. In v2, you simply add the LPT consuming base task to your project somewhere after the tasks which create the folder where the output has to be placed, and you select the task in the run queue after you've added it. Then you can alter the parameters at the bottom in the grid, like which templateid to use, etc.
IF you want to have pre-fab tasks, so you don't have to alter the parameter values, you can create .tasks files and you can place them either in the Tasks folder or in the AdditionalTasks folder specified in the project properties. These pre-fab tasks then show up in the dialog which is popped up when Add Task is clicked at tab 3 in generator configuration dialog and you can then add the task to the run queue. Because all parameters are already pre-set to the right values, you don't have to alter the parameter values.
After you've setup the runqueue with the right tasks, the right parameter values and the tasks in the right order, you can SAVE the preset under a different name, in the Tasks folder or in the folder specified under AdditionalTasks in the project properties so it will show up next time you generate code.
You can also create the presets in an xml editor of course. Use the .xsd files in the XSDs folder in the Tasks folder for intellisense
Template Bindings are showing up OKAY in the Designer but Add Tasks in the Task Queue only shows existing Tasks... and doesn't let me create new ones...
Do I need to add an additional TaskPerformer file to the AdditionalTemplates folder?
Marcus
In the list of tasks to pick from Add task, you'll find a task (at the top almost) which consumes an lpt template. That's the task you have to add when you want to run an lpt template in your run queue. You then alter the parameters you need to alter, which are the parameters of that task at that spot. So if you add that task again to the runqueue, THAT instance has again the default values.
So the tasks you can add are class definitions and the tasks you see in the run queue are instances