Skip to content

Commit 271509f

Browse files
author
MrsSima
committed
xxx
1 parent adf123a commit 271509f

38 files changed

+1229
-105
lines changed

.paket/Paket.Restore.targets

Lines changed: 112 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,49 @@
1111
<PaketRootPath>$(MSBuildThisFileDirectory)..\</PaketRootPath>
1212
<PaketRestoreCacheFile>$(PaketRootPath)paket-files\paket.restore.cached</PaketRestoreCacheFile>
1313
<PaketLockFilePath>$(PaketRootPath)paket.lock</PaketLockFilePath>
14+
<PaketBootstrapperStyle>classic</PaketBootstrapperStyle>
15+
<PaketBootstrapperStyle Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">proj</PaketBootstrapperStyle>
16+
<PaketExeImage>assembly</PaketExeImage>
17+
<PaketExeImage Condition=" '$(PaketBootstrapperStyle)' == 'proj' ">native</PaketExeImage>
1418
<MonoPath Condition="'$(MonoPath)' == '' And Exists('/Library/Frameworks/Mono.framework/Commands/mono')">/Library/Frameworks/Mono.framework/Commands/mono</MonoPath>
1519
<MonoPath Condition="'$(MonoPath)' == ''">mono</MonoPath>
16-
<!-- Paket command -->
17-
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath>
18-
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
19-
<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
20-
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
2120

22-
<!-- .net core fdd -->
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>
49+
50+
<!-- Paket command -->
2351
<_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension>
24-
<PaketCommand Condition=" '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand>
52+
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand>
53+
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' != 'Windows_NT' AND '$(_PaketExeExtension)' == '.exe' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
54+
<PaketCommand Condition=" '$(PaketCommand)' == '' ">"$(PaketExePath)"</PaketCommand>
2555

26-
<!-- no extension is a shell script -->
27-
<PaketCommand Condition=" '$(_PaketExeExtension)' == '' ">"$(PaketExePath)"</PaketCommand>
2856

29-
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
30-
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
3157
<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
3258
<PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
3359

@@ -36,9 +62,16 @@
3662
<!-- see https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1032-fsharp-in-dotnet-sdk.md -->
3763
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
3864
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
65+
66+
<!-- Disable Paket restore under NCrunch build -->
67+
<PaketRestoreDisabled Condition="'$(NCrunch)' == '1'">True</PaketRestoreDisabled>
3968
</PropertyGroup>
4069

41-
<Target Name="PaketRestore" Condition="'$(PaketRestoreDisabled)' != 'True'" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" >
70+
<Target Name="PaketBootstrapping" Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">
71+
<MSBuild Projects="$(PaketToolsPath)paket.bootstrapper.proj" Targets="Restore" />
72+
</Target>
73+
74+
<Target Name="PaketRestore" Condition="'$(PaketRestoreDisabled)' != 'True'" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" DependsOnTargets="PaketBootstrapping">
4275

4376
<!-- Step 1 Check if lockfile is properly restored -->
4477
<PropertyGroup>
@@ -72,12 +105,16 @@
72105
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
73106
</PropertyGroup>
74107

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

79116
<!-- Do a global restore if required -->
80-
<Exec Command='$(PaketBootStrapperCommand)' Condition="Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
117+
<Exec Command='$(PaketBootStrapperCommand)' Condition=" '$(PaketBootstrapperStyle)' == 'classic' AND Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
81118
<Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />
82119

83120
<!-- Step 2 Detect project specific changes -->
@@ -141,16 +178,19 @@
141178

142179
<ItemGroup Condition="($(DesignTimeBuild) != true OR '$(PaketPropsLoaded)' != 'true') AND '@(PaketReferencesFileLines)' != '' " >
143180
<PaketReferencesFileLinesInfo Include="@(PaketReferencesFileLines)" >
181+
<Splits>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length)</Splits>
144182
<PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
145183
<PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
146184
<AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets>
147-
<CopyLocal>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal>
185+
<CopyLocal Condition="'$(Splits)' == '6'">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal>
148186
</PaketReferencesFileLinesInfo>
149187
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
150188
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
151189
<PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets>
152-
<ExcludeAssets Condition="%(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets>
190+
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' == '6' And %(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets>
191+
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' != '6' And %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
153192
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
193+
<AllowExplicitVersion>true</AllowExplicitVersion>
154194
</PackageReference>
155195
</ItemGroup>
156196

@@ -182,19 +222,27 @@
182222
<Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
183223
<PropertyGroup>
184224
<ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec>
225+
<DetectedMSBuildVersion>$(MSBuildVersion)</DetectedMSBuildVersion>
226+
<DetectedMSBuildVersion Condition="$(MSBuildVersion) == ''">15.8.0</DetectedMSBuildVersion>
185227
</PropertyGroup>
186228
</Target>
187229

188230
<Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
189231
<ItemGroup>
190232
<_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/>
233+
<MSBuildMajorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[0])" />
234+
<MSBuildMinorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[1])" />
191235
</ItemGroup>
192236

