This documentation relates to QuickBuild 10.0.x
Select here if you are using a different version

Read Version from File

Version 1 by Robin Shen
on Jan 13, 2019 22:25.

compared with
Current by Robin Shen
on Feb 25, 2020 12:28.

These lines were removed. This word was removed.
These lines were added. This word was added.

View page history

There are 1 changes. View first change.

 h1. Situation
 Control build version with a text file stored in SCM.
 h1. Demonstration
 # Run the [demo configuration|].
 # 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.
 h1. Resolution
 Check [general setting of the demo configuration|], the next version is defined as below:
 import com.pmease.quickbuild.util.FileUtils
 def repo = repositories.get("repo")
 return repo.sourceViewSupport.readSourceAsString("build/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.