Microsoft C++ Compiler/Project Compiler

Hi.

I'm using FinalBuilder to build multiple products containing both C# and C++ projects. In order to make the build script more generic i need to be able to dynamically select the projects to build with a specific action. This is easily performed with the Microsoft C# compiler action, for C++ projects I have to use the Build VS.Net Solution where it's impossible to implement a dynamical behaviour around which projects to build.

Regards,

Hi Jorgen,

We’re planning on reworking the VS.Net solution action in future to make it easier to configure on the fly. The real catch is that projects are identified by their project ID, rather than by name.


In the meantime, there is a way to use script to change which projects to build at runtime. If you have the latest FinalBuilder 5 build (130), then you can place script like the following JScript into the BeforeAction property of the action:

The trick is to use the Action.GetProjectID() function, which returns the ID for a project. The argument to GetProjectID can either be the file name of the project, or the project name itself (as shown in the Property Page list.)

A simple example:

Action.SelectedProjects.Clear;
Action.SelectedProjects.Add(Action.GetProjectID(“WindowsProject2”));


A more complex example:

Assuming that you have a list of project names (or files) in the “ProjectNames” variable, separated by newlines.

var projNames = ProjectNames.split(’\n’);
Action.SelectedProjects.Clear;
for(var j = 0; j < projNames.length; j++)
{
Action.SelectedProjects.Add(Action.GetProjectID(projNames[j]));
}

Let me know if you need any more information.

Regards,

Angus