@@ -471,12 +471,20 @@ def make_package(args):
471
471
url_scheme = 'kivy'
472
472
473
473
# Copy backup rules file if specified and update the argument
474
+ res_xml_dir = join (res_dir , 'xml' )
474
475
if args .backup_rules :
475
- res_xml_dir = join (res_dir , 'xml' )
476
476
ensure_dir (res_xml_dir )
477
477
shutil .copy (join (args .private , args .backup_rules ), res_xml_dir )
478
478
args .backup_rules = split (args .backup_rules )[1 ][:- 4 ]
479
479
480
+ # Copy res_xml files to src/main/res/xml
481
+ if args .res_xmls :
482
+ ensure_dir (res_xml_dir )
483
+ for xmlpath in args .res_xmls :
484
+ if not os .path .exists (xmlpath ):
485
+ xmlpath = join (args .private , xmlpath )
486
+ shutil .copy (xmlpath , res_xml_dir )
487
+
480
488
# Render out android manifest:
481
489
manifest_path = "src/main/AndroidManifest.xml"
482
490
render_args = {
@@ -737,6 +745,8 @@ def parse_args_and_make_package(args=None):
737
745
'filename containing xml. The filename should be '
738
746
'located relative to the python-for-android '
739
747
'directory' ))
748
+ ap .add_argument ('--res_xml' , dest = 'res_xmls' , action = 'append' , default = [],
749
+ help = 'Add files to res/xml directory (for example device-filters)' , nargs = '+' )
740
750
ap .add_argument ('--with-billing' , dest = 'billing_pubkey' ,
741
751
help = 'If set, the billing service will be added (not implemented)' )
742
752
ap .add_argument ('--add-source' , dest = 'extra_source_dirs' , action = 'append' ,
0 commit comments