Building & Testing NuPattern version 1.3.20.0

Obtaining the Source Code

The source code for the 1.3.20.0 version of NuPattern is obtained by fetching the '1.3.20.0' branch from the codeplex site to your fork. Then switching to that branch. You can do this with the following git bash commands:
git pull origin 1.3.20.0
git checkout 1.3.20.0

Suppressing Strong Name Verification

The source code is Delay-Signed, and Visual Studio will fail to build the source if we don’t instruct it to skip verification for the delay-signed assemblies.
  • Open the 'Visual Studio Command Prompt' (as Administrator), and type:
sn -Vr *,24c7786d4a8b1a88

Note: As a point of process, when a release is cut the code is signed using the private key in an internal process at The Outercurve Foundation. We expect only the core contributors to have to perform this step on agreed release schedules. This step is not required by regular contributors just to contribute code to the project. So no need to worry about it!

Development Tools

Visual Studio Pre-Requisites

This project will build in either Visual Studio 2010 or Visual Studio 2012.
Each build from each version of Visual Studio delivers a release of NuPattern targeted for that version of Visual Studio only.
Note: At this time, you cannot build a version of NuPattern in either version of Visual Studio that targets both versions of Visual Studio.

Visual Studio 2010

To build the code for Visual Studio 2010, you must have the following programs and tools installed on your machine to build, test or run the source code of this project.
  1. Visual Studio 2010 Professional/Premium/Ultimate (SP1 is optional)
  2. Visual Studio 2010 SDK (or Visual Studio 2010 SDK SP1 if you have installed the SP1 of Visual Studio 2010)
  3. Visual Studio 2010 Visualization & Modeling SDK
  4. NuGet Package Manager obtained from the Visual Studio Gallery.
  5. (Optional) Git Source Control extension obtained from the Visual Studio Gallery.

Visual Studio 2012

To build the code for Visual Studio 2012, you must have the following programs and tools installed on your machine to build, test or run the source code of this project.
  1. Visual Studio 2012 Professional/Premium/Ultimate
  2. Visual Studio 2012 SDK
  3. Visual Studio 2012 Visualization & Modeling SDK
  4. NuGet Package Manager obtained from the Visual Studio Gallery.
  5. (Optional) Git Source Control extension obtained from the Visual Studio Gallery.

Other Development Tools

We recommend several other optional tools to install into Visual Studio to aid development of this project: Resharper
Note: Exclusive! Regular committers to the project have been offered a free full license for Resharper. If you are interested, contact the project owner for more details, and become a regular committer to the project.

Building the Solutions

Building on command line

If you just want to quickly build the source code the fastest way, you can use MSBUILD on the command line, or use the handy included batch files to build the code for either version of Visual Studio.
  • Open the folder "Src" folder of your local fork, and double-click on one of the 'make' batch files.
    • If you ONLY have Visual Studio 2010, -> then run the 'Make-VS2010.bat' file.
    • If you ONLY have Visual Studio 2012, -> then run the 'Make-VS2012.bat' file.
    • If you have both Visual Studio 2010 AND Visual Studio 2012, -> then run 'Make-All.bat' file.

The code will compile and build the projects outputs, and a folder will open to show you them built!

Building in Visual Studio

If you prefer to build the solutions in Visual Studio, you will need to open the version of the solution in the version of Visual Studio you are targeting, and then select the appropriate build configuration for the target version of Visual Studio.
For example, If you want to build the VS2010 version of NuPattern, you open Visual Studio 2010, and load the solution specifically for VS2010 (e.g. Runtime.vs2010.sln), then select the 'Debug-VS2010' build configuration in the solution configurations. Clean and Rebuild.

