How would I go around recompiling the source code of my project when the project is launched?

As the title says I’m trying to figure out a way of recompiling my project’s source code when the project is launched. I’m also using the HaxeFlixel libraries to help with this project.

How are you “launching” your project? Do you mean running an executable .app or .exe, or are you testing using a lime or openfl command?

Yes I’m running it as an executable.

This scenario seems strange to me, since compilation would result in a new executable which would theoretically replace the application you have just launched.

At any rate, it is possible to run system commands from your executable using Sys.command, assuming your application has the correct permissions enabling it to have such access. Therefore you could trigger a compilation that way.

It would be more typical to compile first then launch the application. Using the openfl test command would first compile your game and then launch the executable. e.g. openfl test windows. You can run openfl help test to see more extensive information on your different testing options.