This content has been marked as final. Show 6 replies
one way to do is to look how flex developers have done it :)
public class VBox extends Box
etc etc ..
and in Version.as you put a version constant :
mx_internal static const VERSION:String = "18.104.22.168";
...hmm you don't mean you want something more automated?
I was kinda hoping for something a little more automated that would increment on the program compile... Visual Basic used to have this (many moons ago when I used to program in it)...
It's not THAT important, but it was a nice feature.
cvs/svn has automatic version increment feature built in, it increments for every commit and each file gets small version number next to its name, in svn its called I think revision number but I am not sure if you can read/use that number in your program.(I guess there can be some interfaces for t.hat)
I think what you really mean is the ability to display the build number, not necessarily version control. They are different things really. Presently, I use Subversion (SVN) as my version control system, and my flex apps reside in my SVN repository. SVN tracks revisions on every commit. Additionally, I use Maven 2 to manage building and publishing of build artifacts. It allows the ability to associate a major/minor/revision number with build arttifacts created and published to maven repositories -- but that "version number" if you will is essentially reflected in the name of the artifact file itself (i.e. the JAR, WAR, SWF, or whatever), not in some internal configuration file.
I think what you are really getting at here is the ability to display the build number in your application somewhere, in automated fashion. I know of nothing that will inherently do it, but obviously you are going to have to tie it into your build system. I believe there are some Maven plugins that allow substitution of values in files, and I suppose you could have some text file in your project directory which tracked build number, that was updated whenever a maven build was performed. If you are not using maven, then you could take a similar approach with whatever build system you are using. Basically, when an official "build" is done, the build process could increment the build number in this file. Or, even simpler, just create a simple Actionscript class in your Flex project that held a build number variable, and increment the build number manually when needed. At least your Flex app use that build number when necessary.
I generally try to externalize all my constants into a single Actionscript class or configuration file, where they are centralized and can be changed easily. This might be a good use for something like that.
Hope that helps a little,
I found something you might be interested in for this question. You might want to check out the section called "Adding Version Numbers" in the flex2_createextendcomponents.pdf document available on the adobe web site. It may describe what you are trying to do.
this issue got me very interested, so decide to do something for my system similiar, so I found a solution, still cant find time to do it yet , here how it will work:
use ant task,
to have defined version var in properties file, or in ant file itself as version property, or in some other file anyways, and have ant compile task or ant build task or ant somespecial task called BuoldwithIncreamentMAjor and buildWith increamentMinor , which ultimately first change the varialbe(icnreament the versiob and then build the system,
of course system got to point to that variable so it gets undated value.