Android custom build using Ant

后端 未结 3 1121
陌清茗
陌清茗 2021-01-02 06:43

These 4 files (build.xml, local.properties, projects.properties, proguard.cfg) are auto-generated when running:

android update project --name TestApp --t

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-02 07:25

    The build.xml as generated by the android tool (at least when using Android SDK r20) contains this piece of code:

    
    
    

    So what I do to create additional targets or customize existing targets is to create a custom_rules.xml file with these new targets. Note that in my tests the targets needed to be nested in a tag, so simply copy the first two lines of your generated build.xml to custom_rules.xml, and don't forget about the closing tag in the end. As custom_rules.xml will not be overwritten by android update your changes will be persistent and can be checked into your SCM tool of choice.

提交回复
热议问题