We use a combination of tools to achieve this. Our overall scripting for builds is done in ant, which is kind of like an XML version of C's make files, if you're familiar with that. Within an ant xml file, we get our source code from CVS, and use PowerGen to bootstrap import the source text files into PBLs. I'm not sure why we don't use ORCA script directly but rather paid to use PowerGen, but it's been that way since 2005. Then after the compile we tag the source code with that build's version number.
Not sure of your plans beyond PB 2017, but, unless things have changed, PB 2018 is supposed to eliminate the use of PBLs, so you may have to rewrite the whole thing for that anyway, so you may want to keep that in mind before spending a lot of time automating builds with PBLs.
I'm kind of wondering what the compile scenario will be like in PB 2018 and beyond, without PBLs.
Many thanks for the input. We currently use PowerGen too. This extracts the code from our source control and builds the PBLs, like you it has been this way since 2000. However, the routines do not fit the new library/folder structures we use for shared code across our numerous applications. We have to have an installed PB IDE to allow the routine to edit objects in the PBLs before performing the build so I was just musing on how we might achieve this going forward, in the short term.
Once the PBLs are gone then we would just script our source control to get latest to disk and compile using the command line compiler. This I believe will be a much simpler routine.
I do not see any point in spending a huge effort to achieve what we already have but if someone have a magic idea I was quite willing to borrow it :)
Cheers
David
So, a script that might do it:
//command line get source from source control.
svn checkout /pb/myapp/trunk
//use source control to get version number
svn info -r HEAD | rev.txt
//use command line append to generate user object source to contain revision info
type revhdr.txt rev.txt revftr.txt > revision.sru
//do command line compile using pbc
pbc170 /c foobar.pbt
pbc170 /d foobar.pbt
Note that pbc170.exe also has the /fv and /v command line switches that set the version info. e.g.
pbc170 /d /v "3.1.1.1470" /fv "3.1.1.0993"
revhdr and revftr are just text files that "wrap" your version number into a simple user object that you instantiate to get the revision number.