Skip to content

Commit

Permalink
2.3.2 release
Browse files Browse the repository at this point in the history
Git support for Smart Diff
plus bug fixes from previous commits
  • Loading branch information
furmangg committed May 3, 2019
1 parent 686e311 commit 7a0d182
Show file tree
Hide file tree
Showing 11 changed files with 365 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Core/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class VersionInfo
{
// BIDS Helper Assembly & VSIX Version
// N.B. Manually update the manifest file, if you change this - See source.extension.vsixmanifest
public const string Version = "2.3.1";
public const string Version = "2.3.2";

private static readonly object lockResource = new object();
private static Version visualStudioVersion;
Expand Down
Binary file added DLLs/SQL2019/Reference/LibGit2Sharp.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Manifest/SQL2017/VSPackageVS2017.resx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<value>BI Developer Extensions for Visual Studio 2017</value>
</data>
<data name="112" xml:space="preserve">
<value>BI Developer Extensions v2.3.1 for Visual Studio 2017 - An add-in to extend SQL Server Data Tools</value>
<value>BI Developer Extensions v2.3.2 for Visual Studio 2017 - An add-in to extend SQL Server Data Tools</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="400" type="System.Resources.ResXFileRef, System.Windows.Forms">
Expand Down
2 changes: 1 addition & 1 deletion Manifest/SQL2017/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="BIDSHelper_VSIX.b6deed2d-6c6f-46d4-94be-28027bf7d873" Version="2.3.1" Language="en-US" Publisher="bideveloperextensions.github.io" />
<Identity Id="BIDSHelper_VSIX.b6deed2d-6c6f-46d4-94be-28027bf7d873" Version="2.3.2" Language="en-US" Publisher="bideveloperextensions.github.io" />
<DisplayName>BI Developer Extensions for Visual Studio 2017</DisplayName>
<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>
<MoreInfo>https://bideveloperextensions.github.io</MoreInfo>
Expand Down
2 changes: 1 addition & 1 deletion Manifest/SQL2019/VSPackageVS2019.resx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<value>BI Developer Extensions for Visual Studio 2019</value>
</data>
<data name="112" xml:space="preserve">
<value>BI Developer Extensions v2.3.0 for Visual Studio 2019 - An add-in to extend SQL Server Data Tools</value>
<value>BI Developer Extensions v2.3.2 for Visual Studio 2019 - An add-in to extend SQL Server Data Tools</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="400" type="System.Resources.ResXFileRef, System.Windows.Forms">
Expand Down
2 changes: 1 addition & 1 deletion Manifest/SQL2019/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="BIDSHelper_VSIX.b6deed2d-6c6f-46d4-94be-28027bf7d874" Version="2.3.1" Language="en-US" Publisher="bideveloperextensions.github.io" />
<Identity Id="BIDSHelper_VSIX.b6deed2d-6c6f-46d4-94be-28027bf7d874" Version="2.3.2" Language="en-US" Publisher="bideveloperextensions.github.io" />
<DisplayName>BI Developer Extensions for Visual Studio 2019</DisplayName>
<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>
<MoreInfo>https://bideveloperextensions.github.io</MoreInfo>
Expand Down
7 changes: 7 additions & 0 deletions SQL2019_VS2017_BidsHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<Compile Include="Core\EditorWindowTag.cs" />
<Compile Include="Core\Enums.cs" />
<Compile Include="Core\FeatureCategory.cs" />
<Compile Include="Core\GitHelper.cs" />
<Compile Include="Core\IWindowActivatedPlugin.cs" />
<Compile Include="Core\Logger\LogLevels.cs" />
<Compile Include="Core\Logger\NullLogger.cs" />
Expand Down Expand Up @@ -525,6 +526,8 @@
<Content Include="DLLs\SQL2017\Reference\Microsoft.ReportViewer.Winforms.AppLocal.dll" />
<Content Include="DLLs\SQL2017\Reference\Microsoft.SqlServer.GridControl.dll" />
<Content Include="DLLs\SQL2019\ExpressionEditor.dll" />
<Content Include="DLLs\SQL2019\Reference\FromASFolder\Microsoft.DataWarehouse.Interfaces.AS.DLL" />
<Content Include="DLLs\SQL2019\Reference\LibGit2Sharp.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.AdomdClient.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.BackEnd.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.Common.FrontEnd.dll" />
Expand Down Expand Up @@ -719,6 +722,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>DLLs\SQL2019\ExpressionEditor.dll</HintPath>
</Reference>
<Reference Include="LibGit2Sharp">
<HintPath>DLLs\SQL2019\Reference\LibGit2Sharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.AnalysisServices, Version=15.17.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>DLLs\SQL2019\Reference\Microsoft.AnalysisServices.dll</HintPath>
<SpecificVersion>True</SpecificVersion>
Expand Down
26 changes: 19 additions & 7 deletions SQL2019_VS2019_BidsHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<Compile Include="Core\EditorWindowTag.cs" />
<Compile Include="Core\Enums.cs" />
<Compile Include="Core\FeatureCategory.cs" />
<Compile Include="Core\GitHelper.cs" />
<Compile Include="Core\IWindowActivatedPlugin.cs" />
<Compile Include="Core\Logger\LogLevels.cs" />
<Compile Include="Core\Logger\NullLogger.cs" />
Expand Down Expand Up @@ -525,6 +526,8 @@
<Content Include="DLLs\SQL2017\Reference\Microsoft.ReportViewer.Winforms.AppLocal.dll" />
<Content Include="DLLs\SQL2017\Reference\Microsoft.SqlServer.GridControl.dll" />
<Content Include="DLLs\SQL2019\ExpressionEditor.dll" />
<Content Include="DLLs\SQL2019\Reference\FromASFolder\Microsoft.DataWarehouse.Interfaces.AS.DLL" />
<Content Include="DLLs\SQL2019\Reference\LibGit2Sharp.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.AdomdClient.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.BackEnd.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.Common.FrontEnd.dll" />
Expand Down Expand Up @@ -719,6 +722,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>DLLs\SQL2019\ExpressionEditor.dll</HintPath>
</Reference>
<Reference Include="LibGit2Sharp">
<HintPath>DLLs\SQL2019\Reference\LibGit2Sharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.AnalysisServices, Version=15.17.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>DLLs\SQL2019\Reference\Microsoft.AnalysisServices.dll</HintPath>
<SpecificVersion>True</SpecificVersion>
Expand All @@ -745,6 +752,17 @@
<Aliases>asAlias</Aliases>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.DataWarehouse.Interfaces, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>DLLs\SQL2019\Reference\Microsoft.DataWarehouse.Interfaces.DLL</HintPath>
<Aliases>sharedDataWarehouseInterfaces</Aliases>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.DataWarehouse.Interfaces.AS, Version=15.2.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>DLLs\SQL2019\Reference\FromASFolder\Microsoft.DataWarehouse.Interfaces.AS.DLL</HintPath>
<SpecificVersion>False</SpecificVersion>
<Aliases>asDataWarehouseInterfaces</Aliases>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.DataWarehouse.RS, Version=15.1.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
<HintPath>DLLs\SQL2019\Reference\Microsoft.DataWarehouse.RS.dll</HintPath>
Expand Down Expand Up @@ -833,7 +851,7 @@
<Reference Include="Microsoft.SqlServer.DlgGrid, Version=15.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
<HintPath>DLLs\SQL2019\Reference\Microsoft.SqlServer.DlgGrid.dll</HintPath>
<Private>False</Private>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.SqlServer.Dts.Design, Version=15.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
Expand Down Expand Up @@ -897,12 +915,6 @@
<HintPath>DLLs\SQL2019\Reference\Microsoft.DataWarehouse.DLL</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.DataWarehouse.Interfaces, Version=15.1.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>DLLs\SQL2019\Reference\Microsoft.DataWarehouse.Interfaces.DLL</HintPath>
<Private>False</Private>
<Aliases>sharedDataWarehouseInterfaces</Aliases>
</Reference>
<Reference Include="Microsoft.DataWarehouse.VsIntegration">
<HintPath>DLLs\SQL2019\Reference\Microsoft.DataWarehouse.VsIntegration.DLL</HintPath>
<Private>False</Private>
Expand Down
14 changes: 7 additions & 7 deletions SSIS/SmartDiff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private void button1_Click(object sender, EventArgs e)
try
{
bContextButton1 = true;
if (!string.IsNullOrEmpty(SourceSafeIniDirectory))
if (!string.IsNullOrEmpty(SourceControlProvider))
this.browseContextMenuStrip1.Show(this, new Point(button1.Left, button1.Bottom));
else
windowsFolderToolStripMenuItem_Click(null, null);
Expand All @@ -50,7 +50,7 @@ private void button2_Click(object sender, EventArgs e)
try
{
bContextButton1 = false;
if (!string.IsNullOrEmpty(SourceSafeIniDirectory))
if (!string.IsNullOrEmpty(SourceControlProvider))
this.browseContextMenuStrip1.Show(this, new Point(button2.Left, button2.Bottom));
else
windowsFolderToolStripMenuItem_Click(null, null);
Expand Down Expand Up @@ -86,12 +86,12 @@ private void sourceSafeFolderToolStripMenuItem_Click(object sender, EventArgs e)
versionForm.Controls.Add(combo);

string sSourceSafePath = (bContextButton1 ? txtCompare.Text : txtTo.Text);
int iVersion = -1;
string sVersion = "";
if (sSourceSafePath.StartsWith("$/"))
{
if (sSourceSafePath.Contains(":"))
{
iVersion = int.Parse(sSourceSafePath.Substring(sSourceSafePath.IndexOf(':') + 1));
sVersion = sSourceSafePath.Substring(sSourceSafePath.IndexOf(':') + 1);
sSourceSafePath = sSourceSafePath.Substring(0, sSourceSafePath.IndexOf(':'));
}
}
Expand All @@ -110,7 +110,7 @@ private void sourceSafeFolderToolStripMenuItem_Click(object sender, EventArgs e)
foreach (string option in SmartDiffPlugin.GetSourceControlVersions(SourceSafeIniDirectory, sSourceSafePath, SourceControlProvider))
{
int i = combo.Items.Add(option);
if (option.StartsWith(iVersion + " "))
if (option.StartsWith(sVersion + " "))
{
combo.SelectedIndex = i;
bFoundVersion = true;
Expand All @@ -135,8 +135,8 @@ private void sourceSafeFolderToolStripMenuItem_Click(object sender, EventArgs e)
string sVersionSuffix = "";
if (combo.SelectedIndex > 0)
{
iVersion = int.Parse(combo.Items[combo.SelectedIndex].ToString().Substring(0, combo.Items[combo.SelectedIndex].ToString().IndexOf(' ')));
sVersionSuffix = ":" + iVersion;
sVersion = combo.Items[combo.SelectedIndex].ToString().Substring(0, combo.Items[combo.SelectedIndex].ToString().IndexOf(' '));
sVersionSuffix = ":" + sVersion;
}

if (bContextButton1)
Expand Down
67 changes: 54 additions & 13 deletions SSIS/SmartDiffPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public override BIDSFeatureCategories FeatureCategory

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

public override void Exec()
{
Expand All @@ -138,6 +139,8 @@ public override void Exec()
}
}



private void ExecInternal()
{
try
Expand Down Expand Up @@ -202,6 +205,23 @@ private void ExecInternal()
}
}
}
else
{
try
{
if (GitHelper.IsPathInGitRepository(projItem.get_FileNames(0)))
{
sSourceControlServerName = GitHelper.GetGitRepositoryPath(projItem.get_FileNames(0));
sDefaultSourceSafePath = "$/" + GitHelper.GetRelativePath(projItem.get_FileNames(0));
sProvider = PROVIDER_NAME_GIT;
}
}
catch (Exception ex)
{
package.Log.Exception("Could not check whether solution is a Git repository", ex);
}

}
}

if (projItem.Document != null && !projItem.Document.Saved)
Expand All @@ -213,7 +233,7 @@ private void ExecInternal()
SSIS.SmartDiff form = new BIDSHelper.SSIS.SmartDiff();
form.SourceControlProvider = sProvider;
form.DefaultWindowsPath = projItem.get_FileNames(0);
if (sProvider == PROVIDER_NAME_SOURCESAFE || sProvider == PROVIDER_NAME_TFS)
if (sProvider == PROVIDER_NAME_SOURCESAFE || sProvider == PROVIDER_NAME_TFS || sProvider == PROVIDER_NAME_GIT)
{
form.DefaultSourceSafePath = sDefaultSourceSafePath;
form.SourceSafeIniDirectory = sSourceControlServerName;
Expand Down Expand Up @@ -266,6 +286,8 @@ private void ExecInternal()
GetSourceSafeFile(sSourceControlServerName, form.txtCompare.Text, sOldFile);
else if (sProvider == PROVIDER_NAME_TFS)
GetTFSFile(sSourceControlServerName, form.txtCompare.Text, sOldFile);
else if (sProvider == PROVIDER_NAME_GIT)
GetGitFile(sSourceControlServerName, form.txtCompare.Text, sOldFile);
sOldFileName += " (server)";
}
else
Expand All @@ -280,6 +302,8 @@ private void ExecInternal()
GetSourceSafeFile(sSourceControlServerName, form.txtTo.Text, sNewFile);
else if (sProvider == PROVIDER_NAME_TFS)
GetTFSFile(sSourceControlServerName, form.txtTo.Text, sNewFile);
else if (sProvider == PROVIDER_NAME_GIT)
GetGitFile(sSourceControlServerName, form.txtTo.Text, sNewFile);
sNewFileName += " (server)";
}
else
Expand Down Expand Up @@ -328,10 +352,29 @@ public static string[] GetSourceControlVersions(string sIniDirectory, string sSo
{
return GetTFSVersions(sIniDirectory, sSourceSafePath);
}
else if (sProvider == PROVIDER_NAME_GIT)
{
return GitHelper.GetHistoryOfFile(sIniDirectory, sSourceSafePath);
}
throw new Exception("Invalid provider");
}


