6 Replies Latest reply on Aug 28, 2007 7:16 AM by levancho

    Version Control

    Robert S Level 1
      Does anybody know if there is a way to add version control to the flex application? I would like to display a versioning such as 1.0.0 w/ minor and major version increases through the flex app.

      I could even live w/ a build date variable.

        • 1. Version Control
          levancho Level 3
          one way to do is to look how flex developers have done it :)

          public class VBox extends Box
          include "../core/Version.as";
          etc etc ..

          and in Version.as you put a version constant :

          mx_internal static const VERSION:String = "";

          ...hmm you don't mean you want something more automated?
          • 2. Re: Version Control
            Robert S Level 1
            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.
            • 3. Re: Version Control
              levancho Level 3
              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)
              • 4. Re: Version Control
                brado77 Level 1

                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,

                • 5. Re: Version Control
                  brado77 Level 1

                  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.

                  • 6. Re: Version Control
                    levancho Level 3
                    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.