I am wanting to know what the best way would be to support regional client/server builds which would have some differences in content, plugins/subsystems, configs etc. Currently we have been investigating meeting this goal by creating additional build targets (client/server) but I am having problems getting it set up. Is this the right approach to be taking to have alternate builds?
I also have the following requirements for the builds being produced:
- Distinct build targets with their own names <MyProject><FeatureName>Client.Target vs. <MyProject>Client.Target
- Easy to switch between either build
- The different builds with have some minor code differences, but share a majority of their core functionality
- The capability to build different configs (Development, Shipping, etc.) of each build (Server/Client)
I have attempted to add new build targets with no success. I am using Rider as my IDE and I have my project, called <MyProject>, with four build targets detailed in:
- <MyProject>Game.Target.cs
- <MyProject>Client.Target.cs
- <MyProject>Editor.Target.cs
- <MyProject>Server.Target.cs
I tried creating new build target files <MyProject><FeatureName>Client.Target.cs and <MyProject><FeatureName>Server.Target.cs, then adding Global definitions to handle any changes in the code that need to be compile with its respective build. These files were added to the Source folder of my project. However, they do not appear as options that can be switched to and built by Rider. Additionally when I attempt to generate project files after making these changes, each new target file has its own project created and is associated to this new project (the files themselves stay in the same location on disk).
I don’t know how to correctly add new build targets, any help is appreciated.
(Separate note related to generating project files)
I noticed that when I added a second build target file for the same target type if I ran Generate Project Files, the target file that came first alphabetically remained associated with my project while the other build target would have a new project created for it.