Skip to content

Commit 1d2891d

Browse files
authored
Merge pull request #15 from muehlhaus/kk-master
Added ShowWithDescription and ShowFileWithDescription
2 parents 4be2a7c + a42672b commit 1d2891d

File tree

3 files changed

+227
-149
lines changed

3 files changed

+227
-149
lines changed

.paket/Paket.Restore.targets

+80-16
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,26 @@
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>
1620
<!-- Paket command -->
21+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketToolsPath)paket')">$(PaketToolsPath)paket</PaketExePath>
1722
<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>
2123

22-
<!-- .net core fdd -->
23-
<_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension>
24-
<PaketCommand Condition=" '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand>
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>
2527

26-
<!-- no extension is a shell script -->
27-
<PaketCommand Condition=" '$(_PaketExeExtension)' == '' ">"$(PaketExePath)"</PaketCommand>
28+
<!-- Paket command -->
29+
<_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension>
30+
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand>
31+
<PaketCommand Condition=" '$(PaketCommand)' == '' AND '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
32+
<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>
2834

2935
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
3036
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
@@ -38,7 +44,11 @@
3844
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
3945
</PropertyGroup>
4046

41-
<Target Name="PaketRestore" Condition="'$(PaketRestoreDisabled)' != 'True'" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" >
47+
<Target Name="PaketBootstrapping" Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">
48+
<MSBuild Projects="$(PaketToolsPath)paket.bootstrapper.proj" Targets="Restore" />
49+
</Target>
50+
51+
<Target Name="PaketRestore" Condition="'$(PaketRestoreDisabled)' != 'True'" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" DependsOnTargets="PaketBootstrapping">
4252

4353
<!-- Step 1 Check if lockfile is properly restored -->
4454
<PropertyGroup>
@@ -77,7 +87,7 @@
7787
</PropertyGroup>
7888

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

8393
<!-- Step 2 Detect project specific changes -->
@@ -141,14 +151,17 @@
141151

142152
<ItemGroup Condition="($(DesignTimeBuild) != true OR '$(PaketPropsLoaded)' != 'true') AND '@(PaketReferencesFileLines)' != '' " >
143153
<PaketReferencesFileLinesInfo Include="@(PaketReferencesFileLines)" >
154+
<Splits>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length)</Splits>
144155
<PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
145156
<PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
146157
<AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets>
158+
<CopyLocal Condition="'$(Splits)' == '6'">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal>
147159
</PaketReferencesFileLinesInfo>
148160
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
149161
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
150162
<PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets>
151-
<ExcludeAssets Condition="%(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
163+
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' == '6' And %(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets>
164+
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' != '6' And %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
152165
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
153166
</PackageReference>
154167
</ItemGroup>
@@ -181,19 +194,27 @@
181194
<Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
182195
<PropertyGroup>
183196
<ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec>
197+
<DetectedMSBuildVersion>$(MSBuildVersion)</DetectedMSBuildVersion>
198+
<DetectedMSBuildVersion Condition="$(MSBuildVersion) == ''">15.8.0</DetectedMSBuildVersion>
184199
</PropertyGroup>
185200
</Target>
186201

187202
<Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
188203
<ItemGroup>
189204
<_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/>
205+
<MSBuildMajorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[0])" />
206+
<MSBuildMinorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[1])" />
190207
</ItemGroup>
191208

192209
<PropertyGroup>
193210
<PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile>
194211
<ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
195-
<UseNewPack>false</UseNewPack>
196-
<UseNewPack Condition=" '$(NuGetToolVersion)' != '4.0.0' ">true</UseNewPack>
212+
<UseMSBuild15_9_Pack>false</UseMSBuild15_9_Pack>
213+
<UseMSBuild15_9_Pack Condition=" '@(MSBuildMajorVersion)' > '15' OR ('@(MSBuildMajorVersion)' == '15' AND '@(MSBuildMinorVersion)' > '8') ">true</UseMSBuild15_9_Pack>
214+
<UseMSBuild15_8_Pack>false</UseMSBuild15_8_Pack>
215+
<UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) ">true</UseMSBuild15_8_Pack>
216+
<UseNuGet4_Pack>false</UseNuGet4_Pack>
217+
<UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) ">true</UseNuGet4_Pack>
197218
<AdjustedNuspecOutputPath>$(BaseIntermediateOutputPath)$(Configuration)</AdjustedNuspecOutputPath>
198219
<AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(BaseIntermediateOutputPath)</AdjustedNuspecOutputPath>
199220
</PropertyGroup>
@@ -208,9 +229,52 @@
208229
<Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />
209230
</ConvertToAbsolutePath>
210231

