Skip to content

Commit 11a80f9

Browse files
committed
Add various marker symbol styles
1 parent 7e2e2bd commit 11a80f9

File tree

2 files changed

+208
-67
lines changed

2 files changed

+208
-67
lines changed

Diff for: .paket/Paket.Restore.targets

+106-27
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,43 @@
1717
<PaketExeImage Condition=" '$(PaketBootstrapperStyle)' == 'proj' ">native</PaketExeImage>
1818
<MonoPath Condition="'$(MonoPath)' == '' And Exists('/Library/Frameworks/Mono.framework/Commands/mono')">/Library/Frameworks/Mono.framework/Commands/mono</MonoPath>
1919
<MonoPath Condition="'$(MonoPath)' == ''">mono</MonoPath>
20-
<!-- Paket command -->
21-
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketToolsPath)paket')">$(PaketToolsPath)paket</PaketExePath>
22-
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath>
2320

24-
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' ">$(PaketToolsPath)paket.exe</PaketExePath>
25-
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND '$(PaketExeImage)' == 'assembly' ">$(PaketToolsPath)paket.exe</PaketExePath>
26-
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND '$(PaketExeImage)' == 'native' ">$(PaketToolsPath)paket</PaketExePath>
21+
<!-- PaketBootStrapper -->
22+
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
23+
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
24+
<PaketBootStrapperExeDir Condition=" Exists('$(PaketBootStrapperExePath)') " >$([System.IO.Path]::GetDirectoryName("$(PaketBootStrapperExePath)"))\</PaketBootStrapperExeDir>
25+
26+
<!-- Paket -->
27+
28+
<!-- windows, root => tool => proj style => bootstrapper => global -->
29+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' AND Exists('$(PaketRootPath)paket.exe') ">$(PaketRootPath)paket.exe</PaketExePath>
30+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' AND Exists('$(PaketToolsPath)paket.exe') ">$(PaketToolsPath)paket.exe</PaketExePath>
31+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' AND '$(PaketBootstrapperStyle)' == 'proj' ">$(PaketToolsPath)paket.exe</PaketExePath>
32+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' AND Exists('$(PaketBootStrapperExeDir)') ">$(_PaketBootStrapperExeDir)paket.exe</PaketExePath>
33+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' == 'Windows_NT' ">paket.exe</PaketExePath>
34+
35+
<!-- no windows, try native paket as default, root => tool => proj style => mono paket => bootstrpper => global -->
36+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(PaketRootPath)paket') ">$(PaketRootPath)paket</PaketExePath>
37+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(PaketToolsPath)paket') ">$(PaketToolsPath)paket</PaketExePath>
38+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND '$(PaketBootstrapperStyle)' == 'proj' ">$(PaketToolsPath)paket</PaketExePath>
39+
40+
<!-- no windows, try mono paket -->
41+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(PaketRootPath)paket.exe') ">$(PaketRootPath)paket.exe</PaketExePath>
42+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(PaketToolsPath)paket.exe') ">$(PaketToolsPath)paket.exe</PaketExePath>
43+
44+
<!-- no windows, try bootstrapper -->
45+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(PaketBootStrapperExeDir)') ">$(PaketBootStrapperExeDir)paket.exe</PaketExePath>
46+
47+
<!-- no windows, try global native paket -->
48+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND '$(OS)' != 'Windows_NT' ">paket</PaketExePath>
2749

2850
<!-- Paket command -->
2951
<_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension>
3052
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand>
31-
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
3253
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' != 'Windows_NT' AND '$(_PaketExeExtension)' == '.exe' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
33-
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' != 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
54+
<PaketCommand Condition=" '$(PaketCommand)' == '' ">"$(PaketExePath)"</PaketCommand>
55+
3456

35-
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
36-
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
3757
<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
3858
<PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
3959

