Getting started
Before you can start developing plugins or contributing to moonlight, you need to set up a development environment
In this tutorial, you will learn how to:
Setup a development environment
Compile and start moonlight
Compile and start a moonlight plugin
Requirements
C# IDE (and not a text editor like vs code if you want a good development experience). Recommended: Jetbrains Rider
A linux vm and all mentioned items in the "Linux" tab :>
Creating an environment for a plugin
To start developing a plugin for moonlight, you need a development environment first. To create a development environment, follow these steps:
Open a terminal and create a directory for the development environment. Replace the path with the one you want to use
mkdir ~/MoonlightDev/myNewPlugin cd ~/MoonlightDev/myNewPlugin mldev plugin create MyNewPlugin . mldev db startOpen the folder of your instance in the file manager and go into the folder called
source
. In there should be a file calledMyNewPlugin.sln
(Depends on the provided name). Open this file with the C# IDE of your choice. It should automatically load the project, and you should be able to start developing a plugin. It should already contain some example code.To test your plugin, go back to the terminal and run the following command. If this is the first run, moonlight should automatically create an admin user for you and print the credentials in the console. After moonlight started, you should see a URL in the console. Open it in your web browser to open your local moonlight test instance.
mldev plugin run
Creating an environment for contributions
To start modifying moonlights source code, you need a development environment first. To create a development environment, follow these steps:
Open a terminal and create a directory for the development environment. Replace the path with the one you want to use
mkdir ~/MoonlightDev/myMoonlightContribution cd ~/MoonlightDev/myMoonlightContribution mldev contribution create ImproveUi . mldev db startOpen the folder of your instance in the file manager and go into the folder called
source
. In there should be a file calledMoonlight.sln
. Open this file with the C# IDE of your choice. It should automatically load the project, and you should be able to start developing with moonlight.To test your changes, just run the project via your IDE. If you use Rider for example, you just need to press the green "Play" button. The database credentials should be automatically via the
mldev db start
command.