Skip to content

Commit 6cf5232

Browse files
committed
Merge pull request kivy#120 from bob-the-hamster/add-jar
--add-jar command line option for including .jar files
2 parents 1ce75cd + f1c6d51 commit 6cf5232

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/build.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,14 @@ def make_package(args):
310310
os.mkdir('res/drawable-xhdpi')
311311
shutil.copy(args.ouya_icon or default_ouya_icon, 'res/drawable-xhdpi/ouya_icon.png')
312312

313+
# If extra Java jars were requested, copy them into the libs directory
314+
if args.add_jar:
315+
for jarname in args.add_jar:
316+
if not os.path.exists(jarname):
317+
print 'Requested jar does not exist: {}'.format(jarname)
318+
sys.exit(-1)
319+
shutil.copy(jarname, 'libs')
320+
313321
# Build.
314322
try:
315323
map(lambda arg: subprocess.call([ANT, arg]), args.command)
@@ -358,6 +366,7 @@ def make_package(args):
358366
ap.add_argument('--wakelock', dest='wakelock', action='store_true',
359367
help='Indicate if the application needs the device to stay on')
360368
ap.add_argument('command', nargs='*', help='The command to pass to ant (debug, release, installd, installr)')
369+
ap.add_argument('--add-jar', dest='add_jar', action='append', help='Add a Java .jar to the libs, so you can access its classes with pyjnius. You can specify this argument more than once to include multiple jars')
361370

362371
args = ap.parse_args()
363372

0 commit comments

Comments
 (0)