-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
NuGet.targets
43 lines (37 loc) · 2.01 KB
/
NuGet.targets
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
<Project>
<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>HAVIT</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>logo.png</PackageIcon>
</PropertyGroup>
<ItemGroup>
<None Include="../logo.png" Pack="true" PackagePath="" Visible="false" />
</ItemGroup>
<!-- SourceLink -->
<PropertyGroup>
<!-- Source: https://github.com/dotnet/sourcelink/#using-sourcelink -->
<!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- Optional: Include the PDB in the built .nupkg -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<!-- Publish NuGet -->
<PropertyGroup>
<NuGetPublishFolder Condition="'$(NuGetPublishFolder)' == ''">PublicNuGets</NuGetPublishFolder>
<PackageOutputPath Condition="'$(PublishDirectory)' != ''">$(PublishDirectory)\$(NuGetPublishFolder)</PackageOutputPath>
</PropertyGroup>
<!-- /Publish NuGet -->
<Target Name="HavitCheckPackageIsNotEmpty" BeforeTargets="GenerateNuspec" AfterTargets="_CalculateInputsOutputsForPack" Condition=" $(GeneratePackageOnBuild) == 'true' ">
<!-- _BuildOutputInPackage - výstup buildu -->
<!-- _PackageFiles - content -->
<!-- Nereflektujeme zde _PackageFilesToExclude. -->
<!-- _PackageFiles obsahuje logo.png, proto je test na jedničku, nikoliv na nulu -->
<PropertyGroup>
<CheckPackageIsNotEmpty Condition=" $(CheckPackageIsNotEmpty) == '' ">true</CheckPackageIsNotEmpty>
</PropertyGroup>
<Error Text="Generated nuget package is empty." Condition="( ($(CheckPackageIsNotEmpty) == 'true') And @(_BuildOutputInPackage->Count()) == 0) And (@(_PackageFiles->Count()) <= 1)" />
</Target>
</Project>