@@ -42,6 +62,11 @@
4262
<!-- see https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1032-fsharp-in-dotnet-sdk.md -->
4363
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
4464
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
65+
66+
<!-- Disable Paket restore under NCrunch build -->
67+
<PaketRestoreDisabled Condition="'$(NCrunch)' == '1'">True</PaketRestoreDisabled>
68+
69+
<PaketIntermediateOutputPath Condition=" '$(PaketIntermediateOutputPath)' == '' ">$(BaseIntermediateOutputPath.TrimEnd('\').TrimEnd('\/'))</PaketIntermediateOutputPath>
4570
</PropertyGroup>
4671

4772
<Target Name="PaketBootstrapping" Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">
@@ -82,24 +107,28 @@
82107
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
83108
</PropertyGroup>
84109

85-
<PropertyGroup Condition="'$(PaketPropsVersion)' != '5.174.2' ">
110+
<!--
111+
This value should match the version in the props generated by paket
112+
If they differ, this means we need to do a restore in order to ensure correct dependencies
113+
-->
114+
<PropertyGroup Condition="'$(PaketPropsVersion)' != '5.185.3' ">
86115
<PaketRestoreRequired>true</PaketRestoreRequired>
87116
</PropertyGroup>
88117

89118
<!-- Do a global restore if required -->
90119
<Exec Command='$(PaketBootStrapperCommand)' Condition=" '$(PaketBootstrapperStyle)' == 'classic' AND Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
91-
<Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />
92-
120+
<Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(PaketDisableGlobalRestore)' != 'true' " ContinueOnError="false" />
121+
93122
<!-- Step 2 Detect project specific changes -->
94123
<ItemGroup>
95124
<MyTargetFrameworks Condition="'$(TargetFramework)' != '' " Include="$(TargetFramework)"></MyTargetFrameworks>
96125
<!-- Don't include all frameworks when msbuild explicitly asks for a single one -->
97126
<MyTargetFrameworks Condition="'$(TargetFrameworks)' != '' AND '$(TargetFramework)' == '' " Include="$(TargetFrameworks)"></MyTargetFrameworks>
98-
<PaketResolvedFilePaths Include="@(MyTargetFrameworks -> '$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).%(Identity).paket.resolved')"></PaketResolvedFilePaths>
127+
<PaketResolvedFilePaths Include="@(MyTargetFrameworks -> '$(PaketIntermediateOutputPath)\$(MSBuildProjectFile).%(Identity).paket.resolved')"></PaketResolvedFilePaths>
99128
</ItemGroup>
100129
<Message Importance="low" Text="MyTargetFrameworks=@(MyTargetFrameworks) PaketResolvedFilePaths=@(PaketResolvedFilePaths)" />
101130
<PropertyGroup>
102-
<PaketReferencesCachedFilePath>$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).paket.references.cached</PaketReferencesCachedFilePath>
131+
<PaketReferencesCachedFilePath>$(PaketIntermediateOutputPath)\$(MSBuildProjectFile).paket.references.cached</PaketReferencesCachedFilePath>
103132
<!-- MyProject.fsproj.paket.references has the highest precedence -->
104133
<PaketOriginalReferencesFilePath>$(MSBuildProjectFullPath).paket.references</PaketOriginalReferencesFilePath>
105134
<!-- MyProject.paket.references -->
@@ -134,8 +163,8 @@
134163

135164
<!-- Step 3 Restore project specific stuff if required -->
136165
<Message Condition=" '$(PaketRestoreRequired)' == 'true' " Importance="low" Text="Detected a change ('$(PaketRestoreRequiredReason)') in the project file '$(MSBuildProjectFullPath)', calling paket restore" />
137-
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --target-framework "$(TargetFrameworks)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' == '' " ContinueOnError="false" />
138-
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --target-framework "$(TargetFramework)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' != '' " ContinueOnError="false" />
166+
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --output-path "$(PaketIntermediateOutputPath)" --target-framework "$(TargetFrameworks)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' == '' " ContinueOnError="false" />
167+
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --output-path "$(PaketIntermediateOutputPath)" --target-framework "$(TargetFramework)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' != '' " ContinueOnError="false" />
139168

140169
<!-- This shouldn't actually happen, but just to be sure. -->
141170
<PropertyGroup>
@@ -163,11 +192,12 @@
163192
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' == '6' And %(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets>
164193
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' != '6' And %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
165194
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
195+
<AllowExplicitVersion>true</AllowExplicitVersion>
166196
</PackageReference>
167197
</ItemGroup>
168198

169199
<PropertyGroup>
170-
<PaketCliToolFilePath>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).paket.clitools</PaketCliToolFilePath>
200+
<PaketCliToolFilePath>$(PaketIntermediateOutputPath)/$(MSBuildProjectFile).paket.clitools</PaketCliToolFilePath>
171201
</PropertyGroup>
172202

173203
<ReadLinesFromFile File="$(PaketCliToolFilePath)" >
@@ -186,37 +216,39 @@
186216

187217
<!-- Disabled for now until we know what to do with runtime deps - https://github.com/fsprojects/Paket/issues/2964
188218
<PropertyGroup>
189-
<RestoreConfigFile>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).NuGet.Config</RestoreConfigFile>
219+
<RestoreConfigFile>$(PaketIntermediateOutputPath)/$(MSBuildProjectFile).NuGet.Config</RestoreConfigFile>
190220
</PropertyGroup> -->
191221

192222
</Target>
193223

194-
<Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
224+
<Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(PaketIntermediateOutputPath)/$(MSBuildProjectFile).references')" >
195225
<PropertyGroup>
196226
<ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec>
197227
<DetectedMSBuildVersion>$(MSBuildVersion)</DetectedMSBuildVersion>
198228
<DetectedMSBuildVersion Condition="$(MSBuildVersion) == ''">15.8.0</DetectedMSBuildVersion>
199229
</PropertyGroup>
200230
</Target>
201231

202-
<Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
232+
<Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(PaketIntermediateOutputPath)/$(MSBuildProjectFile).references')" >
203233
<ItemGroup>
204-
<_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/>
234+
<_NuspecFilesNewLocation Include="$(PaketIntermediateOutputPath)\$(Configuration)\*.nuspec"/>
205235
<MSBuildMajorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[0])" />
206236
<MSBuildMinorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[1])" />
207237
</ItemGroup>
208238

