-
Notifications
You must be signed in to change notification settings - Fork 7
/
SayedHa.Templates.Tasks.csproj
65 lines (52 loc) · 3.04 KB
/
SayedHa.Templates.Tasks.csproj
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
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.1</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<!-- Suppresses the warnings about the package not having assemblies in lib/*/.dll.-->
<NoPackageAnalysis>true</NoPackageAnalysis>
<!-- Change the default location where NuGet will put the build output -->
<BuildOutputTargetFolder>tasks</BuildOutputTargetFolder>
<PackageId>sayedha.templates.tasks</PackageId>
<Authors>Sayed Ibrahim Hashimi</Authors>
<Description>MSBuild task that can analyze dotnet templates</Description>
<Version>0.0.4-beta</Version>
<Copyright>Copyright 2022 © Sayed Ibrahim Hashimi. All rights reserved.</Copyright>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/sayedihashimi/dotnet-new-web</PackageProjectUrl>
<RepositoryUrl>$(PackageProjectUrl)</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<!-- set to true otherwise all project-to-project references become nuget pkg references -->
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
</PropertyGroup>
<ItemGroup>
<None Remove="build\SayedHa.Templates.Tasks.props" />
</ItemGroup>
<ItemGroup>
<Content Include="build\SayedHa.Templates.Tasks.props" PackagePath="build\">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="sample.proj" PackagePath="content\">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.1.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TemplatesShared\TemplatesShared.csproj" />
</ItemGroup>
<!-- adapted from: https://stackoverflow.com/questions/40396161/include-all-dependencies-using-dotnet-pack -->
<PropertyGroup>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);CopyProjectReferencesToPackage</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>
<Target Name="CopyProjectReferencesToPackage" AfterTargets="ResolveProjectReferences;ResolveAssemblyReferences" BeforeTargets="_GetPackageFiles">
<Message Text="Inside CopyProjectReferencesToPackage. TargetFramework='$(TargetFramework)'" Importance="high" />
<!-- Print batches for debug purposes -->
<Message Text="Batch for .nupkg: _ResolvedProjectReferencePaths = @(_ResolvedProjectReferencePaths), _ResolvedProjectReferencePaths.DestinationSubDirectory = %(_ResolvedProjectReferencePaths.DestinationSubDirectory) Filename = %(_ResolvedProjectReferencePaths.Filename) Extension = %(_ResolvedProjectReferencePaths.Extension)" Importance="High" Condition="'@(_ResolvedProjectReferencePaths)' != ''" />
<ItemGroup>
<!-- Add file to package with consideration of sub folder. If empty, the root folder is chosen. -->
<BuildOutputInPackage Include="@(_ResolvedProjectReferencePaths)" TargetPath="%(_ResolvedProjectReferencePaths.DestinationSubDirectory)" />
</ItemGroup>
</Target>
</Project>