Skip to content

--add-jar command line option for including .jar files #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,14 @@ def make_package(args):
os.mkdir('res/drawable-xhdpi')
shutil.copy(args.ouya_icon or default_ouya_icon, 'res/drawable-xhdpi/ouya_icon.png')

# If extra Java jars were requested, copy them into the libs directory
if args.add_jar:
for jarname in args.add_jar:
if not os.path.exists(jarname):
print 'Requested jar does not exist: {}'.format(jarname)
sys.exit(-1)
shutil.copy(jarname, 'libs')

# Build.
try:
map(lambda arg: subprocess.call([ANT, arg]), args.command)
Expand Down Expand Up @@ -358,6 +366,7 @@ def make_package(args):
ap.add_argument('--wakelock', dest='wakelock', action='store_true',
help='Indicate if the application needs the device to stay on')
ap.add_argument('command', nargs='*', help='The command to pass to ant (debug, release, installd, installr)')
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')

args = ap.parse_args()

Expand Down