Removed LayoutTool.csproj. Reused DownloadPackage.csproj and merged the target from LayoutTool.csproj directly into where it was used in BundledDotnetTools.targets. Added comments to DownloadPackage.csproj.
This commit is contained in:
parent
7e94deaa25
commit
049f9653cd
4 changed files with 27 additions and 42 deletions
|
@ -16,22 +16,35 @@
|
|||
</ItemGroup>
|
||||
|
||||
<Target Name="LayoutBundledTools" DependsOnTargets="SetupBundledComponents">
|
||||
<PropertyGroup>
|
||||
<PackageToRestore>%(BundledDotnetTool.Identity)</PackageToRestore>
|
||||
<PackageVersionToRestore>%(BundledDotnetTool.Version)</PackageVersionToRestore>
|
||||
<RestoredToolRoot>$([System.IO.Path]::GetFullPath('$(NuGetPackageRoot)/$(PackageToRestore)/$(PackageVersionToRestore)'))</RestoredToolRoot>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<BundledToolLayoutProject Include="$(MSBuildThisFileDirectory)LayoutTool.csproj">
|
||||
<BundledToolLayoutProject Include="$(MSBuildThisFileDirectory)DownloadPackage.csproj">
|
||||
<!-- For this unique RestoreProjectStyle, see: https://aka.ms/global-tools-nuget -->
|
||||
<Properties>
|
||||
PackageToRestore=%(BundledDotnetTool.Identity);
|
||||
PackageVersionToRestore=%(BundledDotnetTool.Version);
|
||||
RestoreProjectStyle=DotnetToolReference;
|
||||
PackageToRestore=$(PackageToRestore);
|
||||
PackageVersionToRestore=$(PackageVersionToRestore);
|
||||
TargetFramework=$(TargetFramework);
|
||||
LayoutFolder=$(SdkOutputDirectory)DotnetTools/
|
||||
RestoreProjectStyle=DotnetToolReference
|
||||
</Properties>
|
||||
</BundledToolLayoutProject>
|
||||
</ItemGroup>
|
||||
|
||||
<MSBuild
|
||||
BuildInParallel="False"
|
||||
Projects="@(BundledToolLayoutProject)">
|
||||
</MSBuild>
|
||||
<MSBuild BuildInParallel="False" Projects="@(BundledToolLayoutProject)" />
|
||||
|
||||
<ItemGroup>
|
||||
<BundledToolFiles Include="$(RestoredToolRoot)\**\*.*" />
|
||||
<BundledToolFiles Remove="$(RestoredToolRoot)\*.*" />
|
||||
</ItemGroup>
|
||||
|
||||
<Copy SourceFiles="@(BundledToolFiles)"
|
||||
DestinationFiles="@(BundledToolFiles->'$(SdkOutputDirectory)DotnetTools/$(PackageToRestore)\$(PackageVersionToRestore)\%(RecursiveDir)%(Filename)%(Extension)')"
|
||||
SkipUnchangedFiles="true"
|
||||
Condition="'$(PackageToRestore)' != ''" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
<ItemGroup>
|
||||
<!-- Use PackageDownload since we don't need to reference the package. -->
|
||||
<!-- The square brackets for the version constrain restoration to only use that exact version. -->
|
||||
<!-- See: https://learn.microsoft.com/en-us/nuget/concepts/package-versioning#floating-version-resolutions -->
|
||||
<PackageDownload Include="$(PackageToRestore)" Version="[$(PackageVersionToRestore)]" />
|
||||
<!-- Eliminate any package references injected by arcade, since we only want to download a single package. -->
|
||||
<PackageReference Remove="@(PackageReference)" />
|
||||
|
|
|
@ -403,16 +403,12 @@
|
|||
<Properties>
|
||||
PackageToRestore=%(BundledLayoutPackage.PackageName);
|
||||
PackageVersionToRestore=%(BundledLayoutPackage.PackageVersion);
|
||||
TargetFramework=%(BundledLayoutPackage.TargetFramework);
|
||||
LayoutPackageDescription=%(BundledLayoutPackage.Identity)
|
||||
TargetFramework=%(BundledLayoutPackage.TargetFramework)
|
||||
</Properties>
|
||||
</BundledLayoutPackageDownloadProject>
|
||||
</ItemGroup>
|
||||
|
||||
<MSBuild
|
||||
BuildInParallel="False"
|
||||
Projects="@(BundledLayoutPackageDownloadProject)">
|
||||
</MSBuild>
|
||||
<MSBuild BuildInParallel="False" Projects="@(BundledLayoutPackageDownloadProject)" />
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Use lowercase package name in package path -->
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="LayoutTool">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Library</OutputType>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="$(PackageToRestore)" Version="$(PackageVersionToRestore)" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="LayoutTool" DependsOnTargets="Restore" Condition="'$(PackageToRestore)' != ''">
|
||||
|
||||
<PropertyGroup>
|
||||
<RestoredToolRoot>$([System.IO.Path]::GetFullPath('$(NuGetPackageRoot)/$(PackageToRestore)/$(PackageVersionToRestore)'))</RestoredToolRoot>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<BundledToolFiles Include="$(RestoredToolRoot)\**\*.*" />
|
||||
<BundledToolFiles Remove="$(RestoredToolRoot)\*.*" />
|
||||
</ItemGroup>
|
||||
|
||||
<Copy SourceFiles="@(BundledToolFiles)"
|
||||
DestinationFiles="@(BundledToolFiles->'$(LayoutFolder)$(PackageToRestore)\$(PackageVersionToRestore)\%(RecursiveDir)%(Filename)%(Extension)')"
|
||||
SkipUnchangedFiles="true" />
|
||||
</Target>
|
||||
</Project>
|
Loading…
Add table
Reference in a new issue