Skip to content

Commit

Permalink
Do not install packages with same version from different groups twice -
Browse files Browse the repository at this point in the history
fixes #1458
  • Loading branch information
forki committed Mar 1, 2016
1 parent cebbbee commit d9f1e42
Show file tree
Hide file tree
Showing 12 changed files with 639 additions and 2 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 2.51.4 - 01.03.2016
* BUGFIX: Do not install packages with same version from different groups twice - https://github.com/fsprojects/Paket/issues/1458

#### 2.51.3 - 01.03.2016
* BUGFIX: When adding framework specification to paket.dependencies .props include was moved to the bottom of csproj file - https://github.com/fsprojects/Paket/issues/1487

Expand Down
18 changes: 18 additions & 0 deletions integrationtests/Paket.IntegrationTests/InstallSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,24 @@ let ``#1467 install native package into vcxproj``() =
let s2 = File.ReadAllText newFile |> normalizeLineEndings
s1 |> shouldEqual s2

[<Test>]
let ``#1458 should install non conflicting deps from different groups only once``() =
install "i001458-same-version-group" |> ignore
let newFile = Path.Combine(scenarioTempPath "i001458-same-version-group","MyClassLibrary","MyClassLibrary","MyClassLibrary.csproj")
let oldFile = Path.Combine(originalScenarioPath "i001458-same-version-group","MyClassLibrary","MyClassLibrary","MyClassLibrary.csprojtemplate")
let s1 = File.ReadAllText oldFile |> normalizeLineEndings
let s2 = File.ReadAllText newFile |> normalizeLineEndings
s1 |> shouldEqual s2

[<Test>]
let ``#1458 should not install conflicting deps from different groups``() =
try
install "i001458-group-conflict" |> ignore
failwith "error expected"
with
| exn when exn.Message.Contains "Package Nancy is referenced in different versions" -> ()


