Skip to content

Commit

Permalink
4.2.4 bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Apr 15, 2016
1 parent fbf6131 commit 8a17825
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 39 deletions.
2 changes: 1 addition & 1 deletion AddinRemoval/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
[assembly: AssemblyCompany("ZeroC, Inc.")]
[assembly: AssemblyProduct("Ice Visual Studio Extension")]
[assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")]
[assembly: AssemblyVersion("4.2.3")]
[assembly: AssemblyVersion("4.2.4")]
[assembly: AssemblyDelaySign(false)]
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Changes in Ice Builder for Visual Studio 4.2.4

- Fixed a bug that could cause a NullReferenceException when removing the
builder from a project.

- Fixed a bug that could cause a System.OverflowException when building a
solution where some projects failed to load.

## Changes in Ice Builder for Visual Studio 4.2.3

- Added support for reading CSharp settings from Ice distribution.
Expand Down
48 changes: 22 additions & 26 deletions IceBuilder/DTEUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,27 @@ public static List<IVsProject> GetProjects()

public static void GetSubProjects(IVsProject p, ref List<IVsProject> projects)
{
GetSubProjects((IVsHierarchy)p, VSConstants.VSITEMID_ROOT, ref projects);
IVsHierarchy h = p as IVsHierarchy;
// Get the first visible child node
object value;
int result = h.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_FirstVisibleChild, out value);
while (ErrorHandler.Succeeded(result))
{
if (value is int && (uint)(int)value == VSConstants.VSITEMID_NIL)
{
// No more nodes
break;
}
else
{
uint child = Convert.ToUInt32(value);
GetSubProjects(h, child, ref projects);

// Get the next visible sibling node
value = null;
result = h.GetProperty(child, (int)__VSHPROPID.VSHPROPID_NextVisibleSibling, out value);
}
}
}

public static void GetSubProjects(IVsHierarchy h, uint itemId, ref List<IVsProject> projects)
Expand All @@ -60,7 +80,7 @@ public static void GetSubProjects(IVsHierarchy h, uint itemId, ref List<IVsProje
uint nestedId = 0;
Guid nestedGuid = typeof(IVsHierarchy).GUID;
int result = h.GetNestedHierarchy(itemId, ref nestedGuid, out nestedValue, out nestedId);
if (ErrorHandler.Succeeded(result) && nestedValue != IntPtr.Zero && nestedId == VSConstants.VSITEMID_ROOT)
if(ErrorHandler.Succeeded(result) && nestedValue != IntPtr.Zero && nestedId == VSConstants.VSITEMID_ROOT)
{
// Get the nested hierachy
IVsProject project = System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(nestedValue) as IVsProject;
Expand All @@ -71,30 +91,6 @@ public static void GetSubProjects(IVsHierarchy h, uint itemId, ref List<IVsProje
GetSubProjects(project, ref projects);
}
}
else
{
// Get the first visible child node
object value;
result = h.GetProperty(itemId, (int)__VSHPROPID.VSHPROPID_FirstVisibleChild, out value);
while (result == VSConstants.S_OK && value != null)
{
if(value is int && (uint)(int)value == VSConstants.VSITEMID_NIL)
{
// No more nodes
break;
}
else
{
uint child = Convert.ToUInt32(value);

GetSubProjects(h, child, ref projects);

// Get the next visible sibling node
value = null;
result = h.GetProperty(child, (int)__VSHPROPID.VSHPROPID_NextVisibleSibling, out value);
}
}
}
}

public static IVsProject GetSelectedProject()
Expand Down
7 changes: 4 additions & 3 deletions IceBuilder/Package.cs
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,7 @@ private void RemoveIceBuilderFromProject(object sender, EventArgs e)
private void RemoveIceBuilderFromProject(IVsProject p)
{
String path = ProjectUtil.GetProjectFullPath(p);
Microsoft.Build.Evaluation.Project project = MSBuildUtils.LoadedProject(path, DTEUtil.IsCppProject(p), true);
MSBuildUtils.RemoveIceBuilderFromProject(project);

foreach (IVsProject p1 in _buildProjects)
{
if(path.Equals(ProjectUtil.GetProjectFullPath(p1)))
Expand All @@ -988,7 +987,6 @@ private void RemoveIceBuilderFromProject(IVsProject p)
}
}


