mani-language / Mani

Máni ... an awesome, super simple programming language!
https://mani-language.github.io/
Mozilla Public License 2.0
28 stars 7 forks source link

Added fatJar to load stdlib files from within the Jar if not connected to the Internet #82 #91

Closed Kalekdan closed 5 years ago

Kalekdan commented 5 years ago

Name: Fat jar including stdlib files About: Adds a gradle job to add stdlib files to the jar when building

Is your PR related to a feature request or Bug report? If applicable, please list feature request number or bug report ID.

82

Describe your PR A clear and concise description of what your pull request is changing or adding.

Adds a new gradle job which includes stdlib files in a directory in the Jar. Changes the way stdlib files are loaded when not connected to the internet to instead load them from stdlib.

Describe intended use A clear and concise description of the intended use of the feature. Along with example code.

run gradle fatJar. Disabling internet connection and running Máni using this jar will cause it to instead use the stdlib from within the jar.

Is it in the form of a library

Does your PR replace an existing system If applicable, please describe how this PR changes the use of a related item.

Previously, when not connected to the internet, stdlib was loaded from a fixed location on the users machine. Now, it will instead load it from the location within the .jar file.

Additional comments Add any additional comments or screenshots here.

@crazywolf132 This changes the behavior so using stdlib with the normal jar without internet is no longer possible. I can add an appropriate message to be thrown if a user tries to do this?

Kalekdan commented 5 years ago

@crazywolf132 - this uses a different jar to the main jar (tests using the main jar will fail offline with this change since they will not have the stdlib)

crazywolf132 commented 5 years ago

True, I didn't think of that. How about we add a test then (in tests.sh) for this jar too then?

Kalekdan commented 5 years ago

I've added a runTestsOffline.mni which is also run using the new jar to demonstrate it passing offline

crazywolf132 commented 5 years ago

Awesome work. If you think it is ready, we are good to merge.

Kalekdan commented 5 years ago

@crazywolf132 As long as you are happy that the normal smaller .jar without the stdlib included will no longer function offline.