211-
212232
<!-- Call Pack -->
213-
<PackTask Condition="$(UseNewPack)"
233+
<PackTask Condition="$(UseMSBuild15_9_Pack)"
234+
PackItem="$(PackProjectInputFile)"
235+
PackageFiles="@(_PackageFiles)"
236+
PackageFilesToExclude="@(_PackageFilesToExclude)"
237+
PackageVersion="$(PackageVersion)"
238+
PackageId="$(PackageId)"
239+
Title="$(Title)"
240+
Authors="$(Authors)"
241+
Description="$(Description)"
242+
Copyright="$(Copyright)"
243+
RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
244+
LicenseUrl="$(PackageLicenseUrl)"
245+
ProjectUrl="$(PackageProjectUrl)"
246+
IconUrl="$(PackageIconUrl)"
247+
ReleaseNotes="$(PackageReleaseNotes)"
248+
Tags="$(PackageTags)"
249+
DevelopmentDependency="$(DevelopmentDependency)"
250+
BuildOutputInPackage="@(_BuildOutputInPackage)"
251+
TargetPathsToSymbols="@(_TargetPathsToSymbols)"
252+
SymbolPackageFormat="symbols.nupkg"
253+
TargetFrameworks="@(_TargetFrameworks)"
254+
AssemblyName="$(AssemblyName)"
255+
PackageOutputPath="$(PackageOutputAbsolutePath)"
256+
IncludeSymbols="$(IncludeSymbols)"
257+
IncludeSource="$(IncludeSource)"
258+
PackageTypes="$(PackageType)"
259+
IsTool="$(IsTool)"
260+
RepositoryUrl="$(RepositoryUrl)"
261+
RepositoryType="$(RepositoryType)"
262+
SourceFiles="@(_SourceFiles->Distinct())"
263+
NoPackageAnalysis="$(NoPackageAnalysis)"
264+
MinClientVersion="$(MinClientVersion)"
265+
Serviceable="$(Serviceable)"
266+
FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)"
267+
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
268+
NuspecOutputPath="$(AdjustedNuspecOutputPath)"
269+
IncludeBuildOutput="$(IncludeBuildOutput)"
270+
BuildOutputFolder="$(BuildOutputTargetFolder)"
271+
ContentTargetFolders="$(ContentTargetFolders)"
272+
RestoreOutputPath="$(RestoreOutputAbsolutePath)"
273+
NuspecFile="$(NuspecFileAbsolutePath)"
274+
NuspecBasePath="$(NuspecBasePath)"
275+
NuspecProperties="$(NuspecProperties)"/>
276+
277+
<PackTask Condition="$(UseMSBuild15_8_Pack)"
214278
PackItem="$(PackProjectInputFile)"
215279
PackageFiles="@(_PackageFiles)"
216280
PackageFilesToExclude="@(_PackageFilesToExclude)"
@@ -253,7 +317,7 @@
253317
NuspecBasePath="$(NuspecBasePath)"
254318
NuspecProperties="$(NuspecProperties)"/>
255319

256-
<PackTask Condition="! $(UseNewPack)"
320+
<PackTask Condition="$(UseNuGet4_Pack)"
257321
PackItem="$(PackProjectInputFile)"
258322
PackageFiles="@(_PackageFiles)"
259323
PackageFilesToExclude="@(_PackageFilesToExclude)"

0 commit comments

Comments
 (0)