Skip to content

Commit

Permalink
Added test case for pack command where input assembly utilizes Reflec…
Browse files Browse the repository at this point in the history
…tedDefinitions which results in exceptions during pack, due to a bug in FSharp.Data #918)
  • Loading branch information
haraldsteinlechner committed Apr 12, 2016
1 parent fbeb488 commit 4e4d643
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 0 deletions.
15 changes: 15 additions & 0 deletions integrationtests/Paket.IntegrationTests/PackSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,19 @@ let ``#1594 allows to pack directly``() =
ZipFile.ExtractToDirectory(package, outPath)

File.Exists(Path.Combine(outPath, "lib", "net35", "ClassLibrary1.dll")) |> shouldEqual true
File.Delete(templatePath)

[<Test>]
let ``#1596 pack works for reflected definition assemblies``() =
let scenario = "i001596-pack-reflectedDefinition"

let outPath = Path.Combine(scenarioTempPath scenario,"bin")
let templatePath = Path.Combine(scenarioTempPath scenario, "paket.template")
let r = paket "pack output bin version 1.0.0 templatefile paket.template" scenario
printfn "paket.pack said: %A" r
let package = Path.Combine(outPath, "Project2.1.0.0.nupkg")

ZipFile.ExtractToDirectory(package, outPath)

File.Exists(Path.Combine(outPath, "lib", "net45", "Project2.dll")) |> shouldEqual true
File.Delete(templatePath)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Project2", "Project2.fsproj", "{BDF41042-8CB5-4723-AA90-18C05F9FFE85}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BDF41042-8CB5-4723-AA90-18C05F9FFE85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BDF41042-8CB5-4723-AA90-18C05F9FFE85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BDF41042-8CB5-4723-AA90-18C05F9FFE85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BDF41042-8CB5-4723-AA90-18C05F9FFE85}.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,72 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.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>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>bdf41042-8cb5-4723-aa90-18c05f9ffe85</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Project2</RootNamespace>
<AssemblyName>Project2</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFSharpCoreVersion>4.3.0.0</TargetFSharpCoreVersion>
<Name>Project2</Name>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<OutputPath>bin\$(Configuration)\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\Debug\fsharp_project_scaffold_tests.XML</DocumentationFile>
<StartAction>Project</StartAction>
<StartProgram>
</StartProgram>
<StartArguments>
</StartArguments>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\Release\Project2.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Test.fs" />
</ItemGroup>
<!-- 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("ClassLibrary1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ClassLibrary1")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[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("193980e1-4f3c-4522-9362-2dcfb4dd85b8")]

// 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")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace jasdf

module Test =
[<ReflectedDefinition>]
let a () = 1123

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<!-- For Goldmine tests -->
<add key="GoldmineEntityType" value="Proxy" />
<!-- Google apps API keys -->
<add key="GoogleAppMigrationWizProjectApiKey-1" value="key1"/>
<add key="GoogleAppMigrationWizProjectApiKey-2" value="key2"/>
<add key="GoogleAppMigrationWizProjectApiKey-3" value="key3"/>
<add key="SendEmails" value="false"/>
<add key="BitTitanDropBoxAppKey" value="BitTitan" />
<add key="BitTitanDropBoxSecretKey" value="BitTitan" />
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source https://www.nuget.org/api/v2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type project
licenseUrl http://opensource.org/licenses/MIT
authors blub
description bla

0 comments on commit 4e4d643

Please sign in to comment.