Fix typo
[TortoiseGit.git] / build.txt
blobcd6ded0909c19df308a12456bcba06a464daf918
1 Build instructions\r
2 ==================\r
3 \r
4 Compiling TortoiseGit is not very difficult, but it requires several steps\r
5 to finish, at least the first time.\r
6 \r
7 Unlike other big open source projects, once you have built all the libraries\r
8 TortoiseGit depends on, you can use the familiar Visual Studio IDE to build\r
9 and debug the binaries. No need to run the build script for every little change.\r
11 So don't give up if you read through the next section and all the requirements.\r
12 You only have to do this once.\r
14 Requirements\r
15 ------------\r
17 First, you need to install the compiler package:\r
19 *  You need at least Visual Studio 2017 for\r
20    building the full TortoiseGit package.\r
21    The TortoiseGit teams uses VS2017 Community Edition which is free for open-source\r
22    projects (https://www.visualstudio.com/downloads/).\r
23    Make sure you select the workload "Desktop development with C++" and the following components:\r
24    * VC++ 2017 v141 toolset (x86,x64) (checked by default)\r
25    * Visual C++ ATL-support (x86 and x64)\r
26    * Visual C++ MFC support (x86 and x64)\r
27    * Windows 10 SDK (>= 10.0.19041.0 for building the installer for the Windows 11 start menu extension)\r
28    * optional: NuGet packet manager (requirement for GoogleTestAdapter, see below)\r
29    * optional: GoogleTestAdapter (if you want to run the tests from within VS or use the package described below)\r
30    * optional: CodeSigning certificate (for Windows 11 start menu extension)\r
32 Next you might need to install some utilities/programs:\r
33 *  If you want to build the MSI installer you need WiX 3.11 (http://wixtoolset.org/releases/)\r
34    and the VS2017 extension (https://marketplace.visualstudio.com/vsgallery/2eb3402e-ea6d-4dcd-8340-c88435e54ea9).\r
35 *  If you want to build the installer you need to update the PuTTY binaries by running ext/putty/download.bat\r
36 *  For building the docs you need NAnt (http://nant.sourceforge.net/) and\r
37    https://sourceforge.net/projects/tortoisesvn/files/build%20tools/\r
38    See doc/readme.txt for more details on building the docs.\r
39 *  If you want to execute the unit tests from within VisualStudio the GoogleTestAdaper extension is recommended\r
40    (https://marketplace.visualstudio.com/items?itemName=VisualCPPTeam.TestAdapterforGoogleTest).\r
42 In order to not build the Windows 11 start menu extension you need to adjust the following settings:\r
43 * Set BuildWindows11ContextmenuExtension to 0 in src/TortoiseGit.settings.props\r
44 * Unload the CustomActions11 project in the project explorer (if you don't have Windows 10 SDK >= 10.0.19041.0)\r
46 In order to build the Windows 11 start menu extension you need to put your code signing certificate info into:\r
47 * src/TortoiseGitSetup/SparsePackage/AppxManifest.xml\r
48 * src/identity.manifest\r
50 Get external source code\r
51 ------------------------\r
53 TortoiseGit comes with all required code in its repository included or linked as submodules:\r
55 Run\r
57     git submodule update --init\r
59 to download all linked repositories (submodules) automatically.\r
60 Alternatively, you can download submodules when cloning the main project with single command.\r
62     git clone --recursive https://gitlab.com/tortoisegit/tortoisegit.git\r
65 After that you might need to apply TortoiseGit specific patches to the external libgit2 repository.\r
66 The patches, if any, are located in /ext/ and need to be applied to /ext/libgit2, e.g. using\r
68     cd ext/libgit2\r
69     for %%G in (..\libgit2-*.patch) do ( type %%G | git am --3way )\r
71 Building the packages\r
72 ---------------------\r
74 Open TortoiseGit.sln in Visual Studio.\r
75 Build all projects.\r
77 You can also build TortoiseGit via command line by calling MSBuild\r
78 Open Developer Command Prompt for VS2017\r
80     MSBuild TortoiseGit.sln /p:Configuration=Release;Platform=Win32\r
81     MSBuild TortoiseGit.sln /p:Configuration=Release;Platform=x64\r
83 If you want to build the installer package, make sure you build the Win32 configuration before the x64 one\r
84 Also, build the docs before the installer packages (or copy existing TortoiseGit_en.chm and TortoiseMerge_en.chm files into the doc/output folder).\r
86 For optimized debugging copy TGitNatVis.dll and TortoiseGit.natvis from contrib\NatVis to %USERPROFILE%\Documents\Visual Studio 2017\Visualizers.\r
87 Then CGitHash will provide a readable preview of the SHA-1 and CTGitPath is also optimized.\r