Skip to content

Commit

Permalink
Updated dependencies and fixed some issues while working with C++ pro…
Browse files Browse the repository at this point in the history
…jects
  • Loading branch information
Therena committed Aug 17, 2017
1 parent d06371a commit c82628a
Show file tree
Hide file tree
Showing 12 changed files with 139 additions and 105 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,10 @@ on the official Visual Studio extension gallery.
- [x] Fixed the open output path in conemu for C++ projects
- [x] Read the command line parameter from the projects
- [x] Added the configured command line parameter to the execute in conemu command

## 2.0.0.13

**2017-08-17**

- [x] Updated dependencies
- [x] Fixed some issues while working with C++ projects
55 changes: 32 additions & 23 deletions ConEmuIntegration/ConEmuIntegration.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" />
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props')" />
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down Expand Up @@ -146,7 +146,14 @@
<Reference Include="Microsoft.VisualStudio.CommandBars, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.VisualStudio.Imaging, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.CoreUtility.15.0.26606\lib\net45\Microsoft.VisualStudio.CoreUtility.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Imaging, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Imaging.15.0.26606\lib\net45\Microsoft.VisualStudio.Imaging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
Expand All @@ -158,20 +165,24 @@
<HintPath>..\packages\Microsoft.VisualStudio.Shell.14.0.14.3.25407\lib\Microsoft.VisualStudio.Shell.14.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll</HintPath>
<Reference Include="Microsoft.VisualStudio.Shell.Framework, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Framework.15.0.26606\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Immutable.11.0.11.0.50727\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll</HintPath>
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.15.0.25414\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Immutable.12.0.12.0.21003\lib\net45\Microsoft.VisualStudio.Shell.Immutable.12.0.dll</HintPath>
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.11.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Immutable.11.0.15.0.25414\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Immutable.14.0.14.3.25407\lib\net45\Microsoft.VisualStudio.Shell.Immutable.14.0.dll</HintPath>
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.12.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Immutable.12.0.15.0.25414\lib\net45\Microsoft.VisualStudio.Shell.Immutable.12.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.14.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Immutable.14.0.15.0.25404\lib\net45\Microsoft.VisualStudio.Shell.Immutable.14.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
Expand Down Expand Up @@ -209,17 +220,15 @@
<HintPath>..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Threading, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Threading.15.0.240\lib\net45\Microsoft.VisualStudio.Threading.dll</HintPath>
<Private>True</Private>
<Reference Include="Microsoft.VisualStudio.Threading, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Threading.15.3.83\lib\net45\Microsoft.VisualStudio.Threading.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.Utilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Utilities.15.0.26201\lib\net45\Microsoft.VisualStudio.Utilities.dll</HintPath>
<HintPath>..\packages\Microsoft.VisualStudio.Utilities.15.0.26607\lib\net46\Microsoft.VisualStudio.Utilities.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Validation, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Validation.15.0.82\lib\net45\Microsoft.VisualStudio.Validation.dll</HintPath>
<Private>True</Private>
<Reference Include="Microsoft.VisualStudio.Validation, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Validation.15.3.23\lib\net45\Microsoft.VisualStudio.Validation.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
Expand Down Expand Up @@ -285,16 +294,16 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="..\packages\ConEmu.Core.16.12.6.0\build\ConEmu.Core.Targets" Condition="Exists('..\packages\ConEmu.Core.16.12.6.0\build\ConEmu.Core.Targets')" />
<Import Project="..\packages\ConEmu.Core.17.8.7.0\Build\ConEmu.Core.Targets" Condition="Exists('..\packages\ConEmu.Core.17.8.7.0\Build\ConEmu.Core.Targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\ConEmu.Core.17.3.16.0\build\ConEmu.Core.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ConEmu.Core.17.3.16.0\build\ConEmu.Core.Targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets'))" />
<Error Condition="!Exists('..\packages\ConEmu.Core.17.8.7.0\Build\ConEmu.Core.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ConEmu.Core.17.8.7.0\Build\ConEmu.Core.Targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets'))" />
</Target>
<Import Project="..\packages\ConEmu.Core.17.3.16.0\build\ConEmu.Core.Targets" Condition="Exists('..\packages\ConEmu.Core.17.3.16.0\build\ConEmu.Core.Targets')" />
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets')" />
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
70 changes: 68 additions & 2 deletions ConEmuIntegration/ConEmuProduct/ProductEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,26 @@
//
using ConEmu.WinForms;
using ConEmuIntegration.Settings;
using ConEmuIntegration.ToolWindow;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Xml;

