@@ -198,11 +198,6 @@ def compile_dir(dfn):
198
198
199
199
200
200
def make_package (args ):
201
- url_scheme = 'kivy'
202
-
203
- # Figure out versions of the private and public data.
204
- private_version = str (time .time ())
205
-
206
201
# # Update the project to a recent version.
207
202
# try:
208
203
# subprocess.call([ANDROID, 'update', 'project', '-p', '.', '-t',
@@ -253,6 +248,14 @@ def make_package(args):
253
248
shutil .copy (args .presplash or default_presplash ,
254
249
'res/drawable/presplash.jpg' )
255
250
251
+ # If extra Java jars were requested, copy them into the libs directory
252
+ if args .add_jar :
253
+ for jarname in args .add_jar :
254
+ if not os .path .exists (jarname ):
255
+ print ('Requested jar does not exist: {}' .format (jarname ))
256
+ sys .exit (- 1 )
257
+ shutil .copy (jarname , 'libs' )
258
+
256
259
versioned_name = (args .name .replace (' ' , '' ).replace ('\' ' , '' ) +
257
260
'-' + args .version )
258
261
@@ -263,6 +266,10 @@ def make_package(args):
263
266
version_code += int (i )
264
267
args .numeric_version = str (version_code )
265
268
269
+ if args .intent_filters :
270
+ with open (args .intent_filters ) as fd :
271
+ args .intent_filters = fd .read ()
272
+
266
273
render (
267
274
'AndroidManifest.tmpl.xml' ,
268
275
'AndroidManifest.xml' ,
@@ -345,6 +352,16 @@ def parse_args(args=None):
345
352
default = join (curdir , 'whitelist.txt' ),
346
353
help = ('Use a whitelist file to prevent blacklisting of '
347
354
'file in the final APK' ))
355
+ ap .add_argument ('--add-jar' , dest = 'add_jar' , action = 'append' ,
356
+ help = ('Add a Java .jar to the libs, so you can access its '
357
+ 'classes with pyjnius. You can specify this '
358
+ 'argument more than once to include multiple jars' ))
359
+ ap .add_argument ('--intent-filters' , dest = 'intent_filters' ,
360
+ help = ('Add intent-filters xml rules to the '
361
+ 'AndroidManifest.xml file. The argument is a '
362
+ 'filename containing xml. The filename should be '
363
+ 'located relative to the python-for-android '
364
+ 'directory' ))
348
365
349
366
if args is None :
350
367
args = sys .argv [1 :]
0 commit comments