#region Git Access Methods
private static void GetGitFile(string sRepositoryPath, string sGitPath, string sLocalPath)
{
string sha = null;
if (sGitPath.Contains(":"))
{
sha = sGitPath.Substring(sGitPath.IndexOf(':') + 1);
sGitPath = sGitPath.Substring(0, sGitPath.IndexOf(':'));
}

bool bResult = GitHelper.GetSpecificVersionOfFile(sRepositoryPath, sGitPath, sLocalPath, sha);
if (!bResult) throw new Exception("Could not get file from Git");
}
#endregion

#region SourceSafe Access Methods
//allows late-binding so that you don't have to have SourceSafe installed to compile BIDS Helper
private static string VSS_ASSEMBLY_FULL_NAME = "Microsoft.VisualStudio.SourceSafe.Interop, Version=5.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
Expand Down Expand Up @@ -732,16 +775,15 @@ private void ShowDiff(string oldFile, string newFile, bool bIgnoreCase, bool bIg
ProjectItem projItem = (ProjectItem)hierItem.Object;
string sTabName = projItem.Name + " (BIDS Helper Smart Diff)";

System.IServiceProvider provider = null;
if (projItem.ContainingProject is System.IServiceProvider)
{
provider = (System.IServiceProvider)projItem.ContainingProject;
}
else
{
provider = TabularHelpers.GetTabularServiceProviderFromBimFile(hierItem, false);
}
//TODO: test .rdlc inside C# projects
System.IServiceProvider provider = package.ServiceProvider; //works in all project types even C# projects
//if (projItem.ContainingProject is System.IServiceProvider)
//{
// provider = (System.IServiceProvider)projItem.ContainingProject;
//}
//else
//{
// provider = TabularHelpers.GetTabularServiceProviderFromBimFile(hierItem, false);
//}

Type t = vsAssembly.GetType("Microsoft.VisualStudio.Shell.Interop.IVsDifferenceService");
object oVsDifferenceService = provider.GetService(vsAssembly.GetType("Microsoft.VisualStudio.Shell.Interop.SVsDifferenceService"));
Expand Down Expand Up @@ -892,6 +934,5 @@ public static string CustomDiffViewer
}
}
}



}
Loading

0 comments on commit 7a0d182

Please sign in to comment.