The default build for the C# worker sets up a project that should get you started quickly, lets you customize the build, and is upgradeable between SpatialOS versions. However, if you need to customize it further, you can turn off the automatic build script generation.
spatial worker build for the first time, a
.sln file, which can be loaded in your IDE, should appear. Note that, by default, this file will be overwritten every time a build is run. It is compatible and has been tested with Visual Studio 2015 Community Edition, and is known to work with Jetbrains' Rider early access preview, except for running a worker from within the editor.
The default solution currently isn't compatible with MonoDevelop and Xamarin. If you wish to customize the solution and project files to make them compatible with your IDE, turn off the automatic build script generation.
The project is set up to have two configurations -
Debug - and 3 platforms for each -
macOS64, which build assemblies for 64-bit Windows, Linux, and macOS respectively.
These assemblies are bundled from the target directories of the build, so if you wish to have additional resources statically available at runtime, put them in the target directory of the relevant configuration-platform. Each of the assemblies contains compiled native code dependencies required to run the worker on the given platform. 32-bit versions of native dependencies are currently not provided.
When you run
spatial worker build, code is generated based on your schema. This is compiled as a separate assembly, as it needs to use the unsafe keyword. Release builds and assemblies are built for all provided platforms.
You can also open the
CsharpWorker solution in an editor of your choice, and build your code from there. Schema changes should be automatically picked up when building from an editor. You will have to run
spatial worker build after an upgrade of SpatialOS to pick up the newest dependencies.
We recommend to add some files and directories to the list of ignored items in your source control system.
- The usual suggested ignored C# project files (see an example .gitignore)
- You might want to add
- If you are using the default build scripts, you might also want to add
Updated about a year ago