Cordova Build - ignore files

前端 未结 6 705
孤街浪徒
孤街浪徒 2021-02-08 10:58

When compiling a cordova application every single file in my /www folder gets copied to the assets/www folder(android) but I\'d like to customize what

6条回答
  •  旧时难觅i
    2021-02-08 11:44

    With the help of this article, I found that you can create/edit the platform/android/ant.properties, and add the following line to it:

    aapt.ignore.assets=!*.map:!thumbs.db:!.git:.*:*~
    

    With this line, any file or directory that matches one of these patterns will not be included in the .apk file:

    • *.map
    • thumbs.db
    • .git
    • .*
    • *~

    I found that editing the platforms/android/build.xml won't work because it's overwritten each time the build is invoked; also, creating a build.xml file in the root of the project didn't work.

    The rules for this property are the following, taken from $ANDROID_HOME/tools/ant/build.xml:

    
        
    

提交回复
热议问题