How to automate version code incrementing in AndroidManifest?

后端 未结 4 1125
感情败类
感情败类 2021-02-14 07:47

I have application which uploaded into Subversion/SVN repo. Is it possible to use script to somehow change application version code stored in AndroidManifest? I mea

4条回答
  •  南旧
    南旧 (楼主)
    2021-02-14 08:06

    SVN has keyword substitution which you can use to put the revision number in a file. However, this will result in the revision when the manifest file itself was last changed, which is not what you want.

    The best way to achieve what you want is to call svnversion from your build script, and embed the output in the manifest file from there. You could have a manifest.template file under version control which can be used by your build script to generate the real manifest file. Put a placeholder word in the template and replace it by the revision number obtained with svnversion.

    edit: in Eclipse you would probably use an Ant script, and invoke it before the normal build. The linked example generates a class file with the revision number, but you could also generate a manifest file in a very similar way.

提交回复
热议问题