问题
I have a Rascal project I would like to export to a JAR file to be ran like a terminal application, so users can simply run the JAR from command line instead of running it from Eclipse. Is there a way to do this? I tried to export it like a regular Java project but I'm not sure how to specify things such as the JAR's entry point.
回答1:
It depends a bit on the API's your using.
- If they are eclipse specific (the jdt submodule of m3) or if they are using the eclipse language services, you'll have to create a plug-in and a feature project. This is not for the faint of heart, but it works. I'll try to find an example.
- If you want a terminal like application, you can take the existing unstable/stable jar from the website, and copy your files in there, and update the rascal.mf file to also include your subdirectory in the search path. The shell should work automatically.
- If you want to link rascal functions from Java code, you'll have to do some work to correctly connect the evaluator. (And then do point 1 or 2)
So, if you could make your question more specific, I'll make a specific answer to your case, examples included.
(This answer is a bit of a half comment/half answer, sorry).
来源:https://stackoverflow.com/questions/50435487/export-a-rascal-project-to-a-jar-file