Skip to main content
Version: QB80

Read Version from File

Situation

Control build version with a text file stored in SCM.

Demonstration

  1. Run the demo configuration.
  2. Navigate to workspace area of the configuration and check content of version.txt. Version of the newly generated build will remain the same as content of this file.

Resolution

Check general setting of the demo configuration, the next version is defined as below:

${groovy:repositories.get("repo").sourceViewSupport.readSourceAsString("/demos/componentA/trunk/version.txt")}

This tells QuickBuild to read content of file /demos/componentA/trunk/version.txt from SCM repository and return it as version of next build.