Skip to content

Commit 6d5711b

Browse files
committed
init commit
1 parent f114e06 commit 6d5711b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+7016
-1
lines changed

BuildProcessTemplates/DefaultTemplate.xaml

Lines changed: 602 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<Activity mc:Ignorable="sad" x:Class="TfsBuild.Process" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mtbc="clr-namespace:Microsoft.TeamFoundation.Build.Client;assembly=Microsoft.TeamFoundation.Build.Client" xmlns:mtbw="clr-namespace:Microsoft.TeamFoundation.Build.Workflow;assembly=Microsoft.TeamFoundation.Build.Workflow" xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow" xmlns:mtbwt="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Tracking;assembly=Microsoft.TeamFoundation.Build.Workflow" xmlns:mtvc="clr-namespace:Microsoft.TeamFoundation.VersionControl.Client;assembly=Microsoft.TeamFoundation.VersionControl.Client" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:sad="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:sad1="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:this="clr-namespace:TfsBuild;" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
2+
<x:Members>
3+
<x:Property Name="ConfigurationFolderPath" Type="InArgument(x:String)" />
4+
<x:Property Name="AgentSettings" Type="InArgument(mtbwa:AgentSettings)" />
5+
<x:Property Name="MSBuildArguments" Type="InArgument(x:String)" />
6+
<x:Property Name="MSBuildPlatform" Type="InArgument(mtbwa:ToolPlatform)" />
7+
<x:Property Name="DoNotDownloadBuildType" Type="InArgument(x:Boolean)" />
8+
<x:Property Name="LogFilePerProject" Type="InArgument(x:Boolean)" />
9+
<x:Property Name="SourcesSubdirectory" Type="InArgument(x:String)" />
10+
<x:Property Name="BinariesSubdirectory" Type="InArgument(x:String)" />
11+
<x:Property Name="TestResultsSubdirectory" Type="InArgument(x:String)" />
12+
<x:Property Name="RecursionType" Type="InArgument(mtvc:RecursionType)" />
13+
<x:Property Name="Verbosity" Type="InArgument(mtbw:BuildVerbosity)" />
14+
<x:Property Name="Metadata" Type="mtbw:ProcessParameterMetadataCollection" />
15+
<x:Property Name="SupportedReasons" Type="mtbc:BuildReason" />
16+
</x:Members>
17+
<this:Process.ConfigurationFolderPath>
18+
<InArgument x:TypeArguments="x:String" />
19+
</this:Process.ConfigurationFolderPath>
20+
<this:Process.AgentSettings>[New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .TagComparison = Microsoft.TeamFoundation.Build.Workflow.Activities.TagComparison.MatchExactly }]</this:Process.AgentSettings>
21+
<this:Process.MSBuildArguments>
22+
<InArgument x:TypeArguments="x:String" />
23+
</this:Process.MSBuildArguments>
24+
<this:Process.MSBuildPlatform>[Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.Auto]</this:Process.MSBuildPlatform>
25+
<this:Process.DoNotDownloadBuildType>[False]</this:Process.DoNotDownloadBuildType>
26+
<this:Process.LogFilePerProject>[False]</this:Process.LogFilePerProject>
27+
<this:Process.SourcesSubdirectory>
28+
<InArgument x:TypeArguments="x:String" />
29+
</this:Process.SourcesSubdirectory>
30+
<this:Process.BinariesSubdirectory>
31+
<InArgument x:TypeArguments="x:String" />
32+
</this:Process.BinariesSubdirectory>
33+
<this:Process.TestResultsSubdirectory>
34+
<InArgument x:TypeArguments="x:String" />
35+
</this:Process.TestResultsSubdirectory>
36+
<this:Process.RecursionType>[Microsoft.TeamFoundation.VersionControl.Client.RecursionType.OneLevel]</this:Process.RecursionType>
37+
<this:Process.Verbosity>[Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal]</this:Process.Verbosity>
38+
<this:Process.Metadata>
39+
<mtbw:ProcessParameterMetadataCollection />
40+
</this:Process.Metadata>
41+
<this:Process.SupportedReasons>All</this:Process.SupportedReasons>
42+
<mva:VisualBasic.Settings>Assembly references and imported namespaces serialized as XML namespaces</mva:VisualBasic.Settings>
43+
<Sequence mtbwt:BuildTrackingParticipant.Importance="None">
44+
<Sequence.Variables>
45+
<Variable x:TypeArguments="mtbc:IBuildDetail" Name="BuildDetail" />
46+
</Sequence.Variables>
47+
<mtbwa:GetBuildDetail DisplayName="Get the Build" Result="[BuildDetail]" />
48+
<mtbwa:InvokeForReason DisplayName="Update Build Number for Triggered Builds" Reason="Triggered">
49+
<mtbwa:UpdateBuildNumber BuildNumberFormat="[&quot;$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)&quot;]" DisplayName="Update Build Number" />
50+
</mtbwa:InvokeForReason>
51+
<mtbwa:AgentScope DisplayName="Run On Agent" MaxExecutionTime="[AgentSettings.MaxExecutionTime]" MaxWaitTime="[AgentSettings.MaxWaitTime]" ReservationSpec="[AgentSettings.GetAgentReservationSpec()]">
52+
<mtbwa:AgentScope.Variables>
53+
<Variable x:TypeArguments="x:String" Name="buildDirectory" />
54+
</mtbwa:AgentScope.Variables>
55+
<mtbwa:GetBuildDirectory DisplayName="Get the Build Directory" Result="[buildDirectory]" />
56+
<If Condition="[Not String.IsNullOrEmpty(ConfigurationFolderPath)]" DisplayName="If Not String.IsNullOrEmpty(ConfigurationFolderPath)">
57+
<If.Then>
58+
<mtbwa:TfsBuild BinariesSubdirectory="[BinariesSubdirectory]" BuildDirectory="[buildDirectory]" CommandLineArguments="[MSBuildArguments]" ConfigurationFolderPath="[ConfigurationFolderPath]" DisplayName="Run TfsBuild for Configuration Folder" DoNotDownloadBuildType="[DoNotDownloadBuildType]" LogFilePerProject="[LogFilePerProject]" RecursionType="[RecursionType]" SourcesSubdirectory="[SourcesSubdirectory]" TestResultsSubdirectory="[TestResultsSubdirectory]" ToolPlatform="[MSBuildPlatform]" Verbosity="[Verbosity]" />
59+
</If.Then>
60+
</If>
61+
<If Condition="[BuildDetail.CompilationStatus = Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Unknown]" DisplayName="If CompilationStatus = Unknown">
62+
<If.Then>
63+
<mtbwa:SetBuildProperties CompilationStatus="[Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Succeeded]" DisplayName="Set CompilationStatus to Succeeded" PropertiesToSet="CompilationStatus" />
64+
</If.Then>
65+
</If>
66+
<If Condition="[BuildDetail.TestStatus = Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Unknown]" DisplayName="If TestStatus = Unknown">
67+
<If.Then>
68+
<mtbwa:SetBuildProperties DisplayName="Set TestStatus to Succeeded" PropertiesToSet="TestStatus" TestStatus="[Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Succeeded]" />
69+
</If.Then>
70+
</If>
71+
</mtbwa:AgentScope>
72+
<mtbwa:InvokeForReason Reason="CheckInShelveset">
73+
<mtbwa:CheckInGatedChanges DisplayName="Check In Gated Changes" />
74+
</mtbwa:InvokeForReason>
75+
</Sequence>
76+
</Activity>

