How to automate version code incrementing in AndroidManifest?

后端 未结 4 1118
感情败类
感情败类 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-14 08:19

    I've done this by adding an extra build target - so the version code is incremented when you build the project, not when you commit to SVN. These are instructions to get this to work in IntelliJ IDEA.

    First, add a new file in the root of your project called svn-revision.build.xml with the following contents:

    
        
            
                
                
            
            Revision (app): ${revision}
            
        
    
    

    Then in the menu go to View > Tools > Ant Build, then press the little + button in the window and add the newly created file. Clicking the green 'run' button in the Ant Build window will run the script right away. To make the script run every time you build, you will need to set the 'svn-revision' target as a default target.

提交回复
热议问题