MonoGame Kickstarter

Hi all,

I just updated my MonoGame Kickstarter project and it works with MonoGame 3.8.1.303 now. In a nutshell it is just a bash script that sets up a Visual Studio solution with a shared code base and multiple dotnet projects using the official MonoGame dotnet project templates.

UWP and iOS is NOT supported at the moment. Also no plans for it.

I tested it only very quick and it worked on my machine. I use git bash to run the script. Since lack of time I only managed to update the script and adapt the sample code. So the documentation and other stuff may be not up to date or wrong.

To test it just clone the repo and change to the MonoGame Kickstarter project directory.

$ git clone https://github.com/Kwyrky/MonoGame.Kickstarter.git
$ cd MonoGame.Kickstarter/

This command tries to setup a solution with OpenGL (-o), WindowsDX (-w) and Android (-a) → all three combined to -owa in the command below:

$ ./monogame-kickstarter.sh -owa "MonoGameKickstarterMG"

This is basically everything you need to do! See notes for the Android project below!

Running the command will print something similar to this:

$  ./monogame-kickstarter.sh -owa "MonoGameKickstarterMG"
help: n [n]
rocket: n [n]
copy: y [y]
name: monogamekickstarter [monogamekickstarter]
debug: y [y]
solution: y [y]
nosolution: n [n]
verbose: n [n]
mgandroid: y [y]
mgdesktopgl: y [y]
mgios: n [n]
mguwpcore: n [n]
mguwpxaml: n [n]
mgwindowsdx: y [y]
################################################################################
solution: create solution
nosolution: create solution
################################################################################
projects to generate:
android
desktopgl
windowsdx
################################################################################
number of projects to generate: 3
################################################################################
################################################################################
This is MonoGameKickstarter 1.07 for MonoGame 3.8.1.303
################################################################################
The script was started with this configuration:
solutionnameparameter: MonoGameKickstarterMG
outputdir:
solutionname: MonoGameKickstarter
################################################################################
The script will use these settings:
solutionnameparameter: MonoGameKickstarterMG
outputdir:
solutionname: MonoGameKickstarterMG
slndir: MonoGameKickstarterMG
slndirsubdirs: 0
################################################################################
dotnet version: 7.0.400
################################################################################
MonoGame Android Application                  mgandroid                   [C#]        MonoGame/Games/Mobile/Android
MonoGame Content Pipeline Extension           mgpipeline                  [C#]        MonoGame/Games/Extensions
MonoGame Cross-Platform Desktop Application   mgdesktopgl                 [C#]        MonoGame/Games/Desktop/Windows/Linux/macOS
MonoGame Game Library                         mglib                       [C#]        MonoGame/Games/Library
MonoGame iOS Application                      mgios                       [C#]        MonoGame/Games/Mobile/iOS
MonoGame Shared Library Project               mgshared                    [C#]        MonoGame/Games/Library
MonoGame Windows Desktop Application          mgwindowsdx                 [C#]        MonoGame/Games/Desktop/Windows/Linux/macOS
MonoGame Windows Universal XAML Application   mguwpxaml                   [C#]        MonoGame/Games/Desktop/Windows/Xbox/UWP/XAML
################################################################################
MonoGame templates version
         Author: MonoGame Team
################################################################################
Creating directory MonoGameKickstarterMG now.
Directory MonoGameKickstarterMG is empty.
################################################################################
The template "MonoGame Game Library" was created successfully.

################################################################################
The template "MonoGame Cross-Platform Desktop Application" was created successfully.

Reference `..\MonoGameKickstarterMG.GameLibrary\MonoGameKickstarterMG.GameLibrary.csproj` added to the project.
################################################################################
The template "MonoGame Windows Desktop Application" was created successfully.

Reference `..\MonoGameKickstarterMG.GameLibrary\MonoGameKickstarterMG.GameLibrary.csproj` added to the project.
################################################################################
The template "MonoGame Android Application" was created successfully.

Reference `..\MonoGameKickstarterMG.GameLibrary\MonoGameKickstarterMG.GameLibrary.csproj` added to the project.
################################################################################
The template "Solution File" was created successfully.

Project `MonoGameKickstarterMG.GameLibrary\MonoGameKickstarterMG.GameLibrary.csproj` added to the solution.
Project `MonoGameKickstarterMG.Android\MonoGameKickstarterMG.Android.csproj` added to the solution.
Project `MonoGameKickstarterMG.DesktopGL\MonoGameKickstarterMG.DesktopGL.csproj` added to the solution.
Project `MonoGameKickstarterMG.WindowsDX\MonoGameKickstarterMG.WindowsDX.csproj` added to the solution.
################################################################################
PWD before is
/h/Dev/MonoGame/MonoGame.Kickstarter/MonoGameKickstarterMG
PWD after is
/h/Dev/MonoGame/MonoGame.Kickstarter
findpath is MonoGameKickstarterMG
findmaxdepthcalc is 3
pwd is
/h/Dev/MonoGame/MonoGame.Kickstarter
################################################################################
using maxdepth value of 3 (3):
################################################################################
Created these 14 dir(s):
MonoGameKickstarterMG
MonoGameKickstarterMG/MonoGameKickstarterMG.Android
MonoGameKickstarterMG/MonoGameKickstarterMG.Android/.config
MonoGameKickstarterMG/MonoGameKickstarterMG.Android/Content
MonoGameKickstarterMG/MonoGameKickstarterMG.Android/Resources
MonoGameKickstarterMG/MonoGameKickstarterMG.Android/Resources/Drawable
MonoGameKickstarterMG/MonoGameKickstarterMG.Android/Resources/Values
MonoGameKickstarterMG/MonoGameKickstarterMG.DesktopGL
MonoGameKickstarterMG/MonoGameKickstarterMG.DesktopGL/.config
MonoGameKickstarterMG/MonoGameKickstarterMG.GameLibrary
MonoGameKickstarterMG/MonoGameKickstarterMG.GameLibrary/.config
MonoGameKickstarterMG/MonoGameKickstarterMG.GameLibrary/Content
MonoGameKickstarterMG/MonoGameKickstarterMG.WindowsDX
MonoGameKickstarterMG/MonoGameKickstarterMG.WindowsDX/.config
################################################################################
Created these 21 file(s):
MonoGameKickstarterMG/MonoGameKickstarterMG.Android/.config/dotnet-tools.json
MonoGameKickstarterMG/MonoGameKickstarterMG.Android/Activity1.cs
MonoGameKickstarterMG/MonoGameKickstarterMG.Android/AndroidManifest.xml
MonoGameKickstarterMG/MonoGameKickstarterMG.Android/Content/Content.mgcb
MonoGameKickstarterMG/MonoGameKickstarterMG.Android/MonoGameKickstarterMG.Android.csproj
MonoGameKickstarterMG/MonoGameKickstarterMG.DesktopGL/.config/dotnet-tools.json
MonoGameKickstarterMG/MonoGameKickstarterMG.DesktopGL/app.manifest
MonoGameKickstarterMG/MonoGameKickstarterMG.DesktopGL/Icon.bmp
MonoGameKickstarterMG/MonoGameKickstarterMG.DesktopGL/Icon.ico
MonoGameKickstarterMG/MonoGameKickstarterMG.DesktopGL/MonoGameKickstarterMG.DesktopGL.csproj
MonoGameKickstarterMG/MonoGameKickstarterMG.DesktopGL/Program.cs
MonoGameKickstarterMG/MonoGameKickstarterMG.GameLibrary/.config/dotnet-tools.json
MonoGameKickstarterMG/MonoGameKickstarterMG.GameLibrary/Content/Content.mgcb
MonoGameKickstarterMG/MonoGameKickstarterMG.GameLibrary/Game1.cs
MonoGameKickstarterMG/MonoGameKickstarterMG.GameLibrary/MonoGameKickstarterMG.GameLibrary.csproj
MonoGameKickstarterMG/MonoGameKickstarterMG.sln
MonoGameKickstarterMG/MonoGameKickstarterMG.WindowsDX/.config/dotnet-tools.json
MonoGameKickstarterMG/MonoGameKickstarterMG.WindowsDX/app.manifest
MonoGameKickstarterMG/MonoGameKickstarterMG.WindowsDX/Icon.ico
MonoGameKickstarterMG/MonoGameKickstarterMG.WindowsDX/MonoGameKickstarterMG.WindowsDX.csproj
MonoGameKickstarterMG/MonoGameKickstarterMG.WindowsDX/Program.cs
################################################################################
You should now be able to build and run the project(s) with
the command `dotnet run` from the project folder(s) or by passing the project.csproj file or
the project path as argument e.g.
################################################################################
For Android manual steps are needed:

1. Open the solution in Visual Studio and right click the solution in the solution explorer to open the solution properties.
2. For Configuration select 'All Configurations' from the combo box
3. Select 'Configuration Properties' on the list to show the 'project contexts'
4. Make sure that for the Android project contexts both checkboxes for build and deploy are checked!
5. It should now be possible to build and deploy the Android app in Visual Studio if an android emulator is configured or
 a real device is connected and available in Visual Studio

################################################################################
dotnet run --project MonoGameKickstarterMG/MonoGameKickstarterMG.DesktopGL/MonoGameKickstarterMG.DesktopGL.csproj
dotnet run --project MonoGameKickstarterMG/MonoGameKickstarterMG.DesktopGL
dotnet run --project MonoGameKickstarterMG/MonoGameKickstarterMG.WindowsDX/MonoGameKickstarterMG.WindowsDX.csproj
dotnet run --project MonoGameKickstarterMG/MonoGameKickstarterMG.WindowsDX
dotnet run --project MonoGameKickstarterMG/MonoGameKickstarterMG.Android/MonoGameKickstarterMG.Android.csproj
dotnet run --project MonoGameKickstarterMG/MonoGameKickstarterMG.Android
################################################################################
################################################################################
Everything done! :-)

After that you should see a newly created folder inside the MonoGame Kickstarter project folder. Inside you should find the newly created solution and projects.

For Android the script prints out this too, it basically is just to click the deploy check mark in the solution configuration:

For Android manual steps are needed:

1. Open the solution in Visual Studio and right click the solution in the solution explorer to open the solution properties.
2. For Configuration select 'All Configurations' from the combo box
3. Select 'Configuration Properties' on the list to show the 'project contexts'
4. Make sure that for the Android project contexts both checkboxes for build and deploy are checked!
5. It should now be possible to build and deploy the Android app in Visual Studio if an android emulator is configured or
 a real device is connected and available in Visual Studio

If you get log output like this when trying to build and deploy the android project:

3>------ Skipped Deploy: Project: MonoGameKickstarterMG.Android, Configuration: Debug Any CPU ------
3>Project not selected to build for this solution configuration 
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 16:09 and took 39,894 seconds ==========
========== Deploy: 0 succeeded, 0 failed, 1 skipped ==========
========== Deploy started at 16:09 and took 39,895 seconds ==========

Make sure you activate the check boxes here:

Let me know if it works for you and if it is of any use for somebody else I can save myself the invested time and work :sweat_smile:

2 Likes