Skip to content

Instantly share code, notes, and snippets.

@Jjagg

Jjagg/mg_pr.md Secret

Created January 27, 2017 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jjagg/3a2cf257910b21fd0c143d81ef63637a to your computer and use it in GitHub Desktop.
Save Jjagg/3a2cf257910b21fd0c143d81ef63637a to your computer and use it in GitHub Desktop.
How to try out a MonoGame PR

Checking out a MonoGame Pull Request (PR)

You can install the build from any recent PR like you would install MG regularly by using the installer in the TeamCity artifacts from that PR. If you want to keep your installation at a specific version or if you intend to make changes, you should build from source. If you already build from source, the second option is very simple.

Option 1: Getting artifacts from the TeamCity build server

Go to the page of the PR you want to try and scroll to the bottom to find the build information. Click show all checks and then Details for the 'Package' check for your platform. show all checks package details

Go to the artifacts tab and click the installer you need to download it. installer

There you go! That's the same thing you download from the Downloads page from the MonoGame website. Run it like you normally would to get the MonoGame version of the PR installed.

Option 2: Building from source

If you don't have Git installed, do that first.

Clone MonoGame (or your fork of it) if you don't have a local copy yet and clone the submodules

$ git clone https://github.com/MonoGame/MonoGame.git
$ cd MonoGame
$ git submodule update --init

Add the remote of the owner of the PR you want to try (I always use some short form of the users name for the remote name, we'll use a PR from me as an example so I'd go with jjagg in this case). You can see the name of the remote and the branch of a PR on GitHub at the top. For this one it says: "Jjagg wants to merge 8 commits into
MonoGame:develop from Jjagg:instancedGL"

PR branch

$ git remote add jjagg https://github.com/Jjagg/MonoGame.git

Fetch the branch you want to build from that remote and check it out

$ git fetch jjagg instancedGL
$ git checkout instancedGL

Run git status. Git may say something about dirty submodules. If that happens run git submodule update to check out the right commit for the submodules.

Run Protobuild.exe (in the MonoGame root folder) to generate the projects and solutions (on Mac/Linux do mono Protobuild.exe).

  1. If the PR applies to the ContentPipeline: Open the MonoGame.Framework solution for your platform, it will contain a project for the Pipeline Tool. Build the solution, set the Pipeline Tool project as the startup target and run it. Build your content like you normally would, MGCB and Content.Pipeline from the solution will be used with the changes from the branch you checked out.
  2. If the PR applies to the runtime framework: In the project you want to use this build with, add the MonoGame.Framework project for the platform you're targeting, delete the existing MonoGame.Framework reference on your project and add a reference to the MonoGame.Framework.[Platform] project you added instead. That's it! You can build and run your project.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment