From 4e4d6431ec1e01ecf5130cd92b8a8cfc5029bf1a Mon Sep 17 00:00:00 2001 From: Harald Steinlechner Date: Tue, 12 Apr 2016 14:25:14 +0200 Subject: [PATCH] Added test case for pack command where input assembly utilizes ReflectedDefinitions which results in exceptions during pack, due to a bug in FSharp.Data #918) --- .../Paket.IntegrationTests/PackSpecs.fs | 15 ++++ .../before/ClassLibrary1.sln | 22 ++++++ .../before/Project2.fsprojtemplate | 72 ++++++++++++++++++ .../before/Properties/AssemblyInfo.cs | 36 +++++++++ .../before/Test.fs | 6 ++ .../before/app.config | 17 +++++ .../before/bin/Release/Project2.dll | Bin 0 -> 6144 bytes .../before/paket.dependencies | 1 + .../before/paket.lock | 1 + .../before/paket.references | 0 .../before/paket.templatetemplate | 4 + 11 files changed, 174 insertions(+) create mode 100644 integrationtests/scenarios/i001596-pack-reflectedDefinition/before/ClassLibrary1.sln create mode 100644 integrationtests/scenarios/i001596-pack-reflectedDefinition/before/Project2.fsprojtemplate create mode 100644 integrationtests/scenarios/i001596-pack-reflectedDefinition/before/Properties/AssemblyInfo.cs create mode 100644 integrationtests/scenarios/i001596-pack-reflectedDefinition/before/Test.fs create mode 100644 integrationtests/scenarios/i001596-pack-reflectedDefinition/before/app.config create mode 100644 integrationtests/scenarios/i001596-pack-reflectedDefinition/before/bin/Release/Project2.dll create mode 100644 integrationtests/scenarios/i001596-pack-reflectedDefinition/before/paket.dependencies create mode 100644 integrationtests/scenarios/i001596-pack-reflectedDefinition/before/paket.lock create mode 100644 integrationtests/scenarios/i001596-pack-reflectedDefinition/before/paket.references create mode 100644 integrationtests/scenarios/i001596-pack-reflectedDefinition/before/paket.templatetemplate diff --git a/integrationtests/Paket.IntegrationTests/PackSpecs.fs b/integrationtests/Paket.IntegrationTests/PackSpecs.fs index e90e1ed5e1..3a1ae62357 100644 --- a/integrationtests/Paket.IntegrationTests/PackSpecs.fs +++ b/integrationtests/Paket.IntegrationTests/PackSpecs.fs @@ -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) + +[] +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) \ No newline at end of file diff --git a/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/ClassLibrary1.sln b/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/ClassLibrary1.sln new file mode 100644 index 0000000000..4f9f662c49 --- /dev/null +++ b/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/ClassLibrary1.sln @@ -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 diff --git a/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/Project2.fsprojtemplate b/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/Project2.fsprojtemplate new file mode 100644 index 0000000000..9ae98368b7 --- /dev/null +++ b/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/Project2.fsprojtemplate @@ -0,0 +1,72 @@ + + + + + Debug + AnyCPU + 2.0 + bdf41042-8cb5-4723-aa90-18c05f9ffe85 + Library + Project2 + Project2 + v4.5 + 4.3.0.0 + Project2 + + ..\..\ + true + bin\$(Configuration)\ + + + true + full + false + false + DEBUG;TRACE + 3 + bin\Debug\fsharp_project_scaffold_tests.XML + Project + + + + + + + pdbonly + true + true + TRACE + 3 + bin\Release\Project2.xml + + + 11 + + + + + $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets + + + + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets + + + + + + + + + + + + + diff --git a/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/Properties/AssemblyInfo.cs b/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..8896274beb --- /dev/null +++ b/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/Properties/AssemblyInfo.cs @@ -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")] diff --git a/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/Test.fs b/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/Test.fs new file mode 100644 index 0000000000..70706cc96a --- /dev/null +++ b/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/Test.fs @@ -0,0 +1,6 @@ +namespace jasdf + +module Test = + [] + let a () = 1123 + diff --git a/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/app.config b/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/app.config new file mode 100644 index 0000000000..2999f61ee9 --- /dev/null +++ b/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/app.config @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/bin/Release/Project2.dll b/integrationtests/scenarios/i001596-pack-reflectedDefinition/before/bin/Release/Project2.dll new file mode 100644 index 0000000000000000000000000000000000000000..c4c08582805ba3b87b3fceab131f82bb1fa1907b GIT binary patch literal 6144 zcmeHLU2Ggz6+U-ncfDS(op|j;O`4`-C8_db54-+L9FpL_xHwH>%ezk6vNWDu-*qNg z&nz>uZk>n5EtP1V5?+vy5Pzxw36MZSrGl3t1Uyv;A;b$0?E^f3gm^%eKtka=cXqt% z+9^e9p3-aIbI&>V+;h)4_uQY^OV8gUorq$n_wN(Eg_g^>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