Generation based on a perform rule not working for me

Posts   
 
    
zulu
User
Posts: 50
Joined: 25-Aug-2008
# Posted on: 13-Feb-2017 20:03:03   

Hello, I have some custom templates that I want to run during generation but I want to control this using 'perform rule'.

I've created a frameworksettings file and my settings correctly get displayed in the designer and saved with the project.

Now, in the 'advanced' code generation screen I enabled the perform rule for some of my templates and indicated when they should be generated according to the setting value.

Eg. I have a bool setting called UseRepositories and I have a Task performer that generates repositories for me. I only want it to be executed if UseRepositories is true and so enabled the perform rule for the task performer, selected Project as scope, selected UseRepositories as the setting, Equal as the operator, and entered true as the value, no quotes or anything.

All seems ok, but the task performer is run even if UseRepositories is False.

LLBLGen v4.2 August 2nd, 2015

zulu
User
Posts: 50
Joined: 25-Aug-2008
# Posted on: 13-Feb-2017 20:08:03   

Update.... it now works.

However I had to manually change the settings for the project and save before it worked.

The settings have default values in the frameworksettings file and apparently if you don't change them the perform rule fails somehow. Maybe the default values don't get saved with the project?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 14-Feb-2017 15:12:44   

If a setting isn't there, the default value for the type is returned, so for bool that is 'false'. If you define a settings file, you have to restart the designer to load it again if it's changed. perhaps that was the issue?

Frans Bouma | Lead developer LLBLGen Pro