forked from UbiquityDotNET/Ubiquity.NET.Utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUbiquity.NET.CommandLine.Pkg.csproj
More file actions
81 lines (71 loc) · 4.77 KB
/
Ubiquity.NET.CommandLine.Pkg.csproj
File metadata and controls
81 lines (71 loc) · 4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!--
Project to build the NuGet Meta package
NOTE:
To support a meta package where the referenced packages may not exist at build time this must use a NuSpec file directly.
The Build process for CSPROJ files will require resolving the referenced packages before it "generates" the NuSpec file.
The CSPROJ system for MSBUILD will try to restore referenced packages etc... and ultimately requires the ability to find
the listed dependencies. (They won't exist yet for this build/repo!) so either a mechanism to control build ordering EVEN
on NuGet Restore is needed, or this approach is used. Given the complexities of trying the former, this approach is used
as it is simpler.
-->
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<TargetFrameworks>net10.0;net8.0</TargetFrameworks>
<!-- Disable default inclusion of all items and analyzers. This project doesn't use/need them -->
<EnableDefaultItems>false</EnableDefaultItems>
<EnableNETAnalyzers>false</EnableNETAnalyzers>
<NoPackageAnalysis>true</NoPackageAnalysis>
<NoCommonAnalyzers>true</NoCommonAnalyzers>
<!--NuGet packaging support -->
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NuSpecFile>Ubiquity.NET.CommandLine.nuspec</NuSpecFile>
<!-- Override the name as this is the "Meta" package that references the lib and analyzers -->
<PackageId>Ubiquity.NET.CommandLine</PackageId>
<MinClientVersion>4.9.0</MinClientVersion>
<Authors>.NET Foundation,Ubiquity.NET</Authors>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Description>General use Support for Command line parsing based on System.CommandLine. This is a meta package that references the library and the associated Roslyn components</Description>
<PackageTags>Extensions,.NET,Ubiquity.NET, Console</PackageTags>
<PackageReadmeFile>PackageReadMe.md</PackageReadmeFile>
<PackageProjectUrl>https://github.com/UbiquityDotNET/Ubiquity.NET.Utils</PackageProjectUrl>
<RepositoryUrl>https://github.com/UbiquityDotNET/Ubiquity.NET.Utils.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>Apache-2.0 WITH LLVM-exception</PackageLicenseExpression>
<!-- Meta Package only, there is no "lib" folder -->
<IncludeBuiltProjectOutputGroup>false</IncludeBuiltProjectOutputGroup>
<NoWarn>$(NoWarn);NU5128</NoWarn>
</PropertyGroup>
<ItemGroup>
<None Include="PackageReadMe.md" Pack="true" PackagePath="\" />
<None Include="ReadMe.md" />
<None Include="Ubiquity.NET.CommandLine.nuspec" />
</ItemGroup>
<!-- Sanity/safety ensure NO referenced packages [Even if injected by Directory.Build.packages etc...] -->
<ItemGroup>
<PackageReference Remove="@(PackageReference)" />
</ItemGroup>
<!--
Provide the standard properties for this project to the package generation so that the NUSPEC
file will complete the pack. The DependsOnTarget is REQUIRED as MSBUILD/VS/dotnet CLI all behave differently,
especially with regard to release/automated builds. In particular the `PrepareVersioningForBuild` target
may not trigger for automated builds on restore/pack even though it does for other targets. The output
from that task is observable in the output but apparently the output ignores that it was reloaded (no
indication of this happening is provided) so when the actual generation of the Nuspec file comes along,
the PackageVersion is default. This now adds the Depends on AND an error if the property is still at the
always invalid default setting.
-->
<Target Name="SetNuspecProperties" BeforeTargets="GenerateNuspec" DependsOnTargets="PrepareVersioningForBuild">
<Error Code="UNLL001" Condition="'$(PackageVersion)'=='1.0.0'" Text="$PackageVersion has default value!" />
<PropertyGroup>
<NuspecProperties>configuration=$(Configuration)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);packageID=$(PackageID)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);version=$(PackageVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);authors=$(Authors)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);projectUrl=$(PackageProjectUrl)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);description=$(Description)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);tags=$(PackageTags)</NuspecProperties>
<NuspecProperties>$(NuSpecProperties);licExpression=$(PackageLicenseExpression)</NuspecProperties>
<NuSpecProperties>$(NuSpecProperties);tfmGroup=$(TargetFramework)</NuSpecProperties>
</PropertyGroup>
</Target>
</Project>