Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

Updated Wiki: Build and Setup on Windows

$
0
0

How to setup, build, and run tests on Windows

1. Install git for Windows. Open Git Bash and create directory where you want to keep the source tree:
mkdir Cpp-REST-SDK
cd Cpp-REST-SDK 

2. To clone this project in Git, use the following command (replace NameOfFolder with the name of the folder where you want the source code to be stored):
git clone https://git01.codeplex.com/casablanca NameOfFolder 

Going forward, you will want to pull from the master branch, which will always contain the last known release.

3. Next build the sources. You can build either from the command-line environment (PowerShell or cmd) or from the Visual Studio IDE. On Windows, we support both Visual Studio 2010 and Visual Studio 2012. (We recommend Visual Studio 2012 for its better support of C++ 11 language features). You will also need to have the Windows Phone 8 SDK installed.
  • Using PowerShell.
    1. Open a PowerShell window and navigate to the Cpp-REST-SDK folder
    2. Set the appropriate environment variables using the script files (the file may be blocked due to security reasons. You can right-click on the file and select properties to unblock the script)
      • setup_ps_env100.ps1 for Visual Studio 2010
      • setup_ps_env.ps1 for Visual Studio 2012
    3. Type the following command to build:
cd Cpp-REST-SDK/Release 
MSbuild dirs.proj 
  • Using the command prompt
    1. Open the Visual Studio command prompt and set up the DevToolsVersion environment variable to 100 or 110 depending on the version of the Visual Studio you want to use. You can then build using the same command as above.
  • Using Visual Studio (Only for VS 2012):
    1. Go to Cpp-REST-SDK/Release and open the casablanca110.sln in Visual Studio
    2. Right click on the solution and select build

How to run tests

  1. Once you have built the SDK you can run the tests
  2. Open a command prompt window
  3. Navigate to the Binaries directory and select the correct folder based on the configuration you built for
  4. Type the following command: TestRunner.exe
  5. You can now see all of the options available to run tests
  6. For example if we want to run all of the tests we can enter the following command:
TestRunner.exe *test* 

7. Look at the instructions to see which other options are available to run specific tests

How to build MSIs from the sources

To produce your own MSI for redistributing the SDK, follow these instructions.

  1. You will need these two tools before you begin:
  2. To build all flavors of the SDK {Debug, Release} x {Win32, x64, arm}, you can use this script as a convenience: build_all.ps1 (right-click and select properties to unblock the script).
  3. From Release\setup directory, do this:
msbuild /p:MSBuildCommunityTasksPath=<path to MSBuild.Community.Tasks directory> /p:WixToolPath=<path to Wix bin directory>\ .\dirs.proj /p:Configuration=Release /p:Platform=Win32 

for example:
msbuild /p:WixToolPath="C:\Program Files (x86)\WiX Toolset v3.7\bin\\" /p:MSBuildCommunityTasksPath="C:\Program Files (x86)\MSBuild\MSBuildCommunityTasks" .\dirs.proj /p:Configuration=Release /p:Platform=Win32 

Notice a couple of quirks that we're still ironing out:
  1. Please note there must be a two trailing slash at the end of the wix tool bin path.
  2. Both wix.targets and wix2010.targets must be in wix tool bin directory (you may need to copy them if that's not the case after the installation). They can be located in "C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x".

Viewing all articles
Browse latest Browse all 4845

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>