Skip to content

Commit 370b440

Browse files
committed
Move project towards .netstadard 2.0
1 parent 3d51d05 commit 370b440

17 files changed

+383
-2782
lines changed

.paket/Paket.Restore.targets

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
1919
<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
2020
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
21+
22+
<!-- .net core fdd -->
23+
<_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension>
24+
<PaketCommand Condition=" '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand>
25+
26+
<!-- no extension is a shell script -->
27+
<PaketCommand Condition=" '$(_PaketExeExtension)' == '' ">"$(PaketExePath)"</PaketCommand>
28+
2129
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
2230
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
2331
<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
@@ -30,17 +38,32 @@
3038
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
3139
</PropertyGroup>
3240

33-
<Target Name="PaketRestore" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" >
41+
<Target Name="PaketRestore" Condition="'$(PaketRestoreDisabled)' != 'True'" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" >
3442

3543
<!-- Step 1 Check if lockfile is properly restored -->
3644
<PropertyGroup>
3745
<PaketRestoreRequired>true</PaketRestoreRequired>
3846
<NoWarn>$(NoWarn);NU1603</NoWarn>
3947
</PropertyGroup>
4048

49+
<!-- Because ReadAllText is slow on osx/linux, try to find shasum and awk -->
50+
<PropertyGroup>
51+
<PaketRestoreCachedHasher Condition="'$(OS)' != 'Windows_NT' And '$(PaketRestoreCachedHasher)' == '' And Exists('/usr/bin/shasum') And Exists('/usr/bin/awk')">/usr/bin/shasum $(PaketRestoreCacheFile) | /usr/bin/awk '{ print $1 }'</PaketRestoreCachedHasher>
52+
<PaketRestoreLockFileHasher Condition="'$(OS)' != 'Windows_NT' And '$(PaketRestoreLockFileHash)' == '' And Exists('/usr/bin/shasum') And Exists('/usr/bin/awk')">/usr/bin/shasum $(PaketLockFilePath) | /usr/bin/awk '{ print $1 }'</PaketRestoreLockFileHasher>
53+
</PropertyGroup>
54+
55+
<!-- If shasum and awk exist get the hashes -->
56+
<Exec Condition=" '$(PaketRestoreCachedHasher)' != '' " Command="$(PaketRestoreCachedHasher)" ConsoleToMSBuild='true'>
57+
<Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreCachedHash" />
58+
</Exec>
59+
<Exec Condition=" '$(PaketRestoreLockFileHasher)' != '' " Command="$(PaketRestoreLockFileHasher)" ConsoleToMSBuild='true'>
60+
<Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreLockFileHash" />
61+
</Exec>
62+
4163
<PropertyGroup Condition="Exists('$(PaketRestoreCacheFile)') ">
42-
<PaketRestoreCachedHash>$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash>
43-
<PaketRestoreLockFileHash>$([System.IO.File]::ReadAllText('$(PaketLockFilePath)'))</PaketRestoreLockFileHash>
64+
<!-- if no hash has been done yet fall back to just reading in the files and comparing them -->
65+
<PaketRestoreCachedHash Condition=" '$(PaketRestoreCachedHash)' == '' ">$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash>
66+
<PaketRestoreLockFileHash Condition=" '$(PaketRestoreLockFileHash)' == '' ">$([System.IO.File]::ReadAllText('$(PaketLockFilePath)'))</PaketRestoreLockFileHash>
4467
<PaketRestoreRequired>true</PaketRestoreRequired>
4568
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '$(PaketRestoreCachedHash)' ">false</PaketRestoreRequired>
4669
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
@@ -88,7 +111,7 @@
88111
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)"' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />
89112

90113
<!-- This shouldn't actually happen, but just to be sure. -->
91-
<Error Condition=" !Exists('$(PaketResolvedFilePath)') AND '$(TargetFramework)' != '' " Text="A paket file for the framework '$(TargetFramework)' is missing. Please delete 'paket-files/paket.restore.cached' and call 'paket restore'." />
114+
<Error Condition=" !Exists('$(PaketResolvedFilePath)') AND '$(TargetFramework)' != '' AND '$(ResolveNuGetPackages)' != 'False' " Text="Paket file '$(PaketResolvedFilePath)' is missing while restoring $(MSBuildProjectFile). Please delete 'paket-files/paket.restore.cached' and call 'paket restore'." />
92115