Fiddler/FiddlerJsonViewer.csproj

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>9.0.30729</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{4B6A26FA-0D44-4354-92E7-54FC5A75469B}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>EPocalipse.Json.Fiddler</RootNamespace>
12+
<AssemblyName>FiddlerJsonViewer</AssemblyName>
13+
<SccProjectName>SAK</SccProjectName>
14+
<SccLocalPath>SAK</SccLocalPath>
15+
<SccAuxPath>SAK</SccAuxPath>
16+
<SccProvider>SAK</SccProvider>
17+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
18+
<FileUpgradeFlags>
19+
</FileUpgradeFlags>
20+
<UpgradeBackupLocation>
21+
</UpgradeBackupLocation>
22+
<OldToolsVersion>3.5</OldToolsVersion>
23+
<TargetFrameworkProfile />
24+
<PublishUrl>publish\</PublishUrl>
25+
<Install>true</Install>
26+
<InstallFrom>Disk</InstallFrom>
27+
<UpdateEnabled>false</UpdateEnabled>
28+
<UpdateMode>Foreground</UpdateMode>
29+
<UpdateInterval>7</UpdateInterval>
30+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
31+
<UpdatePeriodically>false</UpdatePeriodically>
32+
<UpdateRequired>false</UpdateRequired>
33+
<MapFileExtensions>true</MapFileExtensions>
34+
<ApplicationRevision>0</ApplicationRevision>
35+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
36+
<IsWebBootstrapper>false</IsWebBootstrapper>
37+
<UseApplicationTrust>false</UseApplicationTrust>
38+
<BootstrapperEnabled>true</BootstrapperEnabled>
39+
</PropertyGroup>
40+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
41+
<DebugSymbols>true</DebugSymbols>
42+
<DebugType>full</DebugType>
43+
<Optimize>false</Optimize>
44+
<OutputPath>bin\debug\</OutputPath>
45+
<DefineConstants>DEBUG;TRACE</DefineConstants>
46+
<ErrorReport>prompt</ErrorReport>
47+
<WarningLevel>4</WarningLevel>
48+
<Prefer32Bit>false</Prefer32Bit>
49+
</PropertyGroup>
50+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
51+
<DebugType>pdbonly</DebugType>
52+
<Optimize>true</Optimize>
53+
<OutputPath>..\Bin\Fiddler\</OutputPath>
54+
<DefineConstants>TRACE</DefineConstants>
55+
<ErrorReport>prompt</ErrorReport>
56+
<WarningLevel>4</WarningLevel>
57+
<Prefer32Bit>false</Prefer32Bit>
58+
</PropertyGroup>
59+
<ItemGroup>
60+
<Reference Include="Fiddler, Version=2.1.0.2, Culture=neutral, processorArchitecture=x86">
61+
<SpecificVersion>False</SpecificVersion>
62+
<HintPath>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fiddler2@InstallPath)\Fiddler.exe</HintPath>
63+
<Private>False</Private>
64+
</Reference>
65+
<Reference Include="System" />
66+
<Reference Include="System.Data" />
67+
<Reference Include="System.Drawing" />
68+
<Reference Include="System.Windows.Forms" />
69+
<Reference Include="System.Xml" />
70+
</ItemGroup>
71+
<ItemGroup>
72+
<Compile Include="JsonInspectorBase.cs" />
73+
<Compile Include="JsonRequestInspector.cs" />
74+
<Compile Include="JsonResponseInspector.cs" />
75+
<Compile Include="Properties\AssemblyInfo.cs" />
76+
</ItemGroup>
77+
<ItemGroup>
78+
<ProjectReference Include="..\JsonViewer\JsonViewer.csproj">
79+
<Project>{3AE264FB-52DC-4295-A37F-CE63CAF54930}</Project>
80+
<Name>JsonViewer</Name>
81+
</ProjectReference>
82+
</ItemGroup>
83+
<ItemGroup>
84+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
85+
<Visible>False</Visible>
86+
<ProductName>.NET Framework 3.5 SP1</ProductName>
87+
<Install>true</Install>
88+
</BootstrapperPackage>
89+
</ItemGroup>
90+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
91+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
92+
Other similar extension points exist, see Microsoft.Common.targets.
93+
<Target Name="BeforeBuild">
94+
</Target>
95+
<Target Name="AfterBuild">
96+
</Target>
97+
-->
98+
</Project>

Fiddler/JsonInspectorBase.cs

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using System.Windows.Forms;
5+
using System.IO;
6+
using EPocalipse.Json.Viewer;
7+
using Fiddler;
8+
using System.Drawing;
9+
10+
namespace EPocalipse.Json.Fiddler
11+
{
12+
13+
14+
15+
16+
public abstract class JsonInspectorBase : Inspector2
17+
{
18+
protected HTTPHeaders _headers;
19+
private byte[] _body;
20+
private JsonViewer viewer;
21+
22+
public override void AddToTab(TabPage tabPage)
23+
{
24+
viewer = new JsonViewer();
25+
tabPage.Text = "JSON";
26+
tabPage.Controls.Add(viewer);
27+
viewer.Dock = DockStyle.Fill;
28+
}
29+
30+
public override void ShowAboutBox()
31+
{
32+
MessageBox.Show("Json Inspector 1.1\nCopyright (c) 2007 Eyal Post\nhttp://www.epocalipse.com/blog", "Json Viewer", MessageBoxButtons.OK, MessageBoxIcon.Information);
33+
}
34+
35+
public override int ScoreForContentType(string sMIMEType)
36+
{
37+
if (string.Compare(sMIMEType, "text/json", true) == 0)
38+
{
39+
return 50;
40+
}
41+
return 0;
42+
}
43+
44+
public override int GetOrder()
45+
{
46+
return 0;
47+
}
48+
49+
public void Clear()
50+
{
51+
_body = null;
52+
viewer.Clear();
53+
}
54+
55+
public bool bDirty
56+
{
57+
get
58+
{
59+
return false;
60+
}
61+
}
62+
63+
public bool bReadOnly
64+
{
65+
get
66+
{
67+
return false;
68+
}
69+
set
70+
{
71+
//_readOnly = value;
72+
}
73+
}
74+
75+
public byte[] body
76+
{
77+
get
78+
{
79+
return _body;
80+
}
81+
set
82+
{
83+
_body = value;
84+
string json=Encoding.UTF8.GetString(_body);
85+
bool encoded = _headers.Exists("Transfer-Encoding") || _headers.Exists("Content-Encoding");
86+
if (_headers.ExistsAndEquals("Transfer-Encoding", "chunked"))
87+
{
88+
//response in chuncked but still may contain the entire json string. Try to fix it.
89+
json = json.Trim();
90+
int startPos = json.IndexOf('\n');
91+
int endPos = json.LastIndexOf('\r');
92+
if (startPos >= 0 && endPos >= 0 && startPos != endPos)
93+
{
94+
json = json.Substring(startPos, endPos - startPos + 1);
95+
json = json.Trim();
96+
}
97+
}
98+
viewer.ShowTab(Tabs.Viewer);
99+
viewer.Json = json;
100+
if (viewer.HasErrors && encoded)
101+
{
102+
viewer.ShowInfo("Error parsing JSON. Try using the Transformer to remove the encoding from this response");
103+
}
104+
}
105+
}
106+
107+
public override void SetFontSize(float flSizeInPoints)
108+
{
109+
viewer.Font = new Font(viewer.Font.FontFamily, flSizeInPoints, FontStyle.Regular, GraphicsUnit.Point);
110+
}
111+
}
112+
}

