Volume 2 Build: Difference between revisions

From OuroDev
Jagged (talk | contribs)
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.
Line 1: Line 1:
== Summary ==
== Summary ==
This guide tells you how to build and compile the Ouroboros code stream.
: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.
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]
* [https://visualstudio.microsoft.com/downloads/ Visual Studio 2019], Community edition or higher
* [https://visualstudio.microsoft.com/downloads/ Visual Studio 2019], Community edition or higher
* [https://git-scm.com/download/win Git for Windows] or [https://desktop.github.com/ GitHub Desktop] or [https://www.sourcetreeapp.com/ SourceTree]
* An application for working with Git, this page will be using [https://www.sourcetreeapp.com/ SourceTree] as an example. 
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.


== Install GitHub Desktop and Acquire Source ==
== Important concepts ==
: You need to download and install [https://desktop.github.com/ GitHub Desktop].
* 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 [[OuroDev_Git_Workflow|here]]. 
: Open GitHub Desktop, Select File, and Clone a Repository.
 
:: Select the URL tab, enter "https://git.ourodev.com/CoX/Source.git" into the first blank and a path where to store the source locally such as "C:\GitHub\CoX\Source".
* 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.
::: [[File:GitHub Desktop CoX Source.png|thumb|none]]
 
: After the download finishes you should take the time to notice what branch you are on. By default you will be on "Master", but if you want to follow the latest changes you may want to consider swapping to "develop".
== Create account for OuroDev Git ==
: Regardless of which branch you choose, to get any new updates you will need to pull down the changes (a Git Pull) and repeat the compile steps.
:You need to [https://git.ourodev.com/user/sign_up register] an account to access the OuroDev repositories.
 
== Install SourceTree ==
#Download and install [https://www.sourcetreeapp.com/ SourceTree].  If you do not already have Git on your system, select to install a copy of it just for SourceTree to use.
#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.
#In SourceTree, click on Clone at the top of the page.
#: [[File:Sourcetree1.jpg|thumb|none]]
#Enter the Source Path: {{ms|<nowiki>https://git.ourodev.com/CoX/Source</nowiki>}} This will prompt you for credentials, use the account you made for OuroDev Git above.
#Enter the Destination Path: {{ms|<nowiki>C:\Git\CoX\Source</nowiki>}}
#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.
#: [[File:Sourcetree2.jpg|thumb|none]]
#Click on the + at the top of the screen next to the Source tab to create a new tab.
#: [[File:Sourcetree3.jpg|thumb|none]]
#Click on the Clone button at the top of the page again, and repeat the steps but this time use {{ms|<nowiki>https://git.ourodev.com/CoX/Assets</nowiki>}} and {{ms|<nowiki>C:\Git\CoX\Assets</nowiki>}} 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:
#Click on the ">" twistie next to Tags to expand it, you will see the tagged final releases.
#Click on the most current release tag.  It will highlight that version in the tree display.
#: [[File:Sourcetree4.jpg|thumb|none]]
#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.
#: [[File:Sourcetree5.jpg|thumb|none]]
#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.
#: [[File:Sourcetree6.jpg|thumb|none]]
 
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 ==
== Build City of Heroes from Source ==
: Ensure you have MSBuild included in your path. This can typically be found in locations such as {{ms|C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin}}
# Ensure you have MSBuild included in your path. This can typically be found in locations such as {{ms|C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin}}
: Start a powershell prompt as administrator
# Start a powershell prompt as administrator
: Enter {{ms|Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine}} into the terminal and type "A" to auto accept all.
# Enter {{ms|Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine}} into the terminal and type "A" to auto accept all.
: Open a command prompt that is set up for your version of visual studio:
# 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 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 {{ms|C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat}}.
#* If you only have 2010 installed, then run cmd, and in the command prompt run {{ms|C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat}}.
: From this command prompt, run: {{ms|powershell}}
# From this command prompt, run: {{ms|powershell}}
: Naviate to "C:\GitHub\CoX\Source\MasterSolution" and run build.ps1
# Navigate to "C:\GitHub\CoX\Source\MasterSolution" and run build.ps1
:: [[File:CoX-Build-1.png|thumb|none]]
#: [[File:CoX-Build-1.png|thumb|none]]
: Begin building City of Heroes by running ".\build.ps1"
# Begin building City of Heroes by running ".\build.ps1"
:: [[File:CoX-Build-2.png|thumb|none]]
#: [[File:CoX-Build-2.png|thumb|none]]
: Eventually the build will finish (It can takeover 40 minutes to build, or as little as 15 depending upon your machine).
# Eventually the build will finish (It can takeover 40 minutes to build, or as little as 15 depending upon your machine).
:: [[File:CoX-Build-3.png|thumb|none]]
#: [[File:CoX-Build-3.png|thumb|none]]
:: [[File:CoX-Build-4.png|thumb|none]]
#: [[File:CoX-Build-4.png|thumb|none]]
: 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 {{ms|C:\GitHub\CoX\Source\AuthServer\src\AuthServer\AuthServer.sln}}).
# 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 {{ms|C:\GitHub\CoX\Source\AuthServer\src\AuthServer\AuthServer.sln}}).

Revision as of 21:36, 27 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).