93116
<!-- Step 4 forward all msbuild properties (PackageReference, DotNetCliToolReference) to msbuild -->
94117
<ReadLinesFromFile Condition="Exists('$(PaketResolvedFilePath)')" File="$(PaketResolvedFilePath)" >
@@ -99,9 +122,11 @@
99122
<PaketReferencesFileLinesInfo Include="@(PaketReferencesFileLines)" >
100123
<PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
101124
<PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
125+
<AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets>
102126
</PaketReferencesFileLinesInfo>
103127
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
104128
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
129+
<PrivateAssets Condition="%(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'true'">All</PrivateAssets>
105130
</PackageReference>
106131
</ItemGroup>
107132

@@ -123,9 +148,10 @@
123148
</DotNetCliToolReference>
124149
</ItemGroup>
125150

151+
<!-- Disabled for now until we know what to do with runtime deps - https://github.com/fsprojects/Paket/issues/2964
126152
<PropertyGroup>
127153
<RestoreConfigFile>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).NuGet.Config</RestoreConfigFile>
128-
</PropertyGroup>
154+
</PropertyGroup> -->
129155

130156
</Target>
131157

@@ -136,22 +162,29 @@
136162
</Target>
137163

138164
<Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
165+
<ItemGroup>
166+
<_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/>
167+
</ItemGroup>
168+
139169
<PropertyGroup>
140170
<PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile>
141171
<ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
142172
<UseNewPack>false</UseNewPack>
143173
<UseNewPack Condition=" '$(NuGetToolVersion)' != '4.0.0' ">true</UseNewPack>
174+
<AdjustedNuspecOutputPath>$(BaseIntermediateOutputPath)$(Configuration)</AdjustedNuspecOutputPath>
175+
<AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(BaseIntermediateOutputPath)</AdjustedNuspecOutputPath>
144176
</PropertyGroup>
145177

146178
<ItemGroup>
147-
<_NuspecFiles Include="$(BaseIntermediateOutputPath)*.nuspec"/>
179+
<_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.nuspec"/>
148180
</ItemGroup>
149181

150182
<Exec Command='$(PaketCommand) fix-nuspecs files "@(_NuspecFiles)" project-file "$(PaketProjectFile)" ' Condition="@(_NuspecFiles) != ''" />
151183

152184
<ConvertToAbsolutePath Condition="@(_NuspecFiles) != ''" Paths="@(_NuspecFiles)">
153185
<Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />
154-
</ConvertToAbsolutePath>
186+
</ConvertToAbsolutePath>
187+
155188

156189
<!-- Call Pack -->
157190
<PackTask Condition="$(UseNewPack)"
@@ -188,7 +221,7 @@
188221
Serviceable="$(Serviceable)"
189222
FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)"
190223
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
191-
NuspecOutputPath="$(BaseIntermediateOutputPath)"
224+
NuspecOutputPath="$(AdjustedNuspecOutputPath)"
192225
IncludeBuildOutput="$(IncludeBuildOutput)"
193226
BuildOutputFolder="$(BuildOutputTargetFolder)"
194227
ContentTargetFolders="$(ContentTargetFolders)"
@@ -230,7 +263,7 @@
230263
Serviceable="$(Serviceable)"
231264
AssemblyReferences="@(_References)"
232265
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
233-
NuspecOutputPath="$(BaseIntermediateOutputPath)"
266+
NuspecOutputPath="$(AdjustedNuspecOutputPath)"
234267
IncludeBuildOutput="$(IncludeBuildOutput)"
235268
BuildOutputFolder="$(BuildOutputTargetFolder)"
236269
ContentTargetFolders="$(ContentTargetFolders)"

.paket/paket.bootstrapper.exe

35.2 KB
Binary file not shown.

.paket/paket.targets

