Call Plug in from Command Line

Posts   
 
    
jvidal
User
Posts: 37
Joined: 17-Sep-2007
# Posted on: 15-Oct-2007 17:26:13   

Hi

I'm trying to automatize the build process using the command line tool, so far I'm only running the project. I've seen that is possible to refresh it as well...

Is it possible to run plug-in(s) after refreshing the project from the command line? If so could you please give me some orientation on how?

Many Thanks! Jaume

goose avatar
goose
User
Posts: 392
Joined: 06-Aug-2007
# Posted on: 15-Oct-2007 17:43:27   

Hi, download the SDK from the customer area. The sdk contains two additional tool that may help you, The CliRefresher and the CommandLineGenereator.

jvidal
User
Posts: 37
Joined: 17-Sep-2007
# Posted on: 15-Oct-2007 17:48:16   

Thanks for the hint... actually I've downloaded the SDK few weeks ago and I'm currently using the CliGenerator command line utility and is working fine.

What I'm asking in my post is if it's possible to run Plug ins from the command line too.

Thanks Jaume

goose avatar
goose
User
Posts: 392
Joined: 06-Aug-2007
# Posted on: 15-Oct-2007 18:24:43   

Hello jvidal I'm sorry I miss your point before. I believe that for the moment running a plug in outside the designer is not possible, at list there is not easy way (http://llblgen.com/TinyForum/Messages.aspx?ThreadID=6838)

jvidal
User
Posts: 37
Joined: 17-Sep-2007
# Posted on: 15-Oct-2007 18:46:27   

Hi Goose

Thanks again for your message, I see in the thread that these problem is been around for more than a year then... bad news because it is a stopper for the 100% automation that I wanted to achieve using LLBL...

It's there any way around these, even if it ads complexity to it.. could you point me at hte right classes/namespaces to use if this is possible.

Many thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 16-Oct-2007 11:28:33   

There's no use for running plugins from the command line, as you can access the complete object graph already simple_smile . In the designer, you need a place to put your code, and that's the plugin. In the CLI refresher, you already have the object graph available to you, so the code you would otherwise put in the plugin is simply placed in the CLI refresher's sourcecode after the refresh took place.

Plugins simply manipulate the object graph which represents the project. Do you want to run existing plugins or do you want to run your own code after the refresh took place?

Frans Bouma | Lead developer LLBLGen Pro
jvidal
User
Posts: 37
Joined: 17-Sep-2007
# Posted on: 16-Oct-2007 11:36:48   

Hi Otis, Thanks for you reply.

What I'm using the plug ins for currently is to manipulate the graph, so if you say that this is available form the CLI refresher then as you say adding the code there should work...

Currently I'm using 2 plugins, one to set unique names for N:M relationships, avoiding the "_" that LLBL ads. and the other to assign sequences to ID fields, none of them needs user interaction and have to apply to all the objects after every refresh.

Which methods/objects should I look at in the refresher to have acces to the project entites and properties?

Many Thanks! Jaume

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 16-Oct-2007 11:52:10   

In Startup.cs, StartProcess, line 163, the project refreshed is saved.

So you can before that line manipulate the projectToRefresh project with the same code as the plugins do, and your project gets saved at line 163. simple_smile

You CAN run a plugin as well though, if you really want to. The plugin instances are available in StartProcess in the local object configurationSettings.Plugins (loaded at line 111).

Set the ProjectToTarget on the plugin to the projectToRefresh object and call Execute() on the plugin. If the plugin has to work on entities alone, fill the Entities property, etc.

Frans Bouma | Lead developer LLBLGen Pro
jvidal
User
Posts: 37
Joined: 17-Sep-2007
# Posted on: 17-Oct-2007 10:58:57   

Brilliant! I'll try this

Thanks very much Otis! LLBL is really flexible!, good job!