简体   繁体   中英

Update version in appengine-web.xml by current svn revision number

We are trying to update appengine version number automatically based on svn revision number.

This is the appengine-web.xml file:

<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>XYZ</application>
    <version>5646</version>
        ....

How do we replace 5646 with the current svn revision number automatically in a daily basis?

Ideally, it is a command line and has something to do with 'svnversion' (which output looks like 10358:10359 ).

I had to write again and again:

If you can use Windows CLI-programs, youhave to use SubWCRev from TortoiseSVN:

  • Write and add to repo template-file for appengine-web.xml, there version string replaced by SubWCRev-keyword ($WCREV$ in your case)
  • When you want to have real data in xml-file, run SubWCRev in your Working Copy, get final file. Useit

Well, this might seem like an annoyance, but it is easiest if you convert your project to a Maven Project. Then, you can use plugins like the maven-buildNumber-plugin to dynamically replace any values you want (using the stardard maven-replacer-plugin ) in any of your build files.

The caveat is that you must use the maven-gae-plugin to compile and deploy your applications. I use Eclipse and it just means that rather than using the Google App Engine buttons in the UI, you just make a build configuration (ie gae:deploy ), and then just click the build button in the future.

The upside is that now you can do near any number of complex build step modifications to your project, and via the magic of Maven, you don't need to download any extra plugins or jars beyond Maven itself, since it will just fetch and install them for you. This makes it easier for other people to check your GAE app out of a sparse SVN and build it any time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM