Skip to content

Commit

Permalink
Fix self referencing loop detected with 2010 template export #16
Browse files Browse the repository at this point in the history
  • Loading branch information
mikefourie committed Apr 28, 2015
1 parent 21f149f commit 1e80354
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 59 deletions.
6 changes: 3 additions & 3 deletions Manager/Common/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
using System.Resources;
using System.Runtime.InteropServices;

[assembly: AssemblyVersion("2.12.0.19")]
[assembly: AssemblyFileVersion("2.12.0.19")]
[assembly: AssemblyInformationalVersion("2.12.0.19")]
[assembly: AssemblyVersion("2.12.0.20")]
[assembly: AssemblyFileVersion("2.12.0.20")]
[assembly: AssemblyInformationalVersion("2.12.0.20")]
[assembly: AssemblyCompany("Community TFS Build Manager https://github.com/tfsbuildextensions/BuildManager")]
[assembly: AssemblyCopyright("Copyright © Community TFS Build Manager https://github.com/tfsbuildextensions/BuildManager")]
[assembly: AssemblyTrademark("Community TFS Build Manager https://github.com/tfsbuildextensions/BuildManager")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="284BD365-D4C4-4208-B839-FB3E41B7B270" Version="2.12.0.19" Language="en-US" Publisher="github.com/tfsbuildextensions" />
<Identity Id="284BD365-D4C4-4208-B839-FB3E41B7B270" Version="2.12.0.20" Language="en-US" Publisher="github.com/tfsbuildextensions" />
<DisplayName>Community TFS Build Manager VS2013</DisplayName>
<Description xml:space="preserve">Community TFS Build Manager VS2013. Sourcecode is available in GitHub - https://github.com/tfsbuildextensions/BuildManager</Description>
<MoreInfo>http://visualstudiogallery.msdn.microsoft.com/73bf2d8e-aec6-406c-8e7f-1c678e46557f</MoreInfo>
Expand Down
64 changes: 9 additions & 55 deletions Manager/TFSBuildManager.Views/ViewModels/BuildManagerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,13 @@ public static void ExportDefinition(BuildDefinitionViewModel b, string filePath)
}
}

File.WriteAllText(Path.Combine(filePath, b.Name + ".json"), JsonConvert.SerializeObject(buildToExport, Formatting.Indented));
var jsonSerializerSettings = new JsonSerializerSettings
{
PreserveReferencesHandling = PreserveReferencesHandling.Objects,
ReferenceLoopHandling = ReferenceLoopHandling.Serialize
};

File.WriteAllText(Path.Combine(filePath, b.Name + ".json"), JsonConvert.SerializeObject(buildToExport, Formatting.Indented, jsonSerializerSettings));
}

public void OnCleanDrops()
Expand Down Expand Up @@ -1049,61 +1055,9 @@ public void AssignBuilds(IEnumerable<IQueuedBuild> queuedBuilds)
{
try
{
////PerformanceCounterCategory[] array = PerformanceCounterCategory.GetCategories();
////PerformanceCounter[] myCounters = null;
////foreach (PerformanceCounterCategory t in array)
////{
//// if (t.CategoryName.Equals(".NET CLR Networking 4.0.0.0"))
//// {
//// System.Diagnostics.Debug.WriteLine(".NET CLR Networking 4.0.0.0 instances:" + string.Join(", ", t.GetInstanceNames()));
//// string myInstance = t.GetInstanceNames()
//// .FirstOrDefault(
//// x =>
//// x.StartsWith(
//// AppDomain.CurrentDomain.FriendlyName.ToLower() + "_p"
//// + Process.GetCurrentProcess().Id.ToString(CultureInfo.InvariantCulture),
//// StringComparison.OrdinalIgnoreCase));
//// if (myInstance != null)
//// {
//// myCounters = t.GetCounters(myInstance);
//// }
//// }
////}

////////var c = new PerformanceCounter(".NET CLR Networking 4.0.0.0", "Bytes Received", myInstance, true);
////CounterSample s = new CounterSample();
////PerformanceCounter c = null;
////if (myCounters != null)
////{
//// c = myCounters.First(x => x.CounterName.Equals("Bytes Received"));
//// s = c.NextSample();
//// System.Diagnostics.Debug.WriteLine(
//// "{0}. Name={1} Type={2}",
//// c.CategoryName,
//// c.CounterName,
//// c.CounterType);
//// System.Diagnostics.Debug.WriteLine("+++++++++++");
//// System.Diagnostics.Debug.WriteLine("Sample values -");
//// System.Diagnostics.Debug.WriteLine(" BaseValue = " + s.BaseValue);
//// System.Diagnostics.Debug.WriteLine(" CounterFrequency = " + s.CounterFrequency);
//// System.Diagnostics.Debug.WriteLine(" CounterTimeStamp = " + s.CounterTimeStamp);
//// System.Diagnostics.Debug.WriteLine(" CounterType = " + s.CounterType);
//// System.Diagnostics.Debug.WriteLine(" RawValue = " + s.RawValue);
//// System.Diagnostics.Debug.WriteLine(" SystemFrequency = " + s.SystemFrequency);
//// System.Diagnostics.Debug.WriteLine(" TimeStamp = " + s.TimeStamp);
//// System.Diagnostics.Debug.WriteLine(" TimeStamp100nSec = " + s.TimeStamp100nSec);
////}

////System.Diagnostics.Debug.WriteLine("++++++++++++++++++++++");

this.Builds.Clear();
foreach (var b in queuedBuilds.Where(b => b != null).Select(b => new BuildViewModel(b)))
{
////if (c != null)
////{
//// System.Diagnostics.Debug.WriteLine(" RawValue {0} = {1} {2} {3}", b.BuildDefinition, c.RawValue - s.RawValue, c.RawValue, b.QueuedBuildDetail.Status);
////}

this.Builds.Add(b);
}
}
Expand Down Expand Up @@ -1298,7 +1252,7 @@ private void OnCloneBuilds()
{
this.repository.CloneBuild(item.Uri, dlg.NewBuildDefinitionName, branchObject, dlg.SelectedTargetBranch);
}
else if (res.HasValue && !res.Value)
else if (res.HasValue)
{
break;
}
Expand Down Expand Up @@ -1378,7 +1332,7 @@ private void OnCloneBuildToProject()

this.OnRefresh(new EventArgs());
}
else if (res.HasValue && !res.Value)
else if (res.HasValue)
{
break;
}
Expand Down

0 comments on commit 1e80354

Please sign in to comment.