How to setup your UWP project with Jenkins

Follow these steps to automatically pull your UWP project via Git using Jenkins:

  1. Install Jenkins
  2. In Jenkins (usually http://localhost:8080/ ), create a new item and select Freestyle Project
  3. Once created, in the projects configuration page scroll down to build and click on Add build step -> Execute Windows batch command
  4. Enter the following:
    call “C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat”
    msbuild C:\projects\sample\sample.jsproj /t:Clean;Rebuild /p:Configuration=Release
  5. Notes:
    1. The first line is assuming you installed VS 2015 in the default folder.
    2. If you want to compile the whole solution just target the .sln instead of the project in the second line
    3. If you want to target a specific platform, just add “;Platform=x86” (without quotes) in the second line
  6. Click Save
  7. You should be able to run the project by clicking Build now

Jenkins comes with support for source control systems such as CVS or SVN (Subversion). If you want/need Git support you’ll need to install a plugin. Here are the steps add Git integration:

  1. Go to Manage Jenkins
  2. Click on Manage Plugins
  3. Click on Available and search for Git
  4. Install the GitHub plugin
  5. After installing go to Manage Jenkins and click on Configure System
  6. Scroll down until you see Git / Git Installations
  7. Enter your path to Git executable, could be something like: c:\program files (x86)\git\bin\git.exe
  8. Save your changes
  9. Go to your project configuration
  10. Scroll down until you see Source Code Management and select Git.
  11. Enter the repository URL
  12. Add your credentials
  13. Enter branch to build if necessary
  14. Scroll down to Build section and change the msbuild line to
    msbuild sample\sample.jsproj /t:Clean;Rebuild /p:Configuration=Release
  15. Notes:
    1. This is needed so that Jenkins uses the project downloaded from Git
    2. The folder where Jenkins does this work is in: C:\Program Files (x86)\Jenkins\jobs\[project name]\workspace

Every time you click build it will pull the code from Git and make a build.

Bookmark the permalink.

2 Responses to How to setup your UWP project with Jenkins

  1. Sam says:

    Doesn’t Work!!

Leave a Reply

Your email address will not be published. Required fields are marked *