[<Test>]
let ``#1442 warn if install finds no libs``() =
let result = paket "install" "i001442-warn-if-empty"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
<?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>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2C1B4A0C-A56A-46C1-B550-598A2B75F50C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DIPS.Infrastructure</RootNamespace>
<AssemblyName>DIPS.Infrastructure</AssemblyName>
<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<TargetFrameworkProfile Condition="'$(TargetFrameworkVersion)' == 'v4.0'">Client</TargetFrameworkProfile>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<PlatformTarget>AnyCPU</PlatformTarget>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors>612, 618</WarningsAsErrors>
<OutputPath>..\..\bin\$(TargetFrameworkVersion)\$(Platform)\$(Configuration)</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<PlatformTarget>AnyCPU</PlatformTarget>
<DefineConstants>TRACE;DEBUG;$(DefineConstants)</DefineConstants>
<Optimize>false</Optimize>
<DebugType>full</DebugType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors>612, 618</WarningsAsErrors>
<OutputPath>..\..\bin\$(TargetFrameworkVersion)\$(Platform)\$(Configuration)</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>False</SignAssembly>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Data" />
</ItemGroup>
<ItemGroup>
<Compile Include="Call.cs" />
<Compile Include="IProfilerStorage.cs" />
<Compile Include="IProfilingExecutor.cs" />
<Compile Include="ProfilingConstants.cs" />
<Compile Include="Profiler.cs">
<ExcludeFromStyleCop>False</ExcludeFromStyleCop>
</Compile>
<Compile Include="IProfiler.cs" />
<Compile Include="ProfilingExecutor.cs" />
<Compile Include="LogicalContextProfilerStorage.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="paket.references" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\manual_reference\DIPS.Infrastructure.Services.csproj">
<Project>{479F0088-3377-4A96-9729-DD1A2B0434E1}</Project>
<Name>DIPS.Infrastructure.Services</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<Import Project="..\..\.paket\paket.targets" />
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
<ItemGroup>
<Reference Include="Nancy">
<HintPath>..\..\packages\hosting\Nancy\lib\net40\Nancy.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
<ItemGroup>
<Reference Include="Nancy.Owin">
<HintPath>..\..\packages\hosting\Nancy.Owin\lib\net40\Nancy.Owin.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
<ItemGroup>
<Reference Include="Owin">
<HintPath>..\..\packages\hosting\Owin\lib\net40\Owin.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v3.5'">
<ItemGroup>
<Reference Include="Castle.Core">
<HintPath>..\..\packages\Castle.Core\lib\net35\Castle.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0')">
<ItemGroup>
<Reference Include="Castle.Core">
<HintPath>..\..\packages\Castle.Core\lib\net40-client\Castle.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
<ItemGroup>
<Reference Include="Castle.Core">
<HintPath>..\..\packages\Castle.Core\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == 'Silverlight' And $(TargetFrameworkVersion) == 'v4.0'">
<ItemGroup>
<Reference Include="Castle.Core">
<HintPath>..\..\packages\Castle.Core\lib\sl4\Castle.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == 'Silverlight' And $(TargetFrameworkVersion) == 'v5.0'">
<ItemGroup>
<Reference Include="Castle.Core">
<HintPath>..\..\packages\Castle.Core\lib\sl5\Castle.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v3.5'">
<ItemGroup>
<Reference Include="Castle.Windsor">
<HintPath>..\..\packages\Castle.Windsor\lib\net35\Castle.Windsor.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
<Reference Include="System.Xml">
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0')">
<ItemGroup>
<Reference Include="Castle.Windsor">
<HintPath>..\..\packages\Castle.Windsor\lib\net40\Castle.Windsor.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
<Reference Include="System.Xml">
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
<ItemGroup>
<Reference Include="Castle.Windsor">
<HintPath>..\..\packages\Castle.Windsor\lib\net45\Castle.Windsor.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
<Reference Include="System.Xml">
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == 'Silverlight' And $(TargetFrameworkVersion) == 'v4.0'">
<ItemGroup>
<Reference Include="Castle.Windsor">
<HintPath>..\..\packages\Castle.Windsor\lib\sl4\Castle.Windsor.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
<Reference Include="System.Windows">
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == 'Silverlight' And $(TargetFrameworkVersion) == 'v5.0'">
<ItemGroup>
<Reference Include="Castle.Windsor">
<HintPath>..\..\packages\Castle.Windsor\lib\sl5\Castle.Windsor.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
<Reference Include="System.Windows">
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
<ItemGroup>
<Reference Include="Nancy.Bootstrappers.Windsor">
<HintPath>..\..\packages\Nancy.Bootstrappers.Windsor\lib\net40\Nancy.Bootstrappers.Windsor.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
<ItemGroup>
<Reference Include="CsQuery">
<HintPath>..\..\packages\test\CsQuery\lib\net40\CsQuery.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
<ItemGroup>
<Reference Include="Nancy.Testing">
<HintPath>..\..\packages\test\Nancy.Testing\lib\net40\Nancy.Testing.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Nancy.Bootstrappers.Windsor

group test
Nancy.Testing

group hosting
Nancy.Owin
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
source https://nuget.org/api/v2
nuget Nancy.Bootstrappers.Windsor

group test
source https://nuget.org/api/v2
nuget Nancy.Testing

group hosting
source https://nuget.org/api/v2
nuget Nancy.Owin
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
NUGET
remote: https://www.nuget.org/api/v2
specs:
Castle.Core (3.3.3)
Castle.Windsor (3.3.0)
Castle.Core (>= 3.3.0)
Nancy (1.4.3)
Nancy.Bootstrappers.Windsor (1.4.1)
Castle.Windsor (>= 3.2.1)
Nancy (>= 1.4.1)

GROUP hosting
NUGET
remote: https://www.nuget.org/api/v2
specs:
Nancy (1.4.3)
Nancy.Owin (1.4.1)
Nancy (>= 1.4.1)
Owin (>= 1.0)
Owin (1.0)

GROUP test
NUGET
remote: https://www.nuget.org/api/v2
specs:
CsQuery (1.3.4)
Nancy (1.4.1)
Nancy.Testing (1.4.1)
CsQuery (>= 1.3.3)
Nancy (>= 1.4.1)
Loading

0 comments on commit d9f1e42

Please sign in to comment.