@@ -286,6 +286,19 @@ def make_package(args):
286286 with open (args .intent_filters ) as fd :
287287 args .intent_filters = fd .read ()
288288
289+ if args .extra_source_dirs :
290+ esd = []
291+ for spec in args .extra_source_dirs :
292+ if ':' in spec :
293+ specdir , specincludes = spec .split (':' )
294+ else :
295+ specdir = spec
296+ specincludes = '**'
297+ esd .append ((realpath (specdir ), specincludes ))
298+ args .extra_source_dirs = esd
299+ else :
300+ args .extra_source_dirs = []
301+
289302 service = False
290303 service_main = join (realpath (args .private ), 'service' , 'main.py' )
291304 if exists (service_main ) or exists (service_main + 'o' ):
@@ -322,6 +335,11 @@ def make_package(args):
322335 'res/values/strings.xml' ,
323336 args = args )
324337
338+ render (
339+ 'custom_rules.tmpl.xml' ,
340+ 'custom_rules.xml' ,
341+ args = args )
342+
325343 with open (join (dirname (__file__ ), 'res' ,
326344 'values' , 'strings.xml' )) as fileh :
327345 lines = fileh .read ()
@@ -410,6 +428,8 @@ def parse_args(args=None):
410428 help = 'If set, the billing service will be added (not implemented)' )
411429 ap .add_argument ('--service' , dest = 'services' , action = 'append' ,
412430 help = 'Declare a new service entrypoint: NAME:PATH_TO_PY' )
431+ ap .add_argument ('--add-source' , dest = 'extra_source_dirs' , action = 'append' ,
432+ help = 'Include additional source dirs in Java build' )
413433
414434 if args is None :
415435 args = sys .argv [1 :]
0 commit comments