Fiddler/JsonRequestInspector.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using System.Windows.Forms;
5+
using System.IO;
6+
using EPocalipse.Json.Viewer;
7+
using Fiddler;
8+
using System.Drawing;
9+
10+
namespace EPocalipse.Json.Fiddler
11+
{
12+
public sealed class JsonRequestInspector: JsonInspectorBase, IRequestInspector2
13+
{
14+
public HTTPRequestHeaders headers
15+
{
16+
get
17+
{
18+
return null;
19+
}
20+
set
21+
{
22+
_headers = value;
23+
}
24+
}
25+
}
26+
}

Fiddler/JsonResponseInspector.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using System.Windows.Forms;
5+
using System.IO;
6+
using EPocalipse.Json.Viewer;
7+
using Fiddler;
8+
using System.Drawing;
9+
10+
namespace EPocalipse.Json.Fiddler
11+
{
12+
public sealed class JsonResponseInspector: JsonInspectorBase, IResponseInspector2
13+
{
14+
public HTTPResponseHeaders headers
15+
{
16+
get
17+
{
18+
return null;
19+
}
20+
set
21+
{
22+
_headers = value;
23+
}
24+
}
25+
}
26+
}

Fiddler/Properties/AssemblyInfo.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
using Fiddler;
5+
6+
// General Information about an assembly is controlled through the following
7+
// set of attributes. Change these attribute values to modify the information
8+
// associated with an assembly.
9+
[assembly: AssemblyTitle("JsonViewer")]
10+
[assembly: AssemblyDescription("")]
11+
[assembly: AssemblyConfiguration("")]
12+
[assembly: AssemblyCompany("Clarizen")]
13+
[assembly: AssemblyProduct("JsonViewer")]
14+
[assembly: AssemblyCopyright("Copyright © Clarizen 2007")]
15+
[assembly: AssemblyTrademark("")]
16+
[assembly: AssemblyCulture("")]
17+
18+
// Setting ComVisible to false makes the types in this assembly not visible
19+
// to COM components. If you need to access a type in this assembly from
20+
// COM, set the ComVisible attribute to true on that type.
21+
[assembly: ComVisible(false)]
22+
23+
// The following GUID is for the ID of the typelib if this project is exposed to COM
24+
[assembly: Guid("356e16cc-67ca-4802-aa4c-abd97d623a72")]
25+
26+
// Version information for an assembly consists of the following four values:
27+
//
28+
// Major Version
29+
// Minor Version
30+
// Build Number
31+
// Revision
32+
//
33+
// You can specify all the values or you can default the Revision and Build Numbers
34+
// by using the '*' as shown below:
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
37+
[assembly: RequiredVersion("2.1.0.0")]

0 commit comments

Comments
 (0)