Skip to content

Commit 41af538

Browse files
committed
update simplify to property generate the list of targetframework restrictions when the framework is being auto-detected
1 parent ef7b9a6 commit 41af538

File tree

9 files changed

+680
-505
lines changed

9 files changed

+680
-505
lines changed

integrationtests/Paket.IntegrationTests/Paket.IntegrationTests.fsproj

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
<Compile Include="BindingRedirect.fs" />
121121
<Compile Include="LoadingScriptGenerationTests.fs" />
122122
<Compile Include="LocalOverrideSpecs.fs" />
123+
<Compile Include="SimplifierSpecs.fs" />
123124
<None Include="paket.references" />
124125
<Content Include="App.config" />
125126
</ItemGroup>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module Paket.IntegrationTests.SimplifierSpecs
2+
3+
open NUnit.Framework
4+
open Fake
5+
open FsUnit
6+
7+
[<Test>]
8+
let ``#1737 simplify should handle auto-detected framework``() =
9+
let scenario = "i001737-simplify-with-auto-framework"
10+
prepare scenario
11+
paket "install" scenario |> ignore
12+
13+
let deps = Paket.Dependencies(scenarioTempPath scenario </> "paket.dependencies")
14+
deps.Simplify(false)
15+
16+
deps.GetDependenciesFile().Groups.[Paket.Constants.MainDependencyGroup].Packages |> shouldHaveLength 1
17+
18+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source https://www.nuget.org/api/v2
2+
3+
framework: auto-detect
4+
5+
nuget Microsoft.Owin.Host.SystemWeb
6+
nuget Owin
7+
nuget Microsoft.Owin
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
namespace projectA.AssemblyInfo
2+
3+
open System.Reflection
4+
open System.Runtime.CompilerServices
5+
open System.Runtime.InteropServices
6+
7+
// General Information about an assembly is controlled through the following
8+
// set of attributes. Change these attribute values to modify the information
9+
// associated with an assembly.
10+
[<assembly: AssemblyTitle("projectA")>]
11+
[<assembly: AssemblyDescription("")>]
12+
[<assembly: AssemblyConfiguration("")>]
13+
[<assembly: AssemblyCompany("")>]
14+
[<assembly: AssemblyProduct("projectA")>]
15+
[<assembly: AssemblyCopyright("Copyright © 2016")>]
16+
[<assembly: AssemblyTrademark("")>]
17+
[<assembly: AssemblyCulture("")>]
18+
19+
// Setting ComVisible to false makes the types in this assembly not visible
20+
// to COM components. If you need to access a type in this assembly from
21+
// COM, set the ComVisible attribute to true on that type.
22+
[<assembly: ComVisible(false)>]
23+
24+
// The following GUID is for the ID of the typelib if this project is exposed to COM
25+
[<assembly: Guid("64a2b322-0a4a-4d59-a0ec-41ca3fd44f48")>]
26+
27+
// Version information for an assembly consists of the following four values:
28+
//
29+
// Major Version
30+
// Minor Version
31+
// Build Number
32+
// Revision
33+
//
34+
// You can specify all the values or you can default the Build and Revision Numbers
35+
// by using the '*' as shown below:
36+
// [<assembly: AssemblyVersion("1.0.*")>]
37+
[<assembly: AssemblyVersion("1.0.0.0")>]
38+
[<assembly: AssemblyFileVersion("1.0.0.0")>]
39+
40+
do
41+
()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>64a2b322-0a4a-4d59-a0ec-41ca3fd44f48</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<RootNamespace>projectA</RootNamespace>
11+
<AssemblyName>projectA</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13+
<TargetFSharpCoreVersion>4.3.0.0</TargetFSharpCoreVersion>
14+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15+
<Name>projectA</Name>
16+
<TargetFrameworkProfile />
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<Tailcalls>false</Tailcalls>
23+
<OutputPath>bin\Debug\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<WarningLevel>3</WarningLevel>
26+
<DocumentationFile>bin\Debug\projectA.XML</DocumentationFile>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<DebugType>pdbonly</DebugType>
30+
<Optimize>true</Optimize>
31+
<Tailcalls>true</Tailcalls>
32+
<OutputPath>bin\Release\</OutputPath>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<WarningLevel>3</WarningLevel>
35+
<DocumentationFile>bin\Release\projectA.XML</DocumentationFile>
36+
</PropertyGroup>
37+
<PropertyGroup>
38+
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
39+
</PropertyGroup>
40+
<Choose>
41+
<When Condition="'$(VisualStudioVersion)' == '11.0'">
42+
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')">
43+
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
44+
</PropertyGroup>
45+
</When>
46+
<Otherwise>
47+
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
48+
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
49+
</PropertyGroup>
50+
</Otherwise>
51+
</Choose>
52+
<Import Project="$(FSharpTargetsPath)" />
53+
<UsingTask TaskName="CopyRuntimeDependencies" AssemblyFile="..\.paket\paket.exe" />
54+
<Target Name="AfterBuild" Condition="Exists('..\.paket\paket.exe')">
55+
<CopyRuntimeDependencies OutputPath="$(OutputPath)" ProjectsWithRuntimeLibs="System.Collections;System.Diagnostics.Debug;System.Globalization;System.IO;System.Private.Uri;System.Reflection;System.Reflection.Primitives;System.Resources.ResourceManager;System.Runtime;System.Runtime.Extensions;System.Text.Encoding;System.Text.Encoding.Extensions;System.Threading;System.Threading.Tasks" />
56+
</Target>
57+
<ItemGroup>
58+
<Compile Include="AssemblyInfo.fs" />
59+
</ItemGroup>
60+
<ItemGroup>
61+
<Reference Include="mscorlib" />
62+
<Reference Include="System" />
63+
<Reference Include="System.Configuration" />
64+
<Reference Include="System.Core" />
65+
<Reference Include="System.Numerics" />
66+
<Reference Include="System.Runtime.Serialization" />
67+
<Reference Include="System.ServiceModel" />
68+
</ItemGroup>
69+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
70+
Other similar extension points exist, see Microsoft.Common.targets.
71+
<Target Name="BeforeBuild">
72+
</Target>
73+
<Target Name="AfterBuild">
74+
</Target>
75+
-->
76+
</Project>

0 commit comments

Comments
 (0)