Browse files

Support for ReSharper 6.1.1

Bumped version to 0.2. Closes #1
  • Loading branch information...
1 parent a5f75b0 commit f343847796be1fbd2b50ae6fc897dced3fd1f1a8 @citizenmatt citizenmatt committed Nov 7, 2012
View
7 README.md
@@ -1,21 +1,20 @@
# resharper-nuget
-This plugin for ReSharper 7.0.1 adds support for NuGet references to ReSharper.
+This plugin for ReSharper adds support for NuGet references to ReSharper.
Once installed, when ReSharper tries to import a type from an assembly referenced by another project, and that assembly is a NuGet package, then ReSharper will use NuGet to add the reference, correctly updating packages.config, running any .ps1 scripts and installing any required dependencies.
From the end user's perspective, there is no noticeable user interface. When you use a type that lives in an assembly that is not part of the assemblies currently referenced, but is in an assembly referenced by other projects in the solution, ReSharper will mark the type as an error, and display the context action icon when the cursor is on the type name (the red light bulb). Pressing Alt-Enter displays the action "reference 'asm' and use 'Asm.Type'". This plugin hooks into that process. Selecting that action for an assembly referenced as part of a NuGet package will be installed by NuGet.
## Installing
-To install, you can download a pre-built version in the downloads section. Extract the zip file and run the batch file.
+To install, you can download a pre-built version in the downloads section. Extract the zip file and run the appropriate batch file for your version of ReSharper.
## Version
-The current version is 0.1, and should be treated as a beta version. It has been tested with Visual Studio 2012 and supports ReSharper 7.0.1.
+The current version is 0.2, and should be treated as a beta version. It has been tested with Visual Studio 2012 and 2012, and supports ReShaprer 6.1.1, 7.0 and 7.1 (EAP build 22)
## Roadmap
Please see the Issues tab on JetBrains' GitHub page.
-
View
33 install/Install-NuGetSupport.6.1.bat
@@ -0,0 +1,33 @@
+@echo off
+setlocal enableextensions
+
+set VERSION=6.1
+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
@@ -1,6 +1,9 @@
@echo off
setlocal enableextensions
+mkdir NuGetSupport.6.1 2> NUL
+copy /y ..\src\resharper-nuget\bin\Release\*.6.1.* NuGetSupport.6.1\
+
mkdir NuGetSupport.7.0 2> NUL
copy /y ..\src\resharper-nuget\bin\Release\*.7.0.* NuGetSupport.7.0\
View
8 src/resharper-nuget.sln
@@ -1,10 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
+# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "resharper-nuget.7.0", "resharper-nuget\resharper-nuget.7.0.csproj", "{7AF55DF9-33DA-4E50-B6E5-ADE407376D4E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "resharper-nuget.7.1", "resharper-nuget\resharper-nuget.7.1.csproj", "{171609ED-2DB8-4682-9B2E-ACEDD4E6DC2A}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "resharper-nuget.6.1", "resharper-nuget\resharper-nuget.6.1.csproj", "{19452C74-3DF5-4A78-9D7A-2F75776FFB56}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -19,6 +21,10 @@ Global
{171609ED-2DB8-4682-9B2E-ACEDD4E6DC2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{171609ED-2DB8-4682-9B2E-ACEDD4E6DC2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{171609ED-2DB8-4682-9B2E-ACEDD4E6DC2A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {19452C74-3DF5-4A78-9D7A-2F75776FFB56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
5 src/resharper-nuget/NuGetApi.cs
@@ -1,9 +1,8 @@
using System;
+using System.Collections.Generic;
using EnvDTE;
using JetBrains.Application;
-using JetBrains.Application.Progress;
using JetBrains.ProjectModel;
-using JetBrains.ProjectModel.Transaction;
using JetBrains.Threading;
using JetBrains.Util;
using JetBrains.VsIntegration.ProjectModel;
@@ -96,7 +95,7 @@ private bool DoInstallAssemblyAsNuGetPackage(FileSystemPath assemblyLocation, IP
private IVsPackageMetadata GetPackageFromAssemblyLocation(FileSystemPath assemblyLocation)
{
- return vsPackageInstallerServices.GetInstalledPackages().FirstOrDefault(p => assemblyLocation.FullPath.StartsWith(p.InstallPath));
+ return vsPackageInstallerServices.GetInstalledPackages().FirstOrDefault(p => assemblyLocation.FullPath.StartsWith(p.InstallPath, StringComparison.InvariantCultureIgnoreCase));
}
private Project GetVsProject(IProject project)
View
10 src/resharper-nuget/NuGetModuleReferencer.cs
@@ -24,9 +24,10 @@ public bool CanReferenceModule(IPsiModule module, IPsiModule moduleToReference)
return IsNuGetAssembly(moduleToReference);
}
- public bool ReferenceModuleWithType(IPsiModule module, ITypeElement typeToReference)
+ // ReSharper 7.1
+ public virtual bool ReferenceModule(IPsiModule module, IPsiModule moduleToReference)
{
- var assemblyModule = typeToReference.Module as IAssemblyPsiModule;
+ var assemblyModule = moduleToReference as IAssemblyPsiModule;
var projectModule = module as IProjectPsiModule;
if (assemblyModule == null || projectModule == null)
return false;
@@ -46,6 +47,11 @@ public bool ReferenceModuleWithType(IPsiModule module, ITypeElement typeToRefere
return false;
}
+ public bool ReferenceModuleWithType(IPsiModule module, ITypeElement typeToReference)
+ {
+ return ReferenceModule(module, typeToReference.Module);
+ }
+
private bool IsNuGetAssembly(IPsiModule module)
{
var assemblyModule = module as IAssemblyPsiModule;
View
4 src/resharper-nuget/Properties/AssemblyInfo.cs
@@ -13,8 +13,8 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-[assembly: AssemblyVersion("0.1.0.0")]
-[assembly: AssemblyFileVersion("0.1.0.0")]
+[assembly: AssemblyVersion("0.2.0.0")]
+[assembly: AssemblyFileVersion("0.2.0.0")]
// The following information is displayed by ReSharper in the Plugins dialog
[assembly: PluginTitle("NuGet support for ReSharper")]
View
75 src/resharper-nuget/resharper-nuget.6.1.csproj
@@ -0,0 +1,75 @@
+<?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>{19452C74-3DF5-4A78-9D7A-2F75776FFB56}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>JetBrains.ReSharper.Plugins.NuGet</RootNamespace>
+ <AssemblyName>JetBrains.ReSharper.Plugins.NuGet.6.1</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>JET_MODE_ASSERT;DEBUG;TRACE</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</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=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+ <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="System" />
+ <Reference Include="System.ComponentModel.Composition" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Drawing" />
+ <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="NuGetApi.cs" />
+ <Compile Include="NuGetModuleReferencer.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="VsServiceMapExtensions.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <PropertyGroup>
+ <ReSharperSdkTargets Condition=" '$(ReSharperSdkTargets)' == '' ">$(MSBuildExtensionsPath)\JetBrains\ReSharper.SDK\v6.1</ReSharperSdkTargets>
+ </PropertyGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(ReSharperSdkTargets)\Plugin.Targets" />
+ <Import Project="resharper-nuget-debugging.proj" />
+</Project>
View
5 src/resharper-nuget/resharper-nuget.7.0.csproj
@@ -37,10 +37,7 @@
<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>..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.ComponentModelHost.dll</HintPath>
- </Reference>
+ <Reference Include="Microsoft.VisualStudio.ComponentModelHost, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<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">
View
7 src/resharper-nuget/resharper-nuget.7.1.csproj
@@ -37,10 +37,7 @@
<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>..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.ComponentModelHost.dll</HintPath>
- </Reference>
+ <Reference Include="Microsoft.VisualStudio.ComponentModelHost, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<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">
@@ -75,4 +72,4 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(ReSharperSdkTargets)\Plugin.Targets" />
<Import Project="resharper-nuget-debugging.proj" />
-</Project>
+</Project>

0 comments on commit f343847

Please sign in to comment.