Volume 2 Build: Difference between revisions

From OuroDev
Red Nile (talk | contribs)
Rewrite of the Git section of the build guide, switching to the SourceTree Git client, which can handle tags. The previous example used GitHub Desktop, which cannot handle tags.
Red Nile (talk | contribs)
Added mention of Visual Studio 2010 Express
Line 2: Line 2:
:This guide tells you how to get particular versions of the Ouroboros code from Git, and how to build and compile it.  At the time of writing, this is being updated to run in Visual Studio 2019, but some components still require 2010.
:This guide tells you how to get particular versions of the Ouroboros code from Git, and how to build and compile it.  At the time of writing, this is being updated to run in Visual Studio 2019, but some components still require 2010.
== Required software ==
== Required software ==
* [http://download.microsoft.com/download/D/B/C/DBC11267-9597-46FF-8377-E194A73970D6/vs_proweb.exe Visual Studio 2010 Professional]
* [http://download.microsoft.com/download/D/B/C/DBC11267-9597-46FF-8377-E194A73970D6/vs_proweb.exe Visual Studio 2010 Professional] (Visual Studio 2010 Express will also work)
* [https://visualstudio.microsoft.com/downloads/ Visual Studio 2019], Community edition or higher
* [https://visualstudio.microsoft.com/downloads/ Visual Studio 2019], Community edition or higher
* An application for working with Git, this page will be using [https://www.sourcetreeapp.com/ SourceTree] as an example.   
* An application for working with Git, this page will be using [https://www.sourcetreeapp.com/ SourceTree] as an example.   

Revision as of 07:20, 28 June 2019

Summary

This guide tells you how to get particular versions of the Ouroboros code from Git, and how to build and compile it. At the time of writing, this is being updated to run in Visual Studio 2019, but some components still require 2010.

Required software

Note: Whichever Git application you choose, make sure that it supports use of tags, because that is how OuroDev marks certain versions of the code as being stable release versions.  Some of the Git tools out there like GitHub Desktop do not support displaying or using tags.

Important concepts

  • As a server owner, you need to at the very least understand the Git concepts of the develop branch, the master branch, and release tags. See the definitions of them here.
  • As a programmer, if you will be submitting any new code at all, you will also need to have an understanding of the rest of that page.

Create account for OuroDev Git

You need to register an account to access the OuroDev repositories.

Install SourceTree

  1. Download and install SourceTree. If you do not already have Git on your system, select to install a copy of it just for SourceTree to use.
  2. SourceTree will force you to create a BitBucket account and then click on BitBucket Client when you install it, but you can delete the BitBucket account from the application afterwards if you want. It isn't needed for the OuroDev project.

Clone repositories

Cloning is the process of copying the files from the Git repositories onto your computer.
  1. In SourceTree, click on Clone at the top of the page.
    Error creating thumbnail: File missing
  2. Enter the Source Path: https://git.ourodev.com/CoX/Source This will prompt you for credentials, use the account you made for OuroDev Git above.
  3. Enter the Destination Path: C:\Git\CoX\Source
  4. Leave the rest as the defaults, and click on Clone. This will copy the latest files from the master branch to your destination path on your hard drive.
    Error creating thumbnail: File missing
  5. Click on the + at the top of the screen next to the Source tab to create a new tab.
    Error creating thumbnail: File missing
  6. Click on the Clone button at the top of the page again, and repeat the steps but this time use https://git.ourodev.com/CoX/Assets and C:\Git\CoX\Assets for the source path and destination path.


Now you are set up with the latest versions of the Source and Assets master branches in C:\Git\CoX. You don't strictly need to have the Assets in order to build the Source files, but you do need the Assets files to run a server.

Selecting a release version

For a server owner, while it is sometimes okay to work with the latest version of the master branch, it is a better idea to specifically select a stable released version for your server files. To do this in Git, you want to "checkout" the tag for the release you want to use.
For a programmer, who will be working on the code instead of trying to run a server, you will instead want to be working with the develop branch as a starting point, and create your own feature branch from the develop branch.


For a server owner, in each of the Source and Assets tabs:
  1. Click on the ">" twistie next to Tags to expand it, you will see the tagged final releases.
  2. Click on the most current release tag. It will highlight that version in the tree display.
    Error creating thumbnail: File missing
  3. For a less confusing view of the tree, change the dropdown from viewing "all branches" to just viewing "current branch". This is now a view of the version changes that were made in the master branch. The tagged version you selected should still be highlighted.
    Error creating thumbnail: File missing
  4. To change the files on your computer to being the tagged release version instead of the latest version of the master branch, double-click on the tag to "checkout" that version.
    Error creating thumbnail: File missing
Checking out a tagged release will warn you that you are about to enter a "headless" state.  This just means that your files will not be updated to the latest versions ("the head") if more changes are made to the master branch after the tagged version you selected.  Which has implications if you are working on changing and delivering new code changes, but is just fine for if you are simply running a server and not intending to deliver new code changes to the repository.
Remember to checkout the tagged version for both the Source and the Asset tabs.  To get any new updates that become available, you will need to checkout the new tag as above, and repeat the compile steps below.

Build City of Heroes from Source

  1. Ensure you have MSBuild included in your path. This can typically be found in locations such as C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
  2. Start a powershell prompt as administrator
  3. Enter Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine into the terminal and type "A" to auto accept all.
  4. Open a command prompt that is set up for your version of visual studio:
    • If you have Visual Studio 2019 installed, then start a developer command prompt for Visual Studio (check the start menu).
    • If you only have 2010 installed, then run cmd, and in the command prompt run C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat.
  5. From this command prompt, run: powershell
  6. Navigate to "C:\GitHub\CoX\Source\MasterSolution" and run build.ps1
    Error creating thumbnail: File missing
  7. Begin building City of Heroes by running ".\build.ps1"
    Error creating thumbnail: File missing
  8. Eventually the build will finish (It can takeover 40 minutes to build, or as little as 15 depending upon your machine).
    Error creating thumbnail: File missing
    Error creating thumbnail: File missing
  9. The Master Solution builds various 3rd party projects, the AuthServer and art tools. But these could be built individually if desired (such as the AuthServer C:\GitHub\CoX\Source\AuthServer\src\AuthServer\AuthServer.sln).