209239
<PropertyGroup>
210240
<PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile>
211241
<ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
242+
<UseMSBuild16_0_Pack>false</UseMSBuild16_0_Pack>
243+
<UseMSBuild16_0_Pack Condition=" '@(MSBuildMajorVersion)' >= '16' ">true</UseMSBuild16_0_Pack>
212244
<UseMSBuild15_9_Pack>false</UseMSBuild15_9_Pack>
213-
<UseMSBuild15_9_Pack Condition=" '@(MSBuildMajorVersion)' > '15' OR ('@(MSBuildMajorVersion)' == '15' AND '@(MSBuildMinorVersion)' > '8') ">true</UseMSBuild15_9_Pack>
245+
<UseMSBuild15_9_Pack Condition=" '@(MSBuildMajorVersion)' == '15' AND '@(MSBuildMinorVersion)' > '8' ">true</UseMSBuild15_9_Pack>
214246
<UseMSBuild15_8_Pack>false</UseMSBuild15_8_Pack>
215-
<UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) ">true</UseMSBuild15_8_Pack>
247+
<UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) AND (! $(UseMSBuild16_0_Pack)) ">true</UseMSBuild15_8_Pack>
216248
<UseNuGet4_Pack>false</UseNuGet4_Pack>
217-
<UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) ">true</UseNuGet4_Pack>
218-
<AdjustedNuspecOutputPath>$(BaseIntermediateOutputPath)$(Configuration)</AdjustedNuspecOutputPath>
219-
<AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(BaseIntermediateOutputPath)</AdjustedNuspecOutputPath>
249+
<UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) AND (! $(UseMSBuild16_0_Pack)) ">true</UseNuGet4_Pack>
250+
<AdjustedNuspecOutputPath>$(PaketIntermediateOutputPath)\$(Configuration)</AdjustedNuspecOutputPath>
251+
<AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(PaketIntermediateOutputPath)</AdjustedNuspecOutputPath>
220252
</PropertyGroup>
221253

222254
<ItemGroup>
@@ -230,6 +262,53 @@
230262
</ConvertToAbsolutePath>
231263

232264
<!-- Call Pack -->
265+
<PackTask Condition="$(UseMSBuild16_0_Pack)"
266+
PackItem="$(PackProjectInputFile)"
267+
PackageFiles="@(_PackageFiles)"
268+
PackageFilesToExclude="@(_PackageFilesToExclude)"
269+
PackageVersion="$(PackageVersion)"
270+
PackageId="$(PackageId)"
271+
Title="$(Title)"
272+
Authors="$(Authors)"
273+
Description="$(Description)"
274+
Copyright="$(Copyright)"
275+
RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
276+
LicenseUrl="$(PackageLicenseUrl)"
277+
ProjectUrl="$(PackageProjectUrl)"
278+
IconUrl="$(PackageIconUrl)"
279+
ReleaseNotes="$(PackageReleaseNotes)"
280+
Tags="$(PackageTags)"
281+
DevelopmentDependency="$(DevelopmentDependency)"
282+
BuildOutputInPackage="@(_BuildOutputInPackage)"
283+
TargetPathsToSymbols="@(_TargetPathsToSymbols)"
284+
SymbolPackageFormat="symbols.nupkg"
285+
TargetFrameworks="@(_TargetFrameworks)"
286+
AssemblyName="$(AssemblyName)"
287+
PackageOutputPath="$(PackageOutputAbsolutePath)"
288+
IncludeSymbols="$(IncludeSymbols)"
289+
IncludeSource="$(IncludeSource)"
290+
PackageTypes="$(PackageType)"
291+
IsTool="$(IsTool)"
292+
RepositoryUrl="$(RepositoryUrl)"
293+
RepositoryType="$(RepositoryType)"
294+
SourceFiles="@(_SourceFiles->Distinct())"
295+
NoPackageAnalysis="$(NoPackageAnalysis)"
296+
MinClientVersion="$(MinClientVersion)"
297+
Serviceable="$(Serviceable)"
298+
FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)"
299+
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
300+
NuspecOutputPath="$(AdjustedNuspecOutputPath)"
301+
IncludeBuildOutput="$(IncludeBuildOutput)"
302+
BuildOutputFolders="$(BuildOutputTargetFolder)"
303+
ContentTargetFolders="$(ContentTargetFolders)"
304+
RestoreOutputPath="$(RestoreOutputAbsolutePath)"
305+
NuspecFile="$(NuspecFileAbsolutePath)"
306+
NuspecBasePath="$(NuspecBasePath)"
307+
NuspecProperties="$(NuspecProperties)"
308+
PackageLicenseFile="$(PackageLicenseFile)"
309+
PackageLicenseExpression="$(PackageLicenseExpression)"
310+
PackageLicenseExpressionVersion="$(PackageLicenseExpressionVersion)" />
311+
233312
<PackTask Condition="$(UseMSBuild15_9_Pack)"
234313
PackItem="$(PackProjectInputFile)"
235314
PackageFiles="@(_PackageFiles)"

0 commit comments

Comments
 (0)