Skip to content

Commit 7a0d182

Browse files
author
furmangg
committed
2.3.2 release
Git support for Smart Diff plus bug fixes from previous commits
1 parent 686e311 commit 7a0d182

11 files changed

Lines changed: 365 additions & 32 deletions

Core/VersionInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class VersionInfo
99
{
1010
// BIDS Helper Assembly & VSIX Version
1111
// N.B. Manually update the manifest file, if you change this - See source.extension.vsixmanifest
12-
public const string Version = "2.3.1";
12+
public const string Version = "2.3.2";
1313

1414
private static readonly object lockResource = new object();
1515
private static Version visualStudioVersion;
435 KB
Binary file not shown.

Manifest/SQL2017/VSPackageVS2017.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<value>BI Developer Extensions for Visual Studio 2017</value>
122122
</data>
123123
<data name="112" xml:space="preserve">
124-
<value>BI Developer Extensions v2.3.1 for Visual Studio 2017 - An add-in to extend SQL Server Data Tools</value>
124+
<value>BI Developer Extensions v2.3.2 for Visual Studio 2017 - An add-in to extend SQL Server Data Tools</value>
125125
</data>
126126
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
127127
<data name="400" type="System.Resources.ResXFileRef, System.Windows.Forms">

Manifest/SQL2017/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<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">
33
<Metadata>
4-
<Identity Id="BIDSHelper_VSIX.b6deed2d-6c6f-46d4-94be-28027bf7d873" Version="2.3.1" Language="en-US" Publisher="bideveloperextensions.github.io" />
4+
<Identity Id="BIDSHelper_VSIX.b6deed2d-6c6f-46d4-94be-28027bf7d873" Version="2.3.2" Language="en-US" Publisher="bideveloperextensions.github.io" />
55
<DisplayName>BI Developer Extensions for Visual Studio 2017</DisplayName>
66
<Description xml:space="preserve">BI Developer Extensions (formerly BIDS Helper) is an extension for BIDS / SSDT that includes numerous enhancements for SQL Server BI projects</Description>
77
<MoreInfo>https://bideveloperextensions.github.io</MoreInfo>

Manifest/SQL2019/VSPackageVS2019.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<value>BI Developer Extensions for Visual Studio 2019</value>
122122
</data>
123123
<data name="112" xml:space="preserve">
124-
<value>BI Developer Extensions v2.3.0 for Visual Studio 2019 - An add-in to extend SQL Server Data Tools</value>
124+
<value>BI Developer Extensions v2.3.2 for Visual Studio 2019 - An add-in to extend SQL Server Data Tools</value>
125125
</data>
126126
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
127127
<data name="400" type="System.Resources.ResXFileRef, System.Windows.Forms">

Manifest/SQL2019/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<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">
33
<Metadata>
4-
<Identity Id="BIDSHelper_VSIX.b6deed2d-6c6f-46d4-94be-28027bf7d874" Version="2.3.1" Language="en-US" Publisher="bideveloperextensions.github.io" />
4+
<Identity Id="BIDSHelper_VSIX.b6deed2d-6c6f-46d4-94be-28027bf7d874" Version="2.3.2" Language="en-US" Publisher="bideveloperextensions.github.io" />
55
<DisplayName>BI Developer Extensions for Visual Studio 2019</DisplayName>
66
<Description xml:space="preserve">BI Developer Extensions (formerly BIDS Helper) is an extension for BIDS / SSDT that includes numerous enhancements for SQL Server BI projects</Description>
77
<MoreInfo>https://bideveloperextensions.github.io</MoreInfo>

SQL2019_VS2017_BidsHelper.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
<Compile Include="Core\EditorWindowTag.cs" />
104104
<Compile Include="Core\Enums.cs" />
105105
<Compile Include="Core\FeatureCategory.cs" />
106+
<Compile Include="Core\GitHelper.cs" />
106107
<Compile Include="Core\IWindowActivatedPlugin.cs" />
107108
<Compile Include="Core\Logger\LogLevels.cs" />
108109
<Compile Include="Core\Logger\NullLogger.cs" />
@@ -525,6 +526,8 @@
525526
<Content Include="DLLs\SQL2017\Reference\Microsoft.ReportViewer.Winforms.AppLocal.dll" />
526527
<Content Include="DLLs\SQL2017\Reference\Microsoft.SqlServer.GridControl.dll" />
527528
<Content Include="DLLs\SQL2019\ExpressionEditor.dll" />
529+
<Content Include="DLLs\SQL2019\Reference\FromASFolder\Microsoft.DataWarehouse.Interfaces.AS.DLL" />
530+
<Content Include="DLLs\SQL2019\Reference\LibGit2Sharp.dll" />
528531
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.AdomdClient.dll" />
529532
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.BackEnd.dll" />
530533
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.Common.FrontEnd.dll" />
@@ -719,6 +722,10 @@
719722
<SpecificVersion>False</SpecificVersion>
720723
<HintPath>DLLs\SQL2019\ExpressionEditor.dll</HintPath>
721724
</Reference>
725+
<Reference Include="LibGit2Sharp">
726+
<HintPath>DLLs\SQL2019\Reference\LibGit2Sharp.dll</HintPath>
727+
<Private>False</Private>
728+
</Reference>
722729
<Reference Include="Microsoft.AnalysisServices, Version=15.17.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
723730
<HintPath>DLLs\SQL2019\Reference\Microsoft.AnalysisServices.dll</HintPath>
724731
<SpecificVersion>True</SpecificVersion>

SQL2019_VS2019_BidsHelper.csproj

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
<Compile Include="Core\EditorWindowTag.cs" />
104104
<Compile Include="Core\Enums.cs" />
105105
<Compile Include="Core\FeatureCategory.cs" />
106+
<Compile Include="Core\GitHelper.cs" />
106107
<Compile Include="Core\IWindowActivatedPlugin.cs" />
107108
<Compile Include="Core\Logger\LogLevels.cs" />
108109
<Compile Include="Core\Logger\NullLogger.cs" />
@@ -525,6 +526,8 @@
525526
<Content Include="DLLs\SQL2017\Reference\Microsoft.ReportViewer.Winforms.AppLocal.dll" />
526527
<Content Include="DLLs\SQL2017\Reference\Microsoft.SqlServer.GridControl.dll" />
527528
<Content Include="DLLs\SQL2019\ExpressionEditor.dll" />
529+
<Content Include="DLLs\SQL2019\Reference\FromASFolder\Microsoft.DataWarehouse.Interfaces.AS.DLL" />
530+
<Content Include="DLLs\SQL2019\Reference\LibGit2Sharp.dll" />
528531
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.AdomdClient.dll" />
529532
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.BackEnd.dll" />
530533
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.Common.FrontEnd.dll" />
@@ -719,6 +722,10 @@
719722
<SpecificVersion>False</SpecificVersion>
720723
<HintPath>DLLs\SQL2019\ExpressionEditor.dll</HintPath>
721724
</Reference>
725+
<Reference Include="LibGit2Sharp">
726+
<HintPath>DLLs\SQL2019\Reference\LibGit2Sharp.dll</HintPath>
727+
<Private>False</Private>
728+
</Reference>
722729
<Reference Include="Microsoft.AnalysisServices, Version=15.17.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
723730
<HintPath>DLLs\SQL2019\Reference\Microsoft.AnalysisServices.dll</HintPath>
724731
<SpecificVersion>True</SpecificVersion>
@@ -745,6 +752,17 @@
745752
<Aliases>asAlias</Aliases>
746753
<Private>False</Private>
747754
</Reference>
755+
<Reference Include="Microsoft.DataWarehouse.Interfaces, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
756+
<HintPath>DLLs\SQL2019\Reference\Microsoft.DataWarehouse.Interfaces.DLL</HintPath>
757+
<Aliases>sharedDataWarehouseInterfaces</Aliases>
758+
<Private>False</Private>
759+
</Reference>
760+
<Reference Include="Microsoft.DataWarehouse.Interfaces.AS, Version=15.2.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
761+
<HintPath>DLLs\SQL2019\Reference\FromASFolder\Microsoft.DataWarehouse.Interfaces.AS.DLL</HintPath>
762+
<SpecificVersion>False</SpecificVersion>
763+
<Aliases>asDataWarehouseInterfaces</Aliases>
764+
<Private>False</Private>
765+
</Reference>
748766
<Reference Include="Microsoft.DataWarehouse.RS, Version=15.1.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
749767
<SpecificVersion>True</SpecificVersion>
750768
<HintPath>DLLs\SQL2019\Reference\Microsoft.DataWarehouse.RS.dll</HintPath>
@@ -833,7 +851,7 @@
833851
<Reference Include="Microsoft.SqlServer.DlgGrid, Version=15.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
834852
<SpecificVersion>True</SpecificVersion>
835853
<HintPath>DLLs\SQL2019\Reference\Microsoft.SqlServer.DlgGrid.dll</HintPath>
836-
<Private>False</Private>
854+
<Private>True</Private>
837855
</Reference>
838856
<Reference Include="Microsoft.SqlServer.Dts.Design, Version=15.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
839857
<SpecificVersion>True</SpecificVersion>
@@ -897,12 +915,6 @@
897915
<HintPath>DLLs\SQL2019\Reference\Microsoft.DataWarehouse.DLL</HintPath>
898916
<Private>False</Private>
899917
</Reference>
900-
<Reference Include="Microsoft.DataWarehouse.Interfaces, Version=15.1.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
901-
<SpecificVersion>False</SpecificVersion>
902-
<HintPath>DLLs\SQL2019\Reference\Microsoft.DataWarehouse.Interfaces.DLL</HintPath>
903-
<Private>False</Private>
904-
<Aliases>sharedDataWarehouseInterfaces</Aliases>
905-
</Reference>
906918
<Reference Include="Microsoft.DataWarehouse.VsIntegration">
907919
<HintPath>DLLs\SQL2019\Reference\Microsoft.DataWarehouse.VsIntegration.DLL</HintPath>
908920
<Private>False</Private>

SSIS/SmartDiff.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private void button1_Click(object sender, EventArgs e)
3434
try
3535
{
3636
bContextButton1 = true;
37-
if (!string.IsNullOrEmpty(SourceSafeIniDirectory))
37+
if (!string.IsNullOrEmpty(SourceControlProvider))
3838
this.browseContextMenuStrip1.Show(this, new Point(button1.Left, button1.Bottom));
3939
else
4040
windowsFolderToolStripMenuItem_Click(null, null);
@@ -50,7 +50,7 @@ private void button2_Click(object sender, EventArgs e)
5050
try
5151
{
5252
bContextButton1 = false;
53-
if (!string.IsNullOrEmpty(SourceSafeIniDirectory))
53+
if (!string.IsNullOrEmpty(SourceControlProvider))
5454
this.browseContextMenuStrip1.Show(this, new Point(button2.Left, button2.Bottom));
5555
else
5656
windowsFolderToolStripMenuItem_Click(null, null);
@@ -86,12 +86,12 @@ private void sourceSafeFolderToolStripMenuItem_Click(object sender, EventArgs e)
8686
versionForm.Controls.Add(combo);
8787

8888
string sSourceSafePath = (bContextButton1 ? txtCompare.Text : txtTo.Text);
89-
int iVersion = -1;
89+
string sVersion = "";
9090
if (sSourceSafePath.StartsWith("$/"))
9191
{
9292
if (sSourceSafePath.Contains(":"))
9393
{
94-
iVersion = int.Parse(sSourceSafePath.Substring(sSourceSafePath.IndexOf(':') + 1));
94+
sVersion = sSourceSafePath.Substring(sSourceSafePath.IndexOf(':') + 1);
9595
sSourceSafePath = sSourceSafePath.Substring(0, sSourceSafePath.IndexOf(':'));
9696
}
9797
}
@@ -110,7 +110,7 @@ private void sourceSafeFolderToolStripMenuItem_Click(object sender, EventArgs e)
110110
foreach (string option in SmartDiffPlugin.GetSourceControlVersions(SourceSafeIniDirectory, sSourceSafePath, SourceControlProvider))
111111
{
112112
int i = combo.Items.Add(option);
113-
if (option.StartsWith(iVersion + " "))
113+
if (option.StartsWith(sVersion + " "))
114114
{
115115
combo.SelectedIndex = i;
116116
bFoundVersion = true;
@@ -135,8 +135,8 @@ private void sourceSafeFolderToolStripMenuItem_Click(object sender, EventArgs e)
135135
string sVersionSuffix = "";
136136
if (combo.SelectedIndex > 0)
137137
{
138-
iVersion = int.Parse(combo.Items[combo.SelectedIndex].ToString().Substring(0, combo.Items[combo.SelectedIndex].ToString().IndexOf(' ')));
139-
sVersionSuffix = ":" + iVersion;
138+
sVersion = combo.Items[combo.SelectedIndex].ToString().Substring(0, combo.Items[combo.SelectedIndex].ToString().IndexOf(' '));
139+
sVersionSuffix = ":" + sVersion;
140140
}
141141

142142
if (bContextButton1)

SSIS/SmartDiffPlugin.cs

Lines changed: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public override BIDSFeatureCategories FeatureCategory
117117

118118
public static string PROVIDER_NAME_SOURCESAFE = "MSSCCI:Microsoft Visual SourceSafe";
119119
public static string PROVIDER_NAME_TFS = "{4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}";
120+
public static string PROVIDER_NAME_GIT = "Git"; //made up this provider name for integration with the previous flow
120121

121122
public override void Exec()
122123
{
@@ -138,6 +139,8 @@ public override void Exec()
138139
}
139140
}
140141

142+
143+
141144
private void ExecInternal()
142145
{
143146
try
@@ -202,6 +205,23 @@ private void ExecInternal()
202205
}
203206
}
204207
}
208+
else
209+
{
210+
try
211+
{
212+
if (GitHelper.IsPathInGitRepository(projItem.get_FileNames(0)))
213+
{
214+
sSourceControlServerName = GitHelper.GetGitRepositoryPath(projItem.get_FileNames(0));
215+
sDefaultSourceSafePath = "$/" + GitHelper.GetRelativePath(projItem.get_FileNames(0));
216+
sProvider = PROVIDER_NAME_GIT;
217+
}
218+
}
219+
catch (Exception ex)
220+
{
221+
package.Log.Exception("Could not check whether solution is a Git repository", ex);
222+
}
223+
224+
}
205225
}
206226

207227
if (projItem.Document != null && !projItem.Document.Saved)
@@ -213,7 +233,7 @@ private void ExecInternal()
213233
SSIS.SmartDiff form = new BIDSHelper.SSIS.SmartDiff();
214234
form.SourceControlProvider = sProvider;
215235
form.DefaultWindowsPath = projItem.get_FileNames(0);
216-
if (sProvider == PROVIDER_NAME_SOURCESAFE || sProvider == PROVIDER_NAME_TFS)
236+
if (sProvider == PROVIDER_NAME_SOURCESAFE || sProvider == PROVIDER_NAME_TFS || sProvider == PROVIDER_NAME_GIT)
217237
{
218238
form.DefaultSourceSafePath = sDefaultSourceSafePath;
219239
form.SourceSafeIniDirectory = sSourceControlServerName;
@@ -266,6 +286,8 @@ private void ExecInternal()
266286
GetSourceSafeFile(sSourceControlServerName, form.txtCompare.Text, sOldFile);
267287
else if (sProvider == PROVIDER_NAME_TFS)
268288
GetTFSFile(sSourceControlServerName, form.txtCompare.Text, sOldFile);
289+
else if (sProvider == PROVIDER_NAME_GIT)
290+
GetGitFile(sSourceControlServerName, form.txtCompare.Text, sOldFile);
269291
sOldFileName += " (server)";
270292
}
271293
else
@@ -280,6 +302,8 @@ private void ExecInternal()
280302
GetSourceSafeFile(sSourceControlServerName, form.txtTo.Text, sNewFile);
281303
else if (sProvider == PROVIDER_NAME_TFS)
282304
GetTFSFile(sSourceControlServerName, form.txtTo.Text, sNewFile);
305+
else if (sProvider == PROVIDER_NAME_GIT)
306+
GetGitFile(sSourceControlServerName, form.txtTo.Text, sNewFile);
283307
sNewFileName += " (server)";
284308
}
285309
else
@@ -328,10 +352,29 @@ public static string[] GetSourceControlVersions(string sIniDirectory, string sSo
328352
{
329353
return GetTFSVersions(sIniDirectory, sSourceSafePath);
330354
}
355+
else if (sProvider == PROVIDER_NAME_GIT)
356+
{
357+
return GitHelper.GetHistoryOfFile(sIniDirectory, sSourceSafePath);
358+
}
331359
throw new Exception("Invalid provider");
332360
}
333361

