Closed stuckyb closed 7 years ago
That could be really useful, assuming its not too much trouble!
On Mon, Mar 6, 2017 at 11:40 AM, stuckyb notifications@github.com wrote:
It would be really cool to distribute ontobuilder in a way that required nothing more than the JRE on users' computers. E.g., it might be possible to compile all of the Jython code to Java classes and distribute the whole package as a jar file.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stuckyb/ontobuilder/issues/50, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGdxVzfkSN0OvylF4klk0v7CPQd8SMgks5rjGEdgaJpZM4MUmUB .
-- John Deck (541) 914-4739
Following this repository: https://github.com/jsbruneau/jython-selfcontained-jar/
It should allow for all the file structure to remain the same.
Just took a first look at the "jar_creation" branch. Looking good! One bug I noticed -- if you execute the OntoApp jar file without any command-line arguments, it dies with an "IndexError: index out of range: 0" exception. I haven't investigated it any further.
Command-line argument parsing is proving to be a roadblock. To document the behavior in the different execution contexts, here are the results of invoking OntoPilot three different ways:
$ jython python-src/bin/ontopilot_main.py
['python-src/bin/ontopilot_main.py']
Unable to load the project configuration file.
$ java -jar java-lib/jython-full.jar python-src/bin/ontopilot_main.py
['python-src/bin/ontopilot_main.py']
Unknown build target: "python-src/bin/ontopilot_main.py".
$ java -jar dist/OntoApp.jar
[]
IndexError: index out of range: 0
The console output of (1) is correct. Why (2) produces different output is not clear, since the value of the argument list is identical. (3) looks like a pain (as @Annhiluc already discovered) since the interpretation of sys.argv would have to be different.
The most important goal is to develop a distribution that doesn't require Jython installation as a prerequisite. Either option (2) or option (3) would achieve that, so for now, we should probably go with whichever is easiest to get working, while preserving the ability to run OntoPilot as in option (1).
Thanks to commit 55e0d8904e98af4543aa4add1e81a339e617b263, argument parsing in all 3 runtime contexts is now working. The incorrect console output in option (2) in the previous comment was evidently caused by a malfunctioning Jython JAR file; this file was updated in commit 55e0d8904e98af4543aa4add1e81a339e617b263.
Done!
It would be really cool to distribute ontobuilder in a way that required nothing more than the JRE on users' computers. E.g., it might be possible to compile all of the Jython code to Java classes and distribute the whole package as a jar file.