@@ -508,12 +508,20 @@ def make_package(args):
508
508
url_scheme = 'kivy'
509
509
510
510
# Copy backup rules file if specified and update the argument
511
+ res_xml_dir = join (res_dir , 'xml' )
511
512
if args .backup_rules :
512
- res_xml_dir = join (res_dir , 'xml' )
513
513
ensure_dir (res_xml_dir )
514
514
shutil .copy (join (args .private , args .backup_rules ), res_xml_dir )
515
515
args .backup_rules = split (args .backup_rules )[1 ][:- 4 ]
516
516
517
+ # Copy res_xml files to src/main/res/xml
518
+ if args .res_xmls :
519
+ ensure_dir (res_xml_dir )
520
+ for xmlpath in args .res_xmls :
521
+ if not os .path .exists (xmlpath ):
522
+ xmlpath = join (args .private , xmlpath )
523
+ shutil .copy (xmlpath , res_xml_dir )
524
+
517
525
# Render out android manifest:
518
526
manifest_path = "src/main/AndroidManifest.xml"
519
527
render_args = {
@@ -803,6 +811,8 @@ def parse_args_and_make_package(args=None):
803
811
'filename containing xml. The filename should be '
804
812
'located relative to the python-for-android '
805
813
'directory' ))
814
+ ap .add_argument ('--res_xml' , dest = 'res_xmls' , action = 'append' , default = [],
815
+ help = 'Add files to res/xml directory (for example device-filters)' , nargs = '+' )
806
816
ap .add_argument ('--with-billing' , dest = 'billing_pubkey' ,
807
817
help = 'If set, the billing service will be added (not implemented)' )
808
818
ap .add_argument ('--add-source' , dest = 'extra_source_dirs' , action = 'append' ,
0 commit comments