Lines changed: 55 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,72 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
34
<PropertyGroup>
45
<!-- Enable the restore command to run before builds -->
56
<RestorePackages Condition=" '$(RestorePackages)' == '' ">true</RestorePackages>
6-
<!-- Download Paket.exe if it does not already exist -->
7-
<DownloadPaket Condition=" '$(DownloadPaket)' == '' ">true</DownloadPaket>
87
<PaketToolsPath>$(MSBuildThisFileDirectory)</PaketToolsPath>
98
<PaketRootPath>$(MSBuildThisFileDirectory)..\</PaketRootPath>
9+
<PaketLockFilePath>$(PaketRootPath)paket.lock</PaketLockFilePath>
10+
<PaketRestoreCacheFile>$(PaketRootPath)paket-files\paket.restore.cached</PaketRestoreCacheFile>
11+
<MonoPath Condition="'$(MonoPath)' == '' And Exists('/Library/Frameworks/Mono.framework/Commands/mono')">/Library/Frameworks/Mono.framework/Commands/mono</MonoPath>
12+
<MonoPath Condition="'$(MonoPath)' == ''">mono</MonoPath>
1013
</PropertyGroup>
14+
1115
<PropertyGroup>
1216
<!-- Paket command -->
17+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath>
1318
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
14-
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
1519
<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
16-
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
17-
<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
18-
<PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(PaketBootStrapperExePath)</PaketBootStrapperCommand>
19-
<!-- Commands -->
20-
<RestoreCommand>$(PaketCommand) restore</RestoreCommand>
21-
<DownloadPaketCommand>$(PaketBootStrapperCommand)</DownloadPaketCommand>
20+
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
21+
</PropertyGroup>
22+
23+
<Choose> <!-- MyProject.fsproj.paket.references has the highest precedence -->
24+
<When Condition="Exists('$(MSBuildProjectFullPath).paket.references')">
25+
<PropertyGroup>
26+
<PaketReferences>$(MSBuildProjectFullPath).paket.references</PaketReferences>
27+
</PropertyGroup>
28+
</When> <!-- MyProject.paket.references -->
29+
<When Condition="Exists('$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references')">
30+
<PropertyGroup>
31+
<PaketReferences>$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references</PaketReferences>
32+
</PropertyGroup>
33+
</When> <!-- paket.references -->
34+
<When Condition="Exists('$(MSBuildProjectDirectory)\paket.references')">
35+
<PropertyGroup>
36+
<PaketReferences>$(MSBuildProjectDirectory)\paket.references</PaketReferences>
37+
</PropertyGroup>
38+
</When> <!-- Set to empty if a reference file isn't found matching one of the 3 format options -->
39+
<Otherwise>
40+
<PropertyGroup>
41+
<PaketReferences></PaketReferences>
42+
</PropertyGroup>
43+
</Otherwise>
44+
</Choose>
45+
46+
<PropertyGroup>
47+
<!-- Commands -->
48+
<RestoreCommand>$(PaketCommand) restore --references-file "$(PaketReferences)"</RestoreCommand>
2249
<!-- We need to ensure packages are restored prior to assembly resolve -->
2350
<BuildDependsOn Condition="$(RestorePackages) == 'true'">RestorePackages; $(BuildDependsOn);</BuildDependsOn>
2451
</PropertyGroup>
25-
<Target Name="CheckPrerequisites">
26-
<!-- Raise an error if we're unable to locate paket.exe -->
27-
<Error Condition="'$(DownloadPaket)' != 'true' AND !Exists('$(PaketExePath)')" Text="Unable to locate '$(PaketExePath)'" />
28-
<MsBuild Targets="DownloadPaket" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadPaket=$(DownloadPaket)" />
29-
</Target>
30-
<Target Name="DownloadPaket">
31-
<Exec Command="$(DownloadPaketCommand)" Condition=" '$(DownloadPaket)' == 'true' AND !Exists('$(PaketExePath)')" />
32-
</Target>
33-
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
34-
<Exec Command="$(RestoreCommand)" WorkingDirectory="$(PaketRootPath)" />
52+
<Target Name="RestorePackages">
53+
<PropertyGroup>
54+
<PaketRestoreRequired>true</PaketRestoreRequired>
55+
</PropertyGroup>
56+
57+
<PropertyGroup Condition="Exists('$(PaketRestoreCacheFile)') ">
58+
<PaketRestoreCachedHash>$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash>
59+
<PaketRestoreLockFileHash>$([System.IO.File]::ReadAllText('$(PaketLockFilePath)'))</PaketRestoreLockFileHash>
60+
<PaketRestoreRequired>true</PaketRestoreRequired>
61+
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '$(PaketRestoreCachedHash)' ">false</PaketRestoreRequired>
62+
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
63+
</PropertyGroup>
64+
65+
<Exec Command="$(RestoreCommand)"
66+
IgnoreStandardErrorWarningFormat="true"
67+
WorkingDirectory="$(PaketRootPath)"
68+
ContinueOnError="false"
69+
Condition=" '$(PaketRestoreRequired)' == 'true' AND Exists('$(PaketReferences)') AND '$(PaketReferences)' != '' "
70+
/>
3571
</Target>
3672
</Project>

