|
1 | | -<Project Sdk="Microsoft.NET.Sdk"> |
| 1 | +<Project Sdk="Microsoft.NET.Sdk"> |
2 | 2 |
|
3 | | - <PropertyGroup> |
4 | | - <TargetFramework>net5.0</TargetFramework> |
5 | | - <GeneratePackageOnBuild>True</GeneratePackageOnBuild> |
6 | | - <PackageId>DotNetParser</PackageId> |
7 | | - <Authors>Misha</Authors> |
8 | | - <Company>MishaProductions</Company> |
9 | | - <Product>DotNetParser</Product> |
10 | | - <Description>Allows to run C# applications in C#.</Description> |
11 | | - <RepositoryUrl>https://github.com/MishaTY/DotNetParser</RepositoryUrl> |
12 | | - </PropertyGroup> |
| 3 | + <PropertyGroup> |
| 4 | + <TargetFramework>net5.0</TargetFramework> |
| 5 | + <GeneratePackageOnBuild>True</GeneratePackageOnBuild> |
| 6 | + <PackageId>DotNetParser</PackageId> |
| 7 | + <Authors>Misha</Authors> |
| 8 | + <Company>MishaProductions</Company> |
| 9 | + <Product>DotNetParser</Product> |
| 10 | + <Description>Allows to run C# applications in C#.</Description> |
| 11 | + <RepositoryUrl>https://github.com/MishaTY/DotNetParser</RepositoryUrl> |
| 12 | + <Version>0.5.9</Version> |
| 13 | + </PropertyGroup> |
13 | 14 |
|
14 | | - <ItemGroup> |
15 | | - <ProjectReference Include="..\LibDotNetParser\LibDotNetParser.csproj" /> |
16 | | - </ItemGroup> |
| 15 | + <ItemGroup> |
| 16 | + <ProjectReference Include="..\LibDotNetParser\LibDotNetParser.csproj" PrivateAssets="All" /> |
| 17 | + </ItemGroup> |
17 | 18 |
|
| 19 | + <PropertyGroup> |
| 20 | + <TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput> |
| 21 | + <IsPublishable>True</IsPublishable> |
| 22 | + </PropertyGroup> |
| 23 | + |
| 24 | + <Target Name="CopyProjectReferencesToPackage" DependsOnTargets="BuildOnlySettings;ResolveReferences"> |
| 25 | + <ItemGroup> |
| 26 | + <!-- Filter out unnecessary files --> |
| 27 | + <_ReferenceCopyLocalPaths Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference')->WithMetadataValue('PrivateAssets', 'All'))" /> |
| 28 | + </ItemGroup> |
| 29 | + |
| 30 | + <!-- Print batches for debug purposes --> |
| 31 | + <Message Text="Batch for .nupkg: ReferenceCopyLocalPaths = @(_ReferenceCopyLocalPaths), ReferenceCopyLocalPaths.DestinationSubDirectory = %(_ReferenceCopyLocalPaths.DestinationSubDirectory) Filename = %(_ReferenceCopyLocalPaths.Filename) Extension = %(_ReferenceCopyLocalPaths.Extension)" Importance="High" Condition="'@(_ReferenceCopyLocalPaths)' != ''" /> |
| 32 | + |
| 33 | + <ItemGroup> |
| 34 | + <!-- Add file to package with consideration of sub folder. If empty, the root folder is chosen. --> |
| 35 | + <BuildOutputInPackage Include="@(_ReferenceCopyLocalPaths)" TargetPath="%(_ReferenceCopyLocalPaths.DestinationSubDirectory)" /> |
| 36 | + </ItemGroup> |
| 37 | + </Target> |
18 | 38 | </Project> |
0 commit comments