ProjectUtil.DeleteItems(
ProjectUtil.GetGeneratedFiles(p).Aggregate(
new List<String>(),
Expand All @@ -1011,6 +1009,9 @@ private void RemoveIceBuilderFromProject(IVsProject p)
}
});
}

Microsoft.Build.Evaluation.Project project = MSBuildUtils.LoadedProject(path, DTEUtil.IsCppProject(p), true);
MSBuildUtils.RemoveIceBuilderFromProject(project);
ProjectUtil.SaveProject(p);

Guid projectGUID = Guid.Empty;
Expand Down
2 changes: 1 addition & 1 deletion IceBuilder/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
[assembly: AssemblyCompany("ZeroC, Inc.")]
[assembly: AssemblyProduct("Ice Builder")]
[assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")]
[assembly: AssemblyVersion("4.2.3")]
[assembly: AssemblyVersion("4.2.4")]
[assembly: ComVisibleAttribute(false)]
2 changes: 1 addition & 1 deletion IceBuilder/source.extension.vsixmanifest
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="ef9502be-dbc2-4568-a846-02b8e42d04c2" Version="4.2.3" Language="en-US" Publisher="ZeroC" />
<Identity Id="ef9502be-dbc2-4568-a846-02b8e42d04c2" Version="4.2.4" Language="en-US" Publisher="ZeroC" />
<DisplayName>Ice Builder</DisplayName>
<Description xml:space="preserve">Ice Builder manages the compilation of Slice (.ice) files to C++ and C#. It compiles your Slice files with slice2cpp and slice2cs, and allows you to specify the parameters provided to these compilers.</Description>
<MoreInfo>https://github.com/zeroc-ice/ice-builder-visualstudio</MoreInfo>
Expand Down
2 changes: 1 addition & 1 deletion IceBuilderTasks/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
[assembly: AssemblyCompany("ZeroC, Inc.")]
[assembly: AssemblyProduct("Ice Builder")]
[assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")]
[assembly: AssemblyVersion("4.2.3")]
[assembly: AssemblyVersion("4.2.4")]
[assembly: AssemblyDelaySign(false)]
[assembly: ComVisibleAttribute(false)]
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
[assembly: AssemblyCompany("ZeroC, Inc.")]
[assembly: AssemblyProduct("Ice Visual Studio Extension")]
[assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")]
[assembly: AssemblyVersion("4.2.3")]
[assembly: AssemblyVersion("4.2.4")]
[assembly: AssemblyDelaySign(false)]
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
[assembly: AssemblyCompany("ZeroC, Inc.")]
[assembly: AssemblyProduct("Ice Visual Studio Extension")]
[assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")]
[assembly: AssemblyVersion("4.2.3")]
[assembly: AssemblyVersion("4.2.4")]
[assembly: AssemblyDelaySign(false)]
2 changes: 1 addition & 1 deletion IceBuilder_Common/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
[assembly: AssemblyCompany("ZeroC, Inc.")]
[assembly: AssemblyProduct("Ice Builder")]
[assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")]
[assembly: AssemblyVersion("4.2.3")]
[assembly: AssemblyVersion("4.2.4")]
[assembly: ComVisibleAttribute(false)]
2 changes: 1 addition & 1 deletion IceBuilder_VS2012/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
[assembly: AssemblyCompany("ZeroC, Inc.")]
[assembly: AssemblyProduct("Ice Builder")]
[assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")]
[assembly: AssemblyVersion("4.2.3")]
[assembly: AssemblyVersion("4.2.4")]
[assembly: ComVisibleAttribute(false)]
2 changes: 1 addition & 1 deletion IceBuilder_VS2013/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
[assembly: AssemblyCompany("ZeroC, Inc.")]
[assembly: AssemblyProduct("Ice Builder")]
[assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")]
[assembly: AssemblyVersion("4.2.3")]
[assembly: AssemblyVersion("4.2.4")]
[assembly: ComVisibleAttribute(false)]
2 changes: 1 addition & 1 deletion IceBuilder_VS2015/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
[assembly: AssemblyCompany("ZeroC, Inc.")]
[assembly: AssemblyProduct("Ice Builder")]
[assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")]
[assembly: AssemblyVersion("4.2.3")]
[assembly: AssemblyVersion("4.2.4")]
[assembly: ComVisibleAttribute(false)]

0 comments on commit 8a17825

Please sign in to comment.