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>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="LayoutBundledTools" DependsOnTargets="SetupBundledComponents">
|
<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>
|
<ItemGroup>
|
||||||
<BundledToolLayoutProject Include="$(MSBuildThisFileDirectory)LayoutTool.csproj">
|
<BundledToolLayoutProject Include="$(MSBuildThisFileDirectory)DownloadPackage.csproj">
|
||||||
|
<!-- For this unique RestoreProjectStyle, see: https://aka.ms/global-tools-nuget -->
|
||||||
<Properties>
|
<Properties>
|
||||||
PackageToRestore=%(BundledDotnetTool.Identity);
|
PackageToRestore=$(PackageToRestore);
|
||||||
PackageVersionToRestore=%(BundledDotnetTool.Version);
|
PackageVersionToRestore=$(PackageVersionToRestore);
|
||||||
RestoreProjectStyle=DotnetToolReference;
|
|
||||||
TargetFramework=$(TargetFramework);
|
TargetFramework=$(TargetFramework);
|
||||||
LayoutFolder=$(SdkOutputDirectory)DotnetTools/
|
RestoreProjectStyle=DotnetToolReference
|
||||||
</Properties>
|
</Properties>
|
||||||
</BundledToolLayoutProject>
|
</BundledToolLayoutProject>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<MSBuild
|
<MSBuild BuildInParallel="False" Projects="@(BundledToolLayoutProject)" />
|
||||||
BuildInParallel="False"
|
|
||||||
Projects="@(BundledToolLayoutProject)">
|
<ItemGroup>
|
||||||
</MSBuild>
|
<BundledToolFiles Include="$(RestoredToolRoot)\**\*.*" />
|
||||||
|
<BundledToolFiles Remove="$(RestoredToolRoot)\*.*" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Copy SourceFiles="@(BundledToolFiles)"
|
||||||
|
DestinationFiles="@(BundledToolFiles->'$(SdkOutputDirectory)DotnetTools/$(PackageToRestore)\$(PackageVersionToRestore)\%(RecursiveDir)%(Filename)%(Extension)')"
|
||||||
|
SkipUnchangedFiles="true"
|
||||||
|
Condition="'$(PackageToRestore)' != ''" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!-- Use PackageDownload since we don't need to reference the package. -->
|
<!-- 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)]" />
|
<PackageDownload Include="$(PackageToRestore)" Version="[$(PackageVersionToRestore)]" />
|
||||||
<!-- Eliminate any package references injected by arcade, since we only want to download a single package. -->
|
<!-- Eliminate any package references injected by arcade, since we only want to download a single package. -->
|
||||||
<PackageReference Remove="@(PackageReference)" />
|
<PackageReference Remove="@(PackageReference)" />
|
||||||
|
|
|
@ -394,7 +394,7 @@
|
||||||
</UrisToDownload>
|
</UrisToDownload>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<DownloadFile Condition=" '@(UrisToDownload)' != '' and %(ShouldDownload)"
|
<DownloadFile Condition="'@(UrisToDownload)' != '' and %(ShouldDownload)"
|
||||||
Uris="@(UrisToDownload)"
|
Uris="@(UrisToDownload)"
|
||||||
DestinationPath="%(DownloadDestination)" />
|
DestinationPath="%(DownloadDestination)" />
|
||||||
|
|
||||||
|
@ -403,16 +403,12 @@
|
||||||
<Properties>
|
<Properties>
|
||||||
PackageToRestore=%(BundledLayoutPackage.PackageName);
|
PackageToRestore=%(BundledLayoutPackage.PackageName);
|
||||||
PackageVersionToRestore=%(BundledLayoutPackage.PackageVersion);
|
PackageVersionToRestore=%(BundledLayoutPackage.PackageVersion);
|
||||||
TargetFramework=%(BundledLayoutPackage.TargetFramework);
|
TargetFramework=%(BundledLayoutPackage.TargetFramework)
|
||||||
LayoutPackageDescription=%(BundledLayoutPackage.Identity)
|
|
||||||
</Properties>
|
</Properties>
|
||||||
</BundledLayoutPackageDownloadProject>
|
</BundledLayoutPackageDownloadProject>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<MSBuild
|
<MSBuild BuildInParallel="False" Projects="@(BundledLayoutPackageDownloadProject)" />
|
||||||
BuildInParallel="False"
|
|
||||||
Projects="@(BundledLayoutPackageDownloadProject)">
|
|
||||||
</MSBuild>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!-- Use lowercase package name in package path -->
|
<!-- 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