@@ -340,6 +340,17 @@ def make_package(args):
340
340
341
341
# Prepare some variables for templating process
342
342
res_dir = "src/main/res"
343
+ # Add user resouces
344
+ shutil .rmtree (res_dir , ignore_errors = True )
345
+ ensure_dir (res_dir )
346
+ for resource in args .resources :
347
+ resource_src , resource_dest = resource .split (":" )
348
+ if isfile (realpath (resource_src )):
349
+ ensure_dir (dirname (join (res_dir , resource_dest )))
350
+ shutil .copy (realpath (resource_src ), join (res_dir , resource_dest ))
351
+ else :
352
+ shutil .copytree (realpath (resource_src ), join (res_dir , resource_dest ))
353
+
343
354
default_icon = 'templates/kivy-icon.png'
344
355
default_presplash = 'templates/kivy-presplash.jpg'
345
356
shutil .copy (
@@ -698,6 +709,10 @@ def parse_args_and_make_package(args=None):
698
709
action = "append" , default = [],
699
710
metavar = "/path/to/source:dest" ,
700
711
help = 'Put this in the assets folder at assets/dest' )
712
+ ap .add_argument ('--resource' , dest = 'resources' ,
713
+ action = "append" , default = [],
714
+ metavar = "/path/to/source:kind/asset" ,
715
+ help = 'Put this in the res folder at res/kind' )
701
716
ap .add_argument ('--icon' , dest = 'icon' ,
702
717
help = ('A png file to use as the icon for '
703
718
'the application.' ))
0 commit comments