FSharp.Plotly.sln

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 15
3-
VisualStudioVersion = 15.0.27130.2020
3+
VisualStudioVersion = 15.0.27130.2036
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{63297B98-5CED-492C-A5B7-A5B4F73CF142}"
66
ProjectSection(SolutionItems) = preProject
@@ -59,9 +59,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{ED8079DD
5959
EndProject
6060
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Plotly.Tests", "tests\FSharp.Plotly.Tests\FSharp.Plotly.Tests.fsproj", "{B7F06453-847A-4894-9705-7BFB793E5AFC}"
6161
EndProject
62-
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Plotly.WPF", "src\FSharp.Plotly.WPF\FSharp.Plotly.WPF.fsproj", "{8540F0CB-E9DE-4FBF-B691-C13A4A28E6B8}"
62+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Plotly", "src\FSharp.Plotly\FSharp.Plotly.fsproj", "{AF92DAC1-46E7-4C6A-B784-772A284DD3BD}"
6363
EndProject
64-
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Plotly", "src\FSharp.Plotly\FSharp.Plotly.fsproj", "{A57AEBC7-0C03-487E-B8A3-0F6CBDAD88F3}"
64+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Plotly.WPF", "src\FSharp.Plotly.WPF\FSharp.Plotly.WPF.fsproj", "{2869F1FF-BA08-420C-AB41-CFF4835DD954}"
6565
EndProject
6666
Global
6767
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -73,14 +73,14 @@ Global
7373
{B7F06453-847A-4894-9705-7BFB793E5AFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
7474
{B7F06453-847A-4894-9705-7BFB793E5AFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
7575
{B7F06453-847A-4894-9705-7BFB793E5AFC}.Release|Any CPU.Build.0 = Release|Any CPU
76-
{8540F0CB-E9DE-4FBF-B691-C13A4A28E6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
77-
{8540F0CB-E9DE-4FBF-B691-C13A4A28E6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
78-
{8540F0CB-E9DE-4FBF-B691-C13A4A28E6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
79-
{8540F0CB-E9DE-4FBF-B691-C13A4A28E6B8}.Release|Any CPU.Build.0 = Release|Any CPU
80-
{A57AEBC7-0C03-487E-B8A3-0F6CBDAD88F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
81-
{A57AEBC7-0C03-487E-B8A3-0F6CBDAD88F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
82-
{A57AEBC7-0C03-487E-B8A3-0F6CBDAD88F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
83-
{A57AEBC7-0C03-487E-B8A3-0F6CBDAD88F3}.Release|Any CPU.Build.0 = Release|Any CPU
76+
{AF92DAC1-46E7-4C6A-B784-772A284DD3BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
77+
{AF92DAC1-46E7-4C6A-B784-772A284DD3BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
78+
{AF92DAC1-46E7-4C6A-B784-772A284DD3BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
79+
{AF92DAC1-46E7-4C6A-B784-772A284DD3BD}.Release|Any CPU.Build.0 = Release|Any CPU
80+
{2869F1FF-BA08-420C-AB41-CFF4835DD954}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
81+
{2869F1FF-BA08-420C-AB41-CFF4835DD954}.Debug|Any CPU.Build.0 = Debug|Any CPU
82+
{2869F1FF-BA08-420C-AB41-CFF4835DD954}.Release|Any CPU.ActiveCfg = Release|Any CPU
83+
{2869F1FF-BA08-420C-AB41-CFF4835DD954}.Release|Any CPU.Build.0 = Release|Any CPU
8484
EndGlobalSection
8585
GlobalSection(SolutionProperties) = preSolution
8686
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)