1. #1
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    39
    Vote Rating
    0
    shanlin is on a distinguished road

      0  

    Default Unanswered: displaying application version

    Unanswered: displaying application version


    If I like to display our company's application version number in the app, what is the best way to go about it?

    In Java, people can have a Version class which can read an entry(implementation-version) in manifest file, or through some other means. In ST20, we only have a concept of cache manifest. Does ST have any API to deal with that? What would be the suggested way to go about it?

    Many thanks!

  2. #2
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    39
    Vote Rating
    0
    shanlin is on a distinguished road

      0  

    Default


    I realized that one can set version in app.json or package.json. Is there API can get to either of these objects?

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,142
    Answers
    3505
    Vote Rating
    855
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    I don't know of a way to do this automatically from the packager.json or app.json (there is no version config in app.json). I would think you would have to do this in JavaScript to set the version somewhere where you can get it easily.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #4
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Answers
    1
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

    Default


    I wish there was some built-in support for this, as it's very helpful to have something to tell if the user isn't getting the current version due to ST or browser problems.

  5. #5
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    99
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      0  

    Default


    Quote Originally Posted by jep View Post
    I wish there was some built-in support for this, as it's very helpful to have something to tell if the user isn't getting the current version due to ST or browser problems.
    It wouldn't be hard to include a version variable in your code and display/access it.

    But, I understand why you think it should be included, or at least mentioned somewhere.

  6. #6
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Answers
    1
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

    Default


    No, it's not hard. You just have to keep track of it and update it by hand each time. There's already a great deal of automation involved in the build process. I'd settle for just being able to easily work with the same version that goes in the manifest.

  7. #7
    Sencha User
    Join Date
    Sep 2013
    Location
    Orlando, FL
    Posts
    1
    Vote Rating
    0
    nick.randazzo@siemens.com is on a distinguished road

      0  

    Default


    Did this topic die here? We're trying to standardize our apps to have a quick/easy way to display version info about the app (like an "About" page) and would like to rely on automated version info rather than manually maintained info. Any leads anyone? Thanks.

  8. #8

    Join Date
    Jan 2013
    Posts
    12
    Vote Rating
    2
    chrisp_ocs is on a distinguished road

      0  

    Question


    Another thread resurrection

    Some way of automating version numbering would be absolutely fantastic. I'm looking to tie our web-app and native-app builds into our continuous integration server (Jenkins). Software for other platforms automatically gets their version numbers set by values configured in the build process.

    For example, for our other projects we'll have a default major and minor version specified for our builds. Each build then automatically sets the remaining parts of the version number to the Jenkins build number and SVN revision. So, a full version number looks like <major>.<minor>.<buildnumber>.<svnrevision>

    Is there some way to write a hook that runs during the build process (within Cmd or Architect) which could update a variable within a js file to set the version number before the build takes place? Jenkins makes the auto-generated version available via an environment variable, so any hook would need access to that.

    Any thoughts?

    Cheers,
    Chris

  9. #9

    Join Date
    Jan 2013
    Posts
    12
    Vote Rating
    2
    chrisp_ocs is on a distinguished road

      1  

    Default


    Hmm -- this looks promising:

    http://www.sencha.com/forum/showthre...l=1#post940466

    Didn't realise that ant could even update the file via a regex itself!

    Now, I need to find somewhere in build-impl.xml that would be a suitable place to perform the version update....

    Cheers,
    Chris