View Source

h1. Situation
Control build version with a text file stored in SCM.

h1. Demonstration
# Run the [demo configuration|http://demo.pmease.com/overview/118].
# Navigate to [workspace area of the configuration|http://demo.pmease.com/workspace/118] 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|http://demo.pmease.com/settings/118/general], the next version is defined as below:
{code}
${groovy:
import com.pmease.quickbuild.util.FileUtils
FileUtils.createDir(configuration.workspaceDir)
def repo = repositories.get("repo")
repo.takeSnapshot()
return repo.sourceViewSupport.readSourceAsString("build/version.txt")
}
{code}

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