namespace ConEmuIntegration.ConEmuProduct
{
internal class ProductEnvironment
{
private List<string> m_TempFiles;
private List<string> m_SearchPaths;
private List<string> m_StoredGUIMacros;

public Package Package { get; set; }
public ConEmuWindowPackage Package { get; set; }
public ConEmuControl ConEmu { get; set; }

private static ProductEnvironment m_Instance = new ProductEnvironment();
Expand All @@ -43,6 +49,7 @@ public static ProductEnvironment Instance
private ProductEnvironment()
{
m_TempFiles = new List<string>();
m_StoredGUIMacros = new List<string>();

m_SearchPaths = new List<string>();
m_SearchPaths.Add(Directory.GetCurrentDirectory());
Expand All @@ -57,6 +64,65 @@ private ProductEnvironment()
}
}

public void OpenConEmuToolWindow()
{
if(this.Package == null || this.Package.Zombied)
{
return;
}

try
{
if (CheckConEmuAndDisplay() == false)
{
return;
}

ToolWindowPane window = this.Package.FindToolWindow(typeof(ConEmuWindow), 0, true);
if ((null == window) || (null == window.Frame))
{
throw new NotSupportedException("Cannot create tool window");
}

IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;
Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
}
catch (Exception error)
{
ExceptionMessageBox box = new ExceptionMessageBox();
box.SetException(error);
box.ShowDialog();
}
}

public void ConEmuToolWindowLoaded()
{
foreach (var macro in m_StoredGUIMacros)
{
ExecuteGuiMacro(macro);
}
m_StoredGUIMacros.Clear();
}

public void ExecuteGuiMacro(string macro)
{
if (ProductEnvironment.Instance.ConEmu == null)
{
OpenConEmuToolWindow();
m_StoredGUIMacros.Add(macro);
return;
}

if (ProductEnvironment.Instance.ConEmu.IsConsoleEmulatorOpen == false)
{
OpenConEmuToolWindow();
m_StoredGUIMacros.Add(macro);
return;
}

ProductEnvironment.Instance.ConEmu.RunningSession.ExecuteGuiMacroTextSync(macro);
}

public bool CheckConEmu()
{
var conemu = GetConEmuExecutable();
Expand All @@ -73,7 +139,7 @@ public bool CheckConEmuAndDisplay()
bool result = CheckConEmu();
if (result == false)
{
var caption = Instance.GetWindowCaption();
var caption = GetWindowCaption();

var conemu = GetConEmuExecutable();
ExceptionMessageBox box = new ExceptionMessageBox();
Expand Down
8 changes: 6 additions & 2 deletions ConEmuIntegration/Helper/StartProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,16 @@ public FileInfo GetExecutable(Project project)
}
}

if(PropertyHelper.HasProperty(prop, "DebugSettings"))
if (PropertyHelper.HasProperty(prop, "DebugSettings"))
{
var debugProps = prop.Item("DebugSettings").Value as Properties;
if (PropertyHelper.HasProperty(debugProps, "Command"))
{
return new FileInfo(debugProps.Item("Command").Value.ToString());
var file = new FileInfo(debugProps.Item("Command").Value.ToString());
if(file.Exists)
{
return file;
}
}
}

Expand Down
23 changes: 3 additions & 20 deletions ConEmuIntegration/SolutionExplorer/ExecuteInConEmu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,12 @@ private void RunExecutable(Project project)
var cd = ProductEnvironment.Instance.UseNormalChangeDirectory();
if (cd)
{
ExecuteGuiMacro("Print(@\"Invoke-Item " + command + "\",\"\n\")");
ProductEnvironment.Instance.ExecuteGuiMacro("Print(@\"Invoke-Item " + command + "\",\"\n\")");
}
else
{
ExecuteGuiMacro("Print(@\"" + command + "\",\"\n\")");
ProductEnvironment.Instance.ExecuteGuiMacro("Print(@\"" + command + "\",\"\n\")");
}
DisplayConEmu();
}

