Set a variable fom FinalBuider

Hi

I want to read a variable to Continua from Final builder, it is possible?

Thanks.

Pedro Lopes

Hi Pedro I think you should use Property Collectors take a look at here: http://wiki.finalbuilder.com/display/continua/Managing+Property+Collectors#ManagingPropertyCollectors-FinalBuilder

I dont use it yet so make some tests and report the results Diego Garcia

Property collectors only tell Continua CI Agents where to find tools etc, they are not designed for passing information back to Continua.

It’s not currently possible to set Continua CI Variables from FinalBuilder, however it will be in the next beta (I just added the functionality to Continua CI). This is how it will work : in FinalBuilder, write to the log using script :

[code] Action.SendLogMessage("@@log{setvariable name=continuavariablename value=“the value” },stInformation) [/code]

I’ll look at adding an action to FinalBuilder to make this simpler.

Nice

I try to put it to work with continua version 1.0.0.1281.

In the log of continua while run the FinalBuilder Script:

Run Script
@@log{setvariable name=MinorVersion value=13}


I receive this in continua log:
Action ‘FinalBuilder’ completed while not all message groups had been closed.


the variable “MinorVersion” on continua (Configuration scope and Numeric) do not change.

thanks
Pedro Lopes

Ok, looks like I messed up something… will look into it.

This has now fixed in the latest beta. Thank you.

You will also need to update FinalBuilder, this build includes a new action - Continua CI - Set Variable :

http://downloads.finalbuilder.com/downloads/finalbuilder/700/FB700_2111.exe

I still can not pass variables to Continua Server


the Log from final builder:

Continua CI - Set Variable
Variable %minorversion% has been set to the value '13'.


the project variable MinorVersion remains 0 not the13!



You cannot set Project Variables during a build… we probably should have named then Project Constants. You can only modify Configuration Variables during a build. Note that when you modify a variable during a build, you are only modifying it for that specific build, it does not affect the value of the variable defined at design time, so the next build will not see your modified value.

It looks to me like you are driving the version numbers from FinalBuilder, I would suggest that you let Continua provide version numbers and pass them to FinalBuilder. You can access the build version generated by Continua using $Build.Version.Default.Minor$ or $Build.Version.DotNet.Minor$ (the difference between Default and DotNet is the order of the Build and Revision).

Note that you can control the $Build.Version$ object from the first page in the configuration wizard, this page in the wiki has some useful info :

http://wiki.finalbuilder.com/display/continua/Creating+your+first+Configuration#Version Format String

If you are using subversion for example, you might want to have your build number be the subversion revision number :

1.0.$Build.YourRepoName.LastestChangesetId$.$Build.BuildNumber$ will give you that for native apps, for dotnet you would use
1.0.$Build.BuildNumber$.$Build.YourRepoName.LastestChangesetId$

Thank you for your time.

You rigth, I want handle the version number. 

My version is "%Configuration.MajorVersion%.%Configuration.MinorVersion%.$Repository.ERPRetail.LatestChangesetId$.$Build.BuildNumber$"

The reason is my android project, I have several numerated sqlfiles, like:

database.0000.sql
database.0001.sql
database.0002.sql
database.0003.sql
database.0004.sql

In this case my Minor version is 4.

I need to change the version on project automatically to be consistent with project database version.

How can I do it?

Thanks in advance,

Pedro Lopes


Vincent as we are talking about version numbers and setting variables, I think it would be nice to look at this request https://www.finalbuilder.com/Support/Forums/aft/10144.aspx in wish list that now seens to be a must have to integrate nice with continua.

I was trying to set the new generated version number to a variable in finalbuilder and load the property set from the variable, so didnt find an action for that.

Maybe I could be wrong but continua doesnt set property sets right ?

Hi Diego

A couple of things come to mind here. Firstly, you only need to prefix variables in an expression with the namespace if you want to ensure you get the value defined at design time. So if you have a config variable MinorVersion with a default value of 1, then :

%Configuration.MinorVersion% will evaluate to 1.

If you then use the Set Variable Action on that variable to set it to 2,

%Configuration.MinorVersion% will still evaluate to 1, however %MinorVersion% (without the namespace prefix) will evaluate to 2.

The other issue here is that you are trying to set the Build.Version during the build, which isn’t possible in the beta that you have. I just checked in a new action (Set Build Version) which will allow you to do just that (will upload a new beta shortly). So in your build, after you have run your FinalBuilder project (which I assume has a Continua Set Variable action to change the MinorVersion variable), Add a Set Build Version action with a value :

%MajorVersion%.%MinorVersion%.$Repository.ERPRetail.LatestChangesetId$.$Build.BuildNumber$

That should achieve what you are trying to do (unless I’m misunderstanding you again!).

Hi Vincent, I think you misunderstand.

Will explain more detailed.

I 've my build version in Continua setup like that: 6.$Server.Now.Month$.$Server.Now.Year$.$Repository.YourRepo.LastestChangesetId$
So I pass this to finalbuilder, finalbuilder has an variable named BuildVersion that is where continua store the value. So in finalbuilder I need to read that variable value to compile my delphi application, but i need to get from an propertyset so the compile action use it. As I’ve seen there is no action in finalbuilder to load the propertyset from an variable.

Knowing this It could be possible to have an action for do that or maybe continua finalbuilder action could have another box to setup the property set inside the script so we could setup the propertyset name and its values from constants or variables available in continua side.

Do you have any tips on how to better do that ?

It now works!!!!

Thank you,

Pedro Lopes