Ryujinx.CustomTasks/Ryujinx.CustomTasks/Ryujinx.CustomTasks.csproj
2022-12-15 16:06:27 +01:00

51 lines
3.1 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>true</IsPackable>
<PackageId>Ryujinx.CustomTasks</PackageId>
<Title>Ryujinx.CustomTasks</Title>
<Description>A collection of custom MSBuild tasks.</Description>
<Version>1.0.0</Version>
<RepositoryUrl>https://github.com/Ryujinx/Ryujinx.CustomTasks</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<!-- This target will run when MSBuild is collecting the files to be packaged, and we'll implement it below. This property controls the dependency list for this packaging process, so by adding our custom property we hook ourselves into the process in a supported way. -->
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
<!-- This property tells MSBuild where the root folder of the package's build assets should be. Because we are not a library package, we should not pack to 'lib'. Instead, we choose 'tasks' by convention. -->
<BuildOutputTargetFolder>tasks</BuildOutputTargetFolder>
<!-- NuGet does validation that libraries in a package are exposed as dependencies, but we _explicitly_ do not want that behavior for MSBuild tasks. They are isolated by design. Therefore we ignore this specific warning. -->
<NoWarn>NU5100</NoWarn>
<!-- Tell the SDK to generate a deps.json file -->
<GenerateDependencyFile>true</GenerateDependencyFile>
<LangVersion>8</LangVersion>
</PropertyGroup>
<ItemGroup>
<Content Include="build/Ryujinx.CustomTasks.props" PackagePath="build\" />
<Content Include="build/Ryujinx.CustomTasks.targets" PackagePath="build\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build.Utilities.Core" PrivateAssets="all" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" GeneratePathProperty="true" />
</ItemGroup>
<!-- This is the target we defined above. It's purpose is to add all of our PackageReference and ProjectReference's runtime assets to our package output. -->
<!-- Currently we have to manually specify the runtime assets, because for some reason ReferenceCopyLocalPaths is always empty. -->
<Target Name="CopyProjectReferencesToPackage" DependsOnTargets="ResolveReferences">
<ItemGroup>
<BuildOutputInPackage Include="bin\$(Configuration)\*\Microsoft.*.dll" />
</ItemGroup>
</Target>
<!-- This target adds the generated deps.json file to our package output -->
<Target Name="AddBuildDependencyFileToBuiltProjectOutputGroupOutput" BeforeTargets="BuiltProjectOutputGroup" Condition=" '$(GenerateDependencyFile)' == 'true'">
<ItemGroup>
<BuiltProjectOutputGroupOutput Include="$(ProjectDepsFilePath)" TargetPath="$(ProjectDepsFileName)" FinalOutputPath="$(ProjectDepsFilePath)" />
</ItemGroup>
</Target>
</Project>