public void ExecuteGuiMacro(string macro)
{
if (ProductEnvironment.Instance.ConEmu.IsConsoleEmulatorOpen == false)
{
return;
}
ProductEnvironment.Instance.ConEmu.RunningSession.ExecuteGuiMacroTextSync(macro);
}

public void DisplayConEmu()
Expand All @@ -169,14 +159,7 @@ public void DisplayConEmu()
return;
}

ToolWindowPane window = this.package.FindToolWindow(typeof(ConEmuWindow), 0, true);
if ((null == window) || (null == window.Frame))
{
throw new NotSupportedException("Cannot create tool window");
}

IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;
Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
ProductEnvironment.Instance.OpenConEmuToolWindow();
}
}
}
3 changes: 0 additions & 3 deletions ConEmuIntegration/SolutionExplorer/OpenConEmuHere.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@

namespace ConEmuIntegration.SolutionExplorer
{
/// <summary>
/// Command handler
/// </summary>
internal sealed class OpenConEmuHere
{
public const int CommandId = 256;
Expand Down
11 changes: 4 additions & 7 deletions ConEmuIntegration/SolutionExplorer/OpenInConEmu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,14 @@ private bool FolderOfProjectItem(SelectedItem selectedItem)
var cd = ProductEnvironment.Instance.UseNormalChangeDirectory();
if (cd)
{
ExecuteInConEmu.Instance.ExecuteGuiMacro("Print(@\"cd \"\"" +
ProductEnvironment.Instance.ExecuteGuiMacro("Print(@\"cd \"\"" +
fullPath.Directory.FullName.Replace("\"", "\"\"") + "\"\"\",\"\n\")");
}
else
{
ExecuteInConEmu.Instance.ExecuteGuiMacro("Print(@\"cd /d \"\"" +
ProductEnvironment.Instance.ExecuteGuiMacro("Print(@\"cd /d \"\"" +
fullPath.Directory.FullName.Replace("\"", "\"\"") + "\"\"\",\"\n\")");
}
ExecuteInConEmu.Instance.DisplayConEmu();

return true;
}

Expand All @@ -114,15 +112,14 @@ private bool FolderOfProject(SelectedItem selectedItem, string property)
var cd = ProductEnvironment.Instance.UseNormalChangeDirectory();
if (cd)
{
ExecuteInConEmu.Instance.ExecuteGuiMacro("Print(@\"cd \"\"" +
ProductEnvironment.Instance.ExecuteGuiMacro("Print(@\"cd \"\"" +
fullPath.Directory.FullName.Replace("\"", "\"\"") + "\"\"\",\"\n\")");
}
else
{
ExecuteInConEmu.Instance.ExecuteGuiMacro("Print(@\"cd /d \"\"" +
ProductEnvironment.Instance.ExecuteGuiMacro("Print(@\"cd /d \"\"" +
fullPath.Directory.FullName.Replace("\"", "\"\"") + "\"\"\",\"\n\")");
}
ExecuteInConEmu.Instance.DisplayConEmu();
return true;
}
return false;
Expand Down
Loading

0 comments on commit c82628a

Please sign in to comment.