334362

363+
#region Git Access Methods
364+
private static void GetGitFile(string sRepositoryPath, string sGitPath, string sLocalPath)
365+
{
366+
string sha = null;
367+
if (sGitPath.Contains(":"))
368+
{
369+
sha = sGitPath.Substring(sGitPath.IndexOf(':') + 1);
370+
sGitPath = sGitPath.Substring(0, sGitPath.IndexOf(':'));
371+
}
372+
373+
bool bResult = GitHelper.GetSpecificVersionOfFile(sRepositoryPath, sGitPath, sLocalPath, sha);
374+
if (!bResult) throw new Exception("Could not get file from Git");
375+
}
376+
#endregion
377+
335378
#region SourceSafe Access Methods
336379
//allows late-binding so that you don't have to have SourceSafe installed to compile BIDS Helper
337380
private static string VSS_ASSEMBLY_FULL_NAME = "Microsoft.VisualStudio.SourceSafe.Interop, Version=5.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
@@ -732,16 +775,15 @@ private void ShowDiff(string oldFile, string newFile, bool bIgnoreCase, bool bIg
732775
ProjectItem projItem = (ProjectItem)hierItem.Object;
733776
string sTabName = projItem.Name + " (BIDS Helper Smart Diff)";
734777

735-
System.IServiceProvider provider = null;
736-
if (projItem.ContainingProject is System.IServiceProvider)
737-
{
738-
provider = (System.IServiceProvider)projItem.ContainingProject;
739-
}
740-
else
741-
{
742-
provider = TabularHelpers.GetTabularServiceProviderFromBimFile(hierItem, false);
743-
}
744-
//TODO: test .rdlc inside C# projects
778+
System.IServiceProvider provider = package.ServiceProvider; //works in all project types even C# projects
779+
//if (projItem.ContainingProject is System.IServiceProvider)
780+
//{
781+
// provider = (System.IServiceProvider)projItem.ContainingProject;
782+
//}
783+
//else
784+
//{
785+
// provider = TabularHelpers.GetTabularServiceProviderFromBimFile(hierItem, false);
786+
//}
745787

746788
Type t = vsAssembly.GetType("Microsoft.VisualStudio.Shell.Interop.IVsDifferenceService");
747789
object oVsDifferenceService = provider.GetService(vsAssembly.GetType("Microsoft.VisualStudio.Shell.Interop.SVsDifferenceService"));
@@ -892,6 +934,5 @@ public static string CustomDiffViewer
892934
}
893935
}
894936
}
895-
896-
937+
897938
}

0 commit comments

Comments
 (0)