# Compiling GNAT

1. Ensure Github has the latest edits downloaded by fetching origin.
2. Ensure GNAT version is updated in the code just after the comments.
3. From the command line run `standaloneApplicationCompiler`, or launch the compilier add on.
4. Create a new project and copy the entire GNAT folder to the project directory.
5. Add `GNAT.m` to the main file window.
6. Untick the automatically include data files under the requirements tab.
7. Under the Images for standalone application include the relevant images for splash and icon, see screen shot below.

   ![Images for the Standalone Application — splash screen and icon pickers](images/standalone-app-images.png)

   ![GNAT image asset files (logo, splash, icons) in the Import_Export folder](images/gnat-image-files.png)

8. Add entire GNAT folder to the Files required for standalone to run window (Note: some functions are often missed if this is not done and one relies on matlab to automatically detect them).
9. I prefer to use the standalone application installer rather than the standalone windows application, as the terminal window is kept.

   ![Application Type — Standalone Application vs Standalone Windows Application](images/application-type.png)

10. Under the images for installer include the GNAT logo and splash screen as above.

    ![Images for the Installer — splash screen, icon and sidebar image](images/installer-images.png)

    ![Files Required for Standalone to Run panel](images/files-required-for-standalone.png)

11. Finally hit build and package.
12. Check the build by importing data and processing. Typical tests include 1d processing, ROSY processing and DOSY processing.

    ![Build output folder contents](images/build-output-folder.png)

13. Install the latest version under the output/package folder to your workstation and repeat the import and processing steps.