193237
<PropertyGroup>
194238
<PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile>
195239
<ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
196-
<UseNewPack>false</UseNewPack>
197-
<UseNewPack Condition=" '$(NuGetToolVersion)' != '4.0.0' ">true</UseNewPack>
240+
<UseMSBuild15_9_Pack>false</UseMSBuild15_9_Pack>
241+
<UseMSBuild15_9_Pack Condition=" '@(MSBuildMajorVersion)' > '15' OR ('@(MSBuildMajorVersion)' == '15' AND '@(MSBuildMinorVersion)' > '8') ">true</UseMSBuild15_9_Pack>
242+
<UseMSBuild15_8_Pack>false</UseMSBuild15_8_Pack>
243+
<UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) ">true</UseMSBuild15_8_Pack>
244+
<UseNuGet4_Pack>false</UseNuGet4_Pack>
245+
<UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) ">true</UseNuGet4_Pack>
198246
<AdjustedNuspecOutputPath>$(BaseIntermediateOutputPath)$(Configuration)</AdjustedNuspecOutputPath>
199247
<AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(BaseIntermediateOutputPath)</AdjustedNuspecOutputPath>
200248
</PropertyGroup>
@@ -209,9 +257,52 @@
209257
<Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />
210258
</ConvertToAbsolutePath>
211259

212-
213260
<!-- Call Pack -->
214-
<PackTask Condition="$(UseNewPack)"
261+
<PackTask Condition="$(UseMSBuild15_9_Pack)"
262+
PackItem="$(PackProjectInputFile)"
263+
PackageFiles="@(_PackageFiles)"
264+
PackageFilesToExclude="@(_PackageFilesToExclude)"
265+
PackageVersion="$(PackageVersion)"
266+
PackageId="$(PackageId)"
267+
Title="$(Title)"
268+
Authors="$(Authors)"
269+
Description="$(Description)"
270+
Copyright="$(Copyright)"
271+
RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
272+
LicenseUrl="$(PackageLicenseUrl)"
273+
ProjectUrl="$(PackageProjectUrl)"
274+
IconUrl="$(PackageIconUrl)"
275+
ReleaseNotes="$(PackageReleaseNotes)"
276+
Tags="$(PackageTags)"
277+
DevelopmentDependency="$(DevelopmentDependency)"
278+
BuildOutputInPackage="@(_BuildOutputInPackage)"
279+
TargetPathsToSymbols="@(_TargetPathsToSymbols)"
280+
SymbolPackageFormat="symbols.nupkg"
281+
TargetFrameworks="@(_TargetFrameworks)"
282+
AssemblyName="$(AssemblyName)"
283+
PackageOutputPath="$(PackageOutputAbsolutePath)"
284+
IncludeSymbols="$(IncludeSymbols)"
285+
IncludeSource="$(IncludeSource)"
286+
PackageTypes="$(PackageType)"
287+
IsTool="$(IsTool)"
288+
RepositoryUrl="$(RepositoryUrl)"
289+
RepositoryType="$(RepositoryType)"
290+
SourceFiles="@(_SourceFiles->Distinct())"
291+
NoPackageAnalysis="$(NoPackageAnalysis)"
292+
MinClientVersion="$(MinClientVersion)"
293+
Serviceable="$(Serviceable)"
294+
FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)"
295+
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
296+
NuspecOutputPath="$(AdjustedNuspecOutputPath)"
297+
IncludeBuildOutput="$(IncludeBuildOutput)"
298+
BuildOutputFolder="$(BuildOutputTargetFolder)"
299+
ContentTargetFolders="$(ContentTargetFolders)"
300+
RestoreOutputPath="$(RestoreOutputAbsolutePath)"
301+
NuspecFile="$(NuspecFileAbsolutePath)"
302+
NuspecBasePath="$(NuspecBasePath)"
303+
NuspecProperties="$(NuspecProperties)"/>
304+
305+
<PackTask Condition="$(UseMSBuild15_8_Pack)"
215306
PackItem="$(PackProjectInputFile)"
216307
PackageFiles="@(_PackageFiles)"
217308
PackageFilesToExclude="@(_PackageFilesToExclude)"
@@ -254,7 +345,7 @@
254345
NuspecBasePath="$(NuspecBasePath)"
255346
NuspecProperties="$(NuspecProperties)"/>
256347

257-
<PackTask Condition="! $(UseNewPack)"
348+
<PackTask Condition="$(UseNuGet4_Pack)"
258349
PackItem="$(PackProjectInputFile)"
259350
PackageFiles="@(_PackageFiles)"
260351
PackageFilesToExclude="@(_PackageFilesToExclude)"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" 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+
<ProjectGuid>{10456FBA-B53A-486A-811A-96A5E962B026}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>ConstraintsMatcher</RootNamespace>
11+
<AssemblyName>ConstraintsMatcher</AssemblyName>
12+
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="System" />
35+
<Reference Include="System.Core" />
36+
<Reference Include="System.Xml.Linq" />
37+
<Reference Include="System.Data.DataSetExtensions" />
38+
<Reference Include="Microsoft.CSharp" />
39+
<Reference Include="System.Data" />
40+
<Reference Include="System.Net.Http" />
41+
<Reference Include="System.Xml" />
42+
</ItemGroup>
43+
<ItemGroup>
44+
<Compile Include="Matcher.cs" />
45+
<Compile Include="Properties\AssemblyInfo.cs" />
46+
</ItemGroup>
47+
<ItemGroup>
48+
<ProjectReference Include="..\src\Repo\Repo.fsproj">
49+
<Project>{9e7065a4-ba5e-4752-84bf-54d5c00db60c}</Project>
50+
<Name>Repo</Name>
51+
</ProjectReference>
52+
</ItemGroup>
53+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
54+
</Project>

0 commit comments

Comments
 (0)