Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Support for ReSharper 8.0 EAP (fix for #14 and #15) #15

Merged
merged 3 commits into from

3 participants

@thoemmi

No description provided.

@citizenmatt citizenmatt was assigned
@derigel23 derigel23 merged commit 7cb01a4 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 7, 2013
  1. @thoemmi

    added project for Resharper 8.0

    thoemmi authored
    introduced RESHARPER_8 directive for conditional compilation
  2. @thoemmi
  3. @thoemmi
This page is out of date. Refresh to see the latest.
View
33 install/Install-NuGetSupport.8.0.bat
@@ -0,0 +1,33 @@
+@echo off
+setlocal enableextensions
+
+set VERSION=8.0
+set PRODUCT=ReSharper
+set BASEDIR=JetBrains\%PRODUCT%\v%VERSION%
+set PLUGIN=NuGetSupport
+
+set INSTALL_SOURCEDIR=%~dp0\%PLUGIN%.%VERSION%
+
+set PER_USER_PLUGINDIR=%LOCALAPPDATA%\%BASEDIR%\plugins\%PLUGIN%
+
+if exist "%PER_USER_PLUGINDIR%" goto do_clean
+mkdir "%PER_USER_PLUGINDIR%"
+
+:do_clean
+del /q %PER_USER_PLUGINDIR%\*.* 2> NUL
+
+:do_copy
+echo Copying files...
+copy /y "%INSTALL_SOURCEDIR%\*.dll" "%PER_USER_PLUGINDIR%"
+copy /y "%INSTALL_SOURCEDIR%\*.pdb" "%PER_USER_PLUGINDIR%" 2> NUL
+
+echo.
+
+REM See https://github.com/citizenmatt/UnblockZoneIdentifier
+echo Unblocking downloaded files...
+pushd "%PER_USER_PLUGINDIR%"
+for /r %%i in (*) do "%~dp0\UnblockZoneIdentifier" "%%i"
+popd
+
+:end
+pause
View
3  install/Prepare-Release.bat
@@ -6,3 +6,6 @@ copy /y ..\src\resharper-nuget\bin\Release\*.6.1.* NuGetSupport.6.1\
mkdir NuGetSupport.7.1 2> NUL
copy /y ..\src\resharper-nuget\bin\Release\*.7.1.* NuGetSupport.7.1\
+
+mkdir NuGetSupport.8.0 2> NUL
+copy /y ..\src\resharper-nuget\bin\Release\*.8.0.* NuGetSupport.8.0\
View
6 src/resharper-nuget.sln
@@ -5,6 +5,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "resharper-nuget.7.1", "resh
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "resharper-nuget.6.1", "resharper-nuget\resharper-nuget.6.1.csproj", "{19452C74-3DF5-4A78-9D7A-2F75776FFB56}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "resharper-nuget.8.0", "resharper-nuget\resharper-nuget.8.0.csproj", "{46BA1E0D-D8D3-4191-8216-3B1F35DB7733}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -19,6 +21,10 @@ Global
{19452C74-3DF5-4A78-9D7A-2F75776FFB56}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19452C74-3DF5-4A78-9D7A-2F75776FFB56}.Release|Any CPU.ActiveCfg = Release|Any CPU
{19452C74-3DF5-4A78-9D7A-2F75776FFB56}.Release|Any CPU.Build.0 = Release|Any CPU
+ {46BA1E0D-D8D3-4191-8216-3B1F35DB7733}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {46BA1E0D-D8D3-4191-8216-3B1F35DB7733}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {46BA1E0D-D8D3-4191-8216-3B1F35DB7733}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {46BA1E0D-D8D3-4191-8216-3B1F35DB7733}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
4 src/resharper-nuget/ExposeNuGetServices.cs
@@ -22,7 +22,11 @@ namespace JetBrains.ReSharper.Plugins.NuGet
[WrapVsInterfaces]
public class ExposeNuGetServices : IExposeVsServices
{
+#if RESHARPER_8
+ public void Register(VsServiceResolver.VsServiceMap map)
+#else
public void Register(VsServiceProviderComponentContainer.VsServiceMap map)
+#endif
{
if (!map.IsRegistered<IComponentModel>())
map.QueryService<SComponentModel>().As<IComponentModel>();
View
4 src/resharper-nuget/Hacks.cs
@@ -22,7 +22,11 @@
using JetBrains.Application.Progress;
using JetBrains.DataFlow;
using JetBrains.ProjectModel;
+#if RESHARPER_8
+using JetBrains.ReSharper.Psi.Modules;
+#else
using JetBrains.ReSharper.Psi;
+#endif
using JetBrains.TextControl;
using JetBrains.Threading;
using JetBrains.UI.Application;
View
8 src/resharper-nuget/NuGetApi.cs
@@ -23,6 +23,9 @@
using JetBrains.ProjectModel;
using JetBrains.Threading;
using JetBrains.Util;
+#if RESHARPER_8
+using JetBrains.Util.Logging;
+#endif
using JetBrains.VsIntegration.ProjectModel;
using Microsoft.VisualStudio.ComponentModelHost;
using NuGet.VisualStudio;
@@ -35,16 +38,13 @@ namespace JetBrains.ReSharper.Plugins.NuGet
[ShellComponent(ProgramConfigurations.VS_ADDIN)]
public class NuGetApi
{
- private readonly VSSolutionManager vsSolutionManager;
private readonly IThreading threading;
private readonly IVsPackageInstallerServices vsPackageInstallerServices;
private readonly IVsPackageInstaller vsPackageInstaller;
public NuGetApi(IComponentModel componentModel,
- VSSolutionManager vsSolutionManager,
IThreading threading)
{
- this.vsSolutionManager = vsSolutionManager;
this.threading = threading;
try
{
@@ -156,7 +156,7 @@ where l.FullPath.StartsWith(p.InstallPath, StringComparison.InvariantCultureIgno
private Project GetVsProject(IProject project)
{
- var projectModelSynchronizer = vsSolutionManager.GetProjectModelSynchronizer(project.GetSolution());
+ var projectModelSynchronizer = SolutionEx.GetComponent<ProjectModelSynchronizer>(project.GetSolution());
var projectInfo = projectModelSynchronizer.GetProjectInfoByProject(project);
return projectInfo != null ? projectInfo.GetExtProject() : null;
}
View
17 src/resharper-nuget/NuGetModuleReferencer.cs
@@ -19,7 +19,12 @@
using JetBrains.Application.Components;
using JetBrains.ProjectModel.Model2.Assemblies.Interfaces;
using JetBrains.ReSharper.Psi;
+#if RESHARPER_8
+using JetBrains.Metadata.Reader.API;
+using JetBrains.ReSharper.Psi.Modules;
+#else
using JetBrains.ReSharper.Psi.Module;
+#endif
using JetBrains.TextControl;
using JetBrains.Util;
using System.Linq;
@@ -81,6 +86,18 @@ public bool ReferenceModuleWithType(IPsiModule module, ITypeElement typeToRefere
return ReferenceModule(module, typeToReference.Module);
}
+#if RESHARPER_8
+ public bool CanReferenceModule(IPsiModule module, IPsiModule moduleToReference, IModuleReferenceResolveContext context)
+ {
+ return CanReferenceModule(module, moduleToReference);
+ }
+
+ public bool ReferenceModuleWithType(IPsiModule module, ITypeElement typeToReference, IModuleReferenceResolveContext resolveContext)
+ {
+ return ReferenceModule(module, typeToReference.Module);
+ }
+#endif
+
private static bool IsProjectModule(IPsiModule module)
{
return module is IProjectPsiModule;
View
4 src/resharper-nuget/VsServiceMapExtensions.cs
@@ -20,7 +20,11 @@ namespace JetBrains.ReSharper.Plugins.NuGet
{
public static class VsServiceMapExtensions
{
+#if RESHARPER_8
+ public static bool IsRegistered<T>(this VsServiceResolver.VsServiceMap map)
+#else
public static bool IsRegistered<T>(this VsServiceProviderComponentContainer.VsServiceMap map)
+#endif
{
return map.Resolve(typeof (T)) != null;
}
View
89 src/resharper-nuget/resharper-nuget.8.0.csproj
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{46BA1E0D-D8D3-4191-8216-3B1F35DB7733}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>JetBrains.ReSharper.Plugins.NuGet</RootNamespace>
+ <AssemblyName>JetBrains.ReSharper.Plugins.NuGet.8.0</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>TRACE;DEBUG;JET_MODE_ASSERT,RESHARPER_8</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE;RESHARPER_8</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.ComponentModelHost, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\lib\Microsoft.VisualStudio.ComponentModelHost.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference Include="NuGet.VisualStudio">
+ <HintPath>..\..\packages\NuGet.VisualStudio.2.1.0\lib\net40\NuGet.VisualStudio.dll</HintPath>
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ </Reference>
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
+ <Reference Include="System" />
+ <Reference Include="System.ComponentModel.Composition" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Xaml" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ <Reference Include="WindowsBase" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="ExposeNuGetServices.cs" />
+ <Compile Include="Hacks.cs" />
+ <Compile Include="NuGetApi.cs" />
+ <Compile Include="NuGetModuleReferencer.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Updates\PluginLocalEnvironmentInfo.cs" />
+ <Compile Include="Updates\UpdatesNotifier.cs" />
+ <Compile Include="VsServiceMapExtensions.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="..\..\updates.xslt">
+ <Link>updates.xslt</Link>
+ <SubType>Designer</SubType>
+ </Content>
+ </ItemGroup>
+ <PropertyGroup>
+ <ReSharperSdkTargets Condition=" '$(ReSharperSdkTargets)' == '' ">$(MSBuildExtensionsPath)\JetBrains\ReSharper.SDK\v8.0</ReSharperSdkTargets>
+ </PropertyGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(ReSharperSdkTargets)\Plugin.Targets" />
+ <Import Project="resharper-nuget-debugging.proj" />
+</Project>
Something went wrong with that request. Please try again.