Error: Only up to 6 modules are supported in this layout. If you need more add your own layout.

A while back on the ClarionLive skype chat I mentioned this template and promised to upload a version. I completely forgot all about it a few days later but here it is finally!

This template just calls up SubWCRev.exe which is shipped with TortoiseSVN. After that it is up to you to arrange to compile the details into your EXE or DLL. This is very easy to do using the VersionRes.TPL shipped with Clarion but it should also work fine with any other similar template designed to include values from an external file.

At this point I don’t intend to ship a fully working example but hopefully the following explanation will be enough to get you going.

The Template:

 

This template has only been tested with Clarion7 ABC but it should work fine in C6 as well as legacy applications.

Some screenshots that should explain how I use it:

 

1. Add the global extension to your application

GenerateSubVersion template dialog with default values

Note the name of the “Source version file”. This is the template used as the input for SubWCRev. Here is an example of how you might want to use it:

You will need to create this “SubVersion.in” file yourself. The destination file “SubVersion” is generated for you)

2. Add the global Version Resource template and configure it to use the destination file specified in the GenerateSubVersion template:

Clarions VersionRes.tpl configured to use an external file

3. Compile your application and if all goes well you should now have your SubVersion build compiled into your version resource!

Compiled EXE with SVN revision information!

The SVN revision in this example is "2" and as you can see I have chosen to include the rev date as well. The date could be useful to automatically include the Copyright year for example…

Recently I have been doing a fair amount of work trying to automate parts of the development process, in particular the version control aspects. I ran into what appeared to be limitations in the length of parameters accepted by the Clarion templates #RUN statement. Searching the newsgroups there were a few comments from people having similar issues and the symptoms were seemed a little sporadic. I decided that the safest way was to write the commands out to a temporary batch file and use #RUN to just call that.