Perform one than one Code Generation Tasks at once

Posts   
 
    
sapul
User
Posts: 49
Joined: 11-Jan-2019
# Posted on: 03-May-2019 10:48:36   

Hello.

I want to list multiple tasks within the "Code Creation (F7)" window and click the "perform task" button once without editing task. I'm currently running a single task by editing 2 times. I couldn't figure put how to do it by myself. I've uploaded 2 image files to show how I'm currently working and what I actually want. I will be grateful if you could help me.

Regards, Serkan

Attachments
Filename File size Added on Approval
code_generation_tasks_now.PNG 89,648 03-May-2019 10:48.45 Approved
code_generation_tasks_should.PNG 39,833 03-May-2019 10:48.57 Approved
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 04-May-2019 08:16:47   

Interesting request. But before going into that, one question: Are you generating your own DTOs? I assume that is your other custom task with custom templates and preset. If that is true, Why not use Derived Models?

David Elizondo | LLBLGen Support Team
sapul
User
Posts: 49
Joined: 11-Jan-2019
# Posted on: 05-May-2019 15:23:22   

Are you generating your own DTOs

well,yes. I guess. I generate the Entities by using "YnaEntity" preset and I generate the transfer objects by using "YNADto" preset.

Why not use Derived Models?

Accually i do not know. The current llblgen project was present when i started to work in this duty. Even if we understand the concept and want to implement it, it may require a huge refactor. Because the project that we're talking about is pretty big.

By the way, i thought that this multiple task option were present and i could not figure out. Because there are some llblgen help documantation pages that shows that the code generation window has multiple tasks. ( thats why there is and GRID Companent theresimple_smile

I simply ask for a workaround for the sake of productivity.

if I need to express my request as the content of the LGP file;

<CodeGenerationCyclePreferences> <OutputType Value="3"> <LastUsedPreferences> <DestinationRootFolder Value="C:\Projects__YNADATAGenerateV5\Rota.DataTransfer" /> <FrameworkName Value="LLBLGen Pro Runtime Framework" /> <LanguageName Value="C#" /> <PlatformName Value=".NET 4.6" /> <PresetName Value="YNADto" /> <RootNamespace Value="Rota.DataTransfer" /> <TemplateGroup Value="SelfServicing" /> <TemplateBindings> <Binding Name="YNA" /> <Binding Name="SD.TemplateBindings.General" /> </TemplateBindings> </LastUsedPreferences> <LastUsedPreferences> <DestinationRootFolder Value="C:\Projects__YNADATAGenerateV5\Rota.DataAccess" /> <FrameworkName Value="LLBLGen Pro Runtime Framework" /> <LanguageName Value="C#" /> <PlatformName Value=".NET 4.6" /> <PresetName Value="YNAEntity" /> <RootNamespace Value="Rota.DataAccess" /> <TemplateGroup Value="SelfServicing" /> <TemplateBindings> <Binding Name="YNA" /> <Binding Name="SD.TemplateBindings.General" /> </TemplateBindings> </LastUsedPreferences> </OutputType> </CodeGenerationCyclePreferences>

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39747
Joined: 17-Aug-2003
# Posted on: 06-May-2019 09:55:32   

I think what you want isn't supported today in the designer itself, but you can achieve it with a simple .cmd file on the command line and use the cligenerator. The cligenerator is the commandline code generator we have and you can generate 1 project + preset at a time, but you can configure everything on the commandline, so you can create a .cmd file which calls the cligenerator twice: once for the first preset and once for the second preset. See: https://www.llblgen.com/Documentation/5.5/Designer/Functionality%20Reference/CliGenerator.htm for details about its usage.

We use the cligenerator ourselves to generate the code for our unit tests for instance using various cmd files. This is the main .cmd file we use:


@Echo off

set designerBin="\Myprojects\VS.NET Projects\LLBLGen Pro v5.5\Designer\Gui\bin\Debug"
set destinationRoot="\Myprojects\VS.NET Projects\LLBLGen Pro v5.5\UnitTests\LLBLGen Pro\LowLevelAPI"
set destinationAdvancedRoot="\Myprojects\VS.NET Projects\LLBLGen Pro v5.5\UnitTests\LLBLGen Pro\AdvancedQueryAPIs"

pushd.
Call "AdvancedQueryApis\LLBLGenPro Projects\GenerateCS.cmd" %designerBin% %destinationAdvancedRoot%
popd

....

Then, the GenerateCS.cmd file looks like:


@Echo off
cd %1

Echo ================================================================
Echo Generating code: Adapter, C#, Regular models.
Echo ================================================================
cligenerator "%~2\LLBLGenPro Projects\Northwind26.llblgenproj" "NW26.Adapter" "C#" ".NET Standard 2.0" "Adapter" "SD.Presets.Adapter.General.Netstandard" "%~2\AdapterDAL" 0 "%~2\LLBLGenPro Projects\log_NW26_Adapter.txt"
Echo ================================================================
cligenerator "%~2\LLBLGenPro Projects\Northwind26.llblgenproj" "NW26Async.Adapter" "C#" ".NET Standard 2.0" "Adapter" "SD.Presets.Adapter.General.Netstandard" "%~2\AdapterDALAsync" 0 "%~2\LLBLGenPro Projects\log_NW26_Adapter_Async.txt"
Echo ================================================================
cligenerator "%~2\LLBLGenPro Projects\InheritanceTwo.llblgenproj" "InheritanceTwo.Adapter" "C#" ".NET Standard 2.0" "Adapter" "SD.Presets.Adapter.General.Netstandard" "%~2\AdapterIH2DAL" 0 "%~2\LLBLGenPro Projects\log_InheritanceTwo_Adapter.txt"
Echo ================================================================
cligenerator "%~2\LLBLGenPro Projects\Sql2016TemporalTableTest.llblgenproj" "Sql2016TemporalTableTest.Adapter" "C#" ".NET Standard 2.0" "Adapter" "SD.Presets.Adapter.General.Netstandard" "%~2\AdapterTemporalTableDAL" 0 "%~2\LLBLGenPro Projects\log_Sql2016TemporalTableTest_Adapter.txt"

...

This is just an example, but I'm sure you can get it working with just 2 cligenerator calls. The cligenerator is installed with the designer in the designer folder and requires a license, so make your .cmd file call the cligenerator inside the designer folder and it should be OK.

Hope this helps making things easier simple_smile

btw, you don't have to close the designer to run the cligenerator. It loads the file from disk and can work with it even if the designer has the project open too.

The sourcecode of the cligenerator is in the source archive in the 'Extras' section under 'My Account' on the website, if you want to adjust it.

Frans Bouma | Lead developer LLBLGen Pro
sapul
User
Posts: 49
Joined: 11-Jan-2019
# Posted on: 06-May-2019 10:02:58   

I've got the point. ✔ Thanks Fellas