NuPattern has multiple solutions that must be compiled in the correct order, please follow these details instructions.
Depending on the version of Visual Studio (.vs201X) you want to build with:
  1. Build Runtime Solution
    • Open the 'Src\Runtime\Runtime.vs201X.sln' solution in Visual Studio
    • Select the 'Debug-VS201X' solution configuration, and select the 'AnyCPU' platform.
    • Clean, and Rebuild the solution.
    • Run the unit tests or integration tests to verify the build.
  2. Build Authoring Solution
    • Open the 'Src\Authoring\Authoring.vs201X.sln' solution in Visual Studio
    • Select the 'Debug-VS201X' solution configuration, and select the 'AnyCPU' platform.
    • Clean, and Rebuild the solution.
    • Run the units tests or integration tests to verify the build.
  3. Regenerate Guidance|PatternModel Code (optional, see Note 4 below)
    • Close Visual Studio
    • Open the Visual Studio command prompt for the version of VS you are building
    • Run: vsixinstaller.exe "<yourlocalpath>\Src\Binaries\NuPatternToolkitBuilder.1X.0.vsix"
    • Open Visual Studio, and open the 'Src\Runtime\Runtime.vs201X.sln' solution
    • In 'Solution Builder', right-click on the 'Runtime.Shell/Assets/Guidance' node, and select 'Build Guidance'
    • Clean and Rebuild the solution.
    • Open the 'Src\Authoring\Authoring.vs201X.sln' solution
    • In 'Solution Builder', right-click on the 'Authoring.PatternToolkit' node, and select 'Transform Templates'
    • In 'Solution Builder', right-click on the 'Authoring.PatternToolkit/Automation/Library' node, and select 'Transform Templates'
    • In 'Solution Builder', right-click on the 'Authoring.PatternToolkit/Assets/Guidance' node, and select 'Build Guidance'
    • Clean and Rebuild the solution.
    • In 'Extension Manager' uninstall the extensions: 'NuPattern Toolkit Builder', 'NuPattern Toolkit Library', and 'NuPattern Toolkit Manager'.

Note 1: In all cases the 'Runtime.vs201X.sln' needs to be compiled before the 'Authoring.vs201X.sln' because it compiles, installs and places its assemblies in the folders of the 'Experimental Instance' of Visual Studio so that 'Authoring.vs201X.sln' references.
Note 2: There is no need to use the 'Transform Templates' command in Visual Studio on these solutions anymore. These solutions will automatically do their own template transformation when they are re-built, or when those templates are updated. Manually transforming any of the code in the 'GeneratedCode' folder of any DSL projects will cause the wrong code to be generated! Avoid this.
Note 3: Some tests fail the first time they are run in a test run, simply re-run them again.
Note 4: Rebuilding the Guidance for the runtime/authoring/hol toolkits takes several minutes. You need to perform the 'Regenerate Guidance|PatternModel Code' steps only if you have done any of the following:
  • Building the VS2010 targeted version of the code in Visual Studio 2010.
  • Modified content within the guidance documents of 'Runtime .Shell' or 'Authoring.PatternToolkit'.
  • Modified the 'PatternModel.patterndefinition' in 'Authoring.PatternToolkit' or 'Authoring.PatternToolkitLibrary'.
  • Modified the code in the 'InterfaceLayer' text templates in 'Authoring.PatternToolkitLibrary'.
  • Modified any of the VSIX attributes of any of the VSIXes in Runtime or Authoring solutions. Unlikely.

Testing the Build

Running the Unit/Integration Tests

Both 'Runtime.vs201X.sln' and 'Authoring.vs201X.sln' include numerous 'Unit Test', 'Integration Test' and 'User Test' projects that can be run using MSTEST.EXE or other testing frameworks, like Resharper.

Note: Some tests fail the first time they are run in a test run, simply re-run them again to verify.

Smoke Testing the Build

There are a small number of 'User Tests' that perform smoke testing in the Authoring solution. You may run these basic tests.
If you wish to manually verify:
  • Build the source code
  • Open the 'Experimental Instance' of Visual Studio
  • Create a new 'Pattern Toolkit' project
    • Either, open the 'Add New Project' dialog, and create a new 'Pattern Toolkit' project.
    • Or, open the 'Solution Builder' window, click on the 'Create New Empty Solution' hyperlink, and then click on the 'Add New Solution Element' hyperlink, and create a new 'Pattern Toolkit' project.

Last edited Apr 9, 2013 at 2:26 AM by jezzsa, version 20

Comments

No comments yet.