Skip to content

Commit

Permalink
fix for #1848
Browse files Browse the repository at this point in the history
  • Loading branch information
Lysogorskiy Aleksey authored and Lysogorskiy Aleksey committed Sep 11, 2017
1 parent 30ea4ce commit 9e3f9c7
Show file tree
Hide file tree
Showing 67 changed files with 1,370 additions and 61 deletions.
114 changes: 114 additions & 0 deletions integrationtests/Paket.IntegrationTests/PackSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,120 @@ let ``#1816 pack localized when satellite dll is missing`` () =

CleanDir rootPath

[<Test>]
let ``#1848 single template without include-referenced-projects`` () =
let scenario = "i001848-pack-single-template-wo-incl-flag"
let rootPath = scenarioTempPath scenario
let outPath = Path.Combine(rootPath, "out")
let templatePath = Path.Combine(rootPath, "projectA", "paket.template")
paket ("pack --template " + templatePath + " \"" + outPath + "\"") scenario |> ignore

NuGetLocal.getDetailsFromLocalNuGetPackage false None outPath "" (PackageName "projectA") (SemVer.Parse "1.0.0.0")
|> Async.RunSynchronously
|> ODataSearchResult.get
|> getDependencies
|> shouldBeEmpty

ZipFile.ExtractToDirectory(Path.Combine(outPath, "projectA.1.0.0.0.nupkg"), outPath)
Path.Combine(outPath, "lib", "net45", "projectB.dll") |> checkFileExists

CleanDir rootPath

[<Test>]
let ``#1848 single template with include-referenced-projects`` () =
let scenario = "i001848-pack-single-template-with-incl-flag"
let rootPath = scenarioTempPath scenario
let outPath = Path.Combine(rootPath, "out")
let templatePath = Path.Combine(rootPath, "projectA", "paket.template")
paket ("pack --include-referenced-projects --template " + templatePath + " \"" + outPath + "\"") scenario |> ignore

NuGetLocal.getDetailsFromLocalNuGetPackage false None outPath "" (PackageName "projectA") (SemVer.Parse "1.0.0.0")
|> Async.RunSynchronously
|> ODataSearchResult.get
|> getDependencies
|> List.tryFind (fun (name,version,_) -> name = PackageName "projectB" && version = VersionRequirement.Parse "1.0.0.0")
|> shouldNotEqual None

ZipFile.ExtractToDirectory(Path.Combine(outPath, "projectA.1.0.0.0.nupkg"), outPath)
let expectedFile = Path.Combine(outPath, "lib", "net45", "projectB.dll")

File.Exists expectedFile |> shouldEqual false

CleanDir rootPath

[<Test>]
let ``#1848 all templates without include-referenced-projects`` () =
let scenario = "i001848-pack-all-templates-wo-incl-flag"
let rootPath = scenarioTempPath scenario
let outPath = Path.Combine(rootPath, "out")
paket ("pack \"" + outPath + "\"") scenario |> ignore

NuGetLocal.getDetailsFromLocalNuGetPackage false None outPath "" (PackageName "projectA") (SemVer.Parse "1.0.0.0")
|> Async.RunSynchronously
|> ODataSearchResult.get
|> getDependencies
|> List.tryFind (fun (name,version,_) -> name = PackageName "projectB" && version = VersionRequirement.Parse "1.0.0.0")
|> shouldNotEqual None

NuGetLocal.getDetailsFromLocalNuGetPackage false None outPath "" (PackageName "projectB") (SemVer.Parse "1.0.0.0")
|> Async.RunSynchronously
|> ODataSearchResult.get
|> getDependencies
|> List.tryFind (fun (name,version,_) -> name = PackageName "nunit" && version = VersionRequirement.Parse "[3.8.1]")
|> shouldNotEqual None

ZipFile.ExtractToDirectory(Path.Combine(outPath, "projectA.1.0.0.0.nupkg"), outPath)
let expectedFile = Path.Combine(outPath, "lib", "net45", "projectB.dll")
File.Exists expectedFile |> shouldEqual false

CleanDir rootPath

[<Test>]
let ``#1848 all templates with include-referenced-projects`` () =
let scenario = "i001848-pack-all-templates-with-incl-flag"
let rootPath = scenarioTempPath scenario
let outPath = Path.Combine(rootPath, "out")
paket ("pack --include-referenced-projects \"" + outPath + "\"") scenario |> ignore

NuGetLocal.getDetailsFromLocalNuGetPackage false None outPath "" (PackageName "projectA") (SemVer.Parse "1.0.0.0")
|> Async.RunSynchronously
|> ODataSearchResult.get
|> getDependencies
|> List.tryFind (fun (name,version,_) -> name = PackageName "projectB" && version = VersionRequirement.Parse "1.0.0.0")
|> shouldNotEqual None

NuGetLocal.getDetailsFromLocalNuGetPackage false None outPath "" (PackageName "projectB") (SemVer.Parse "1.0.0.0")
|> Async.RunSynchronously
|> ODataSearchResult.get
|> getDependencies
|> List.tryFind (fun (name,version,_) -> name = PackageName "nunit" && version = VersionRequirement.Parse "[3.8.1]")
|> shouldNotEqual None

ZipFile.ExtractToDirectory(Path.Combine(outPath, "projectA.1.0.0.0.nupkg"), outPath)
let expectedFile = Path.Combine(outPath, "lib", "net45", "projectB.dll")
File.Exists expectedFile |> shouldEqual false

CleanDir rootPath

[<Test>]
let ``#1848 include-referenced-projects with non-packed project dependencies`` () =
let scenario = "i001848-pack-with-non-packed-deps"
let rootPath = scenarioTempPath scenario
let outPath = Path.Combine(rootPath, "out")
paket ("pack --include-referenced-projects \"" + outPath + "\"") scenario |> ignore

NuGetLocal.getDetailsFromLocalNuGetPackage false None outPath "" (PackageName "projectA") (SemVer.Parse "1.0.0.0")
|> Async.RunSynchronously
|> ODataSearchResult.get
|> getDependencies
|> List.tryFind (fun (name,version,_) -> name = PackageName "nunit" && version = VersionRequirement.Parse "[3.8.1]")
|> shouldNotEqual None

ZipFile.ExtractToDirectory(Path.Combine(outPath, "projectA.1.0.0.0.nupkg"), outPath)
Path.Combine(outPath, "lib", "net45", "projectB.dll") |> checkFileExists

CleanDir rootPath

[<Test>]
let ``#2694 paket fixnuspec should not remove project references``() =
let project = "console"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
framework: net461
source https://www.nuget.org/api/v2
nuget nunit 3.8.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RESTRICTION: == net461
NUGET
remote: https://www.nuget.org/api/v2
NUnit (3.8.1)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.0.0
MinimumVisualStudioVersion = 10.0.0.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "projectA", "projectA\projectA.csproj", "{2A530232-3251-445E-ADF8-7B562E1BAB0D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "projectB", "projectB\projectB.csproj", "{4CF9D89C-5231-4A59-B823-17082D5646EA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2A530232-3251-445E-ADF8-7B562E1BAB0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A530232-3251-445E-ADF8-7B562E1BAB0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A530232-3251-445E-ADF8-7B562E1BAB0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A530232-3251-445E-ADF8-7B562E1BAB0D}.Release|Any CPU.Build.0 = Release|Any CPU
{4CF9D89C-5231-4A59-B823-17082D5646EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CF9D89C-5231-4A59-B823-17082D5646EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CF9D89C-5231-4A59-B823-17082D5646EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CF9D89C-5231-4A59-B823-17082D5646EA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("projectA")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("projectA")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2A530232-3251-445E-ADF8-7B562E1BAB0D")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type project
authors test
description test
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2A530232-3251-445E-ADF8-7B562E1BAB0D}</ProjectGuid>
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>projectA</RootNamespace>
<AssemblyName>projectA</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="paket.template" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\projectB\projectB.csproj">
<Project>{4cf9d89c-5231-4a59-b823-17082d5646ea}</Project>
<Name>projectB</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>
-->
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("projectB")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("projectB")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4CF9D89C-5231-4A59-B823-17082D5646EA")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nunit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type project
authors test
description test
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{4CF9D89C-5231-4A59-B823-17082D5646EA}</ProjectGuid>
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>projectB</RootNamespace>
<AssemblyName>projectB</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="paket.references" />
<Content Include="paket.template" />
</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>
-->
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.6.1'">
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit\lib\net45\nunit.framework.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,3 @@
framework: net461
source https://www.nuget.org/api/v2
nuget nunit 3.8.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RESTRICTION: == net461
NUGET
remote: https://www.nuget.org/api/v2
NUnit (3.8.1)
Loading

0 comments on commit 9e3f9c7

Please sign in to comment.