Move DownloadPackage.csproj to the projects directory for redist. Clean up formatting in SdkTests.csproj. Removed the empty <TargetPath></TargetPath> from SdkTests.csproj to allow loading in VS.

This commit is contained in:
Michael Yanni 2023-12-12 18:19:48 -08:00
parent 396af3ea4a
commit a4235dc472
5 changed files with 34 additions and 61 deletions

View file

@ -23,7 +23,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<BundledToolLayoutProject Include="$(MSBuildThisFileDirectory)DownloadPackage.csproj"> <BundledToolLayoutProject Include="$(MSBuildThisFileDirectory)..\projects\DownloadPackage.csproj">
<!-- For this unique RestoreProjectStyle, see: https://aka.ms/global-tools-nuget --> <!-- For this unique RestoreProjectStyle, see: https://aka.ms/global-tools-nuget -->
<Properties> <Properties>
PackageToRestore=$(PackageToRestore); PackageToRestore=$(PackageToRestore);

View file

@ -17,7 +17,7 @@
<!-- Download the runtime package with the crossgen executable in it --> <!-- Download the runtime package with the crossgen executable in it -->
<ItemGroup> <ItemGroup>
<CrossGenDownloadPackageProject Include="$(MSBuildThisFileDirectory)DownloadPackage.csproj"> <CrossGenDownloadPackageProject Include="$(MSBuildThisFileDirectory)..\projects\DownloadPackage.csproj">
<Properties> <Properties>
PackageToRestore=$(RuntimeNETCrossgenPackageName); PackageToRestore=$(RuntimeNETCrossgenPackageName);
PackageVersionToRestore=$(MicrosoftNETCoreAppRuntimePackageVersion); PackageVersionToRestore=$(MicrosoftNETCoreAppRuntimePackageVersion);
@ -26,9 +26,7 @@
</CrossGenDownloadPackageProject> </CrossGenDownloadPackageProject>
</ItemGroup> </ItemGroup>
<MSBuild <MSBuild BuildInParallel="False" Projects="@(CrossGenDownloadPackageProject)">
BuildInParallel="False"
Projects="@(CrossGenDownloadPackageProject)">
</MSBuild> </MSBuild>
<!-- This PropertyGroup contains the paths to the various SDK tooling that should be <!-- This PropertyGroup contains the paths to the various SDK tooling that should be

View file

@ -399,7 +399,7 @@
DestinationPath="%(DownloadDestination)" /> DestinationPath="%(DownloadDestination)" />
<ItemGroup> <ItemGroup>
<BundledLayoutPackageDownloadProject Include="$(MSBuildThisFileDirectory)DownloadPackage.csproj"> <BundledLayoutPackageDownloadProject Include="$(MSBuildThisFileDirectory)..\projects\DownloadPackage.csproj">
<Properties> <Properties>
PackageToRestore=%(BundledLayoutPackage.PackageName); PackageToRestore=%(BundledLayoutPackage.PackageName);
PackageVersionToRestore=%(BundledLayoutPackage.PackageVersion); PackageVersionToRestore=%(BundledLayoutPackage.PackageVersion);
@ -515,7 +515,7 @@
<MakeDir Directories="$(AppHostRestorePath)" /> <MakeDir Directories="$(AppHostRestorePath)" />
<ItemGroup> <ItemGroup>
<AppHostTemplateDownloadPackageProject Include="$(MSBuildThisFileDirectory)DownloadPackage.csproj"> <AppHostTemplateDownloadPackageProject Include="$(MSBuildThisFileDirectory)..\projects\DownloadPackage.csproj">
<Properties> <Properties>
PackageToRestore=$(NETCoreAppHostPackageName); PackageToRestore=$(NETCoreAppHostPackageName);
PackageVersionToRestore=$(MicrosoftNETCoreAppHostPackageVersion); PackageVersionToRestore=$(MicrosoftNETCoreAppHostPackageVersion);
@ -526,10 +526,7 @@
</AppHostTemplateDownloadPackageProject> </AppHostTemplateDownloadPackageProject>
</ItemGroup> </ItemGroup>
<MSBuild <MSBuild BuildInParallel="False" Projects="@(AppHostTemplateDownloadPackageProject)" />
BuildInParallel="False"
Projects="@(AppHostTemplateDownloadPackageProject)">
</MSBuild>
<PropertyGroup> <PropertyGroup>
<AppHostExecutableName>AppHost$(ExeExtension)</AppHostExecutableName> <AppHostExecutableName>AppHost$(ExeExtension)</AppHostExecutableName>

View file

@ -11,14 +11,12 @@
<NoStdLib>true</NoStdLib> <NoStdLib>true</NoStdLib>
<ProducesNoOutput>true</ProducesNoOutput> <ProducesNoOutput>true</ProducesNoOutput>
</PropertyGroup> </PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" /> <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup> <PropertyGroup>
<LanguageTargets>$(MSBuildToolsPath)\Microsoft.CSharp.targets</LanguageTargets> <LanguageTargets>$(MSBuildToolsPath)\Microsoft.CSharp.targets</LanguageTargets>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<DeterministicSourcePaths>false</DeterministicSourcePaths> <DeterministicSourcePaths>false</DeterministicSourcePaths>
<TargetFramework>$(CoreSdkTargetFramework)</TargetFramework> <TargetFramework>$(CoreSdkTargetFramework)</TargetFramework>
</PropertyGroup> </PropertyGroup>
@ -46,9 +44,8 @@
</ItemGroup> </ItemGroup>
<Target Name="GetRuntimesToInstall"> <Target Name="GetRuntimesToInstall">
<ReadLinesFromFile File="/etc/os-release" <ReadLinesFromFile File="/etc/os-release" Condition="'$(OS)' != 'Windows_NT'">
Condition="'$(OS)' != 'Windows_NT'"> <Output TaskParameter="Lines" PropertyName="OsReleaseContents" />
<Output TaskParameter="Lines" PropertyName="OsReleaseContents"/>
</ReadLinesFromFile> </ReadLinesFromFile>
<!-- Set OsReleaseContents to Windows to make later comparisons easier --> <!-- Set OsReleaseContents to Windows to make later comparisons easier -->
@ -66,30 +63,31 @@
<RuntimeVersionToInstall Include="7.0.0" /> <RuntimeVersionToInstall Include="7.0.0" />
<RuntimeVersionToInstall Include="8.0.0-rc.2.23479.6" /> <RuntimeVersionToInstall Include="8.0.0-rc.2.23479.6" />
</ItemGroup> </ItemGroup>
</Target> </Target>
<Target Name="SetupLayoutWithPreviousRuntimes" DependsOnTargets="GetRuntimesToInstall"> <Target Name="SetupLayoutWithPreviousRuntimes" DependsOnTargets="GetRuntimesToInstall">
<ItemGroup> <ItemGroup>
<LayoutFilesToCopyToDotnetToTest Include="$(RedistLayoutPath)**"/> <LayoutFilesToCopyToDotnetToTest Include="$(RedistLayoutPath)**" />
<LayoutFilesToCopyToDotnetToTest> <LayoutFilesToCopyToDotnetToTest>
<DestinationPath>$(DotnetToTestPath)%(RecursiveDir)%(Filename)%(Extension)</DestinationPath> <DestinationPath>$(DotnetToTestPath)%(RecursiveDir)%(Filename)%(Extension)</DestinationPath>
</LayoutFilesToCopyToDotnetToTest> </LayoutFilesToCopyToDotnetToTest>
</ItemGroup> </ItemGroup>
<Copy SourceFiles="@(LayoutFilesToCopyToDotnetToTest)" <Copy SourceFiles="@(LayoutFilesToCopyToDotnetToTest)"
DestinationFiles="@(LayoutFilesToCopyToDotnetToTest->'%(DestinationPath)')" DestinationFiles="@(LayoutFilesToCopyToDotnetToTest->'%(DestinationPath)')"
SkipUnchangedFiles="true"/> SkipUnchangedFiles="true" />
<MSBuild Projects="$(MSBuildProjectFullPath)" <MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="InstallRuntimeToLayout" Targets="InstallRuntimeToLayout"
Properties="RuntimeVersionToInstall=%(RuntimeVersionToInstall.Identity)" Properties="RuntimeVersionToInstall=%(RuntimeVersionToInstall.Identity)"
BuildInParallel="false"/> BuildInParallel="false" />
</Target> </Target>
<Target Name="InstallRuntimeToLayout"> <Target Name="InstallRuntimeToLayout">
<PropertyGroup> <PropertyGroup>
<RuntimeTargetDirectory>$(DotnetToTestPath)shared\Microsoft.NETCore.App\$(RuntimeVersionToInstall)</RuntimeTargetDirectory> <RuntimeTargetDirectory>$(DotnetToTestPath)shared\Microsoft.NETCore.App\$(RuntimeVersionToInstall)</RuntimeTargetDirectory>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'"> <PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
<!-- Set TLS1.2 explicitly before running this. If TLS1.2 isnt' enabled by default this command may fail in some <!-- Set TLS1.2 explicitly before running this. If TLS1.2 isnt' enabled by default this command may fail in some
scenarios. Waiting on a fix to dotnet-install.ps1 to fix this in the right place. --> scenarios. Waiting on a fix to dotnet-install.ps1 to fix this in the right place. -->
@ -102,6 +100,7 @@
<InstallRuntimeCommand Condition="'$(Architecture)' != ''">$(InstallRuntimeCommand) -Architecture '$(Architecture)'</InstallRuntimeCommand> <InstallRuntimeCommand Condition="'$(Architecture)' != ''">$(InstallRuntimeCommand) -Architecture '$(Architecture)'</InstallRuntimeCommand>
<InstallRuntimeCommand>$(InstallRuntimeCommand) }"</InstallRuntimeCommand> <InstallRuntimeCommand>$(InstallRuntimeCommand) }"</InstallRuntimeCommand>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'"> <PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<InstallRuntimeCommand>/bin/bash</InstallRuntimeCommand> <InstallRuntimeCommand>/bin/bash</InstallRuntimeCommand>
<InstallRuntimeCommand>$(InstallRuntimeCommand) "$(DotNetRoot)dotnet-install.sh"</InstallRuntimeCommand> <InstallRuntimeCommand>$(InstallRuntimeCommand) "$(DotNetRoot)dotnet-install.sh"</InstallRuntimeCommand>
@ -113,8 +112,7 @@
<Exec Command="$(InstallRuntimeCommand)" <Exec Command="$(InstallRuntimeCommand)"
Condition="!Exists($(RuntimeTargetDirectory))" Condition="!Exists($(RuntimeTargetDirectory))"
IgnoreStandardErrorWarningFormat="true" IgnoreStandardErrorWarningFormat="true" />
/>
</Target> </Target>
<Target Name="RunSdkTests" DependsOnTargets="SetupLayoutWithPreviousRuntimes"> <Target Name="RunSdkTests" DependsOnTargets="SetupLayoutWithPreviousRuntimes">
@ -122,8 +120,7 @@
<!-- Isolate test working directory from higher-level Directory.Build files --> <!-- Isolate test working directory from higher-level Directory.Build files -->
<Copy SourceFiles="$(RepoRoot)TestAssets\Directory.Build.props;$(RepoRoot)TestAssets\Directory.Build.targets" <Copy SourceFiles="$(RepoRoot)TestAssets\Directory.Build.props;$(RepoRoot)TestAssets\Directory.Build.targets"
DestinationFolder="$(TestExecutionDirectory)" DestinationFolder="$(TestExecutionDirectory)"
SkipUnchangedFiles="true" SkipUnchangedFiles="true" />
/>
<!-- Set up NuGet feeds --> <!-- Set up NuGet feeds -->
<PropertyGroup> <PropertyGroup>
@ -138,9 +135,7 @@
</NugetConfigContents> </NugetConfigContents>
</PropertyGroup> </PropertyGroup>
<WriteLinesToFile File="$(GeneratedNuGetConfig)" <WriteLinesToFile File="$(GeneratedNuGetConfig)" Lines="$(NugetConfigContents)" Overwrite="true" />
Lines="$(NugetConfigContents)"
Overwrite="true" />
<!-- Allow test list to be overridden with ToolTestName property --> <!-- Allow test list to be overridden with ToolTestName property -->
<ItemGroup Condition="'$(ToolTestName)' != ''"> <ItemGroup Condition="'$(ToolTestName)' != ''">
@ -153,13 +148,10 @@
<AdditionalProperties>ToolTestName=%(SdkTest.Identity)</AdditionalProperties> <AdditionalProperties>ToolTestName=%(SdkTest.Identity)</AdditionalProperties>
</TestProjectToRun> </TestProjectToRun>
</ItemGroup> </ItemGroup>
<MSBuild Projects="@(TestProjectToRun)" <MSBuild Projects="@(TestProjectToRun)" Targets="RunTestsAsTool" BuildInParallel="true" />
Targets="RunTestsAsTool"
BuildInParallel="true"
/>
</Target> </Target>
<Target Name="RunTestsAsTool"> <Target Name="RunTestsAsTool">
<PropertyGroup> <PropertyGroup>
<ToolCommandName>testSdk$(ToolTestName)</ToolCommandName> <ToolCommandName>testSdk$(ToolTestName)</ToolCommandName>
@ -169,7 +161,6 @@
<RemoveDir Directories="$(TestLocalToolFolder)" /> <RemoveDir Directories="$(TestLocalToolFolder)" />
<MakeDir Directories="$(TestLocalToolFolder)" /> <MakeDir Directories="$(TestLocalToolFolder)" />
<MakeDir Directories="$(ArtifactsTestResultsDir)" /> <MakeDir Directories="$(ArtifactsTestResultsDir)" />
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'"> <PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
@ -180,26 +171,21 @@
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'"> <PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<ToolRunPrefix>$(ToolRunPrefix)unset MSBuildSDKsPath DOTNET_HOST_PATH DOTNET_INSTALLDIR &amp;&amp; </ToolRunPrefix> <ToolRunPrefix>$(ToolRunPrefix)unset MSBuildSDKsPath DOTNET_HOST_PATH DOTNET_INSTALLDIR &amp;&amp; </ToolRunPrefix>
</PropertyGroup> </PropertyGroup>
<Exec Command="$(ToolRunPrefix)$(RedistLayoutPath)dotnet new tool-manifest" <Exec Command="$(ToolRunPrefix)$(RedistLayoutPath)dotnet new tool-manifest"
WorkingDirectory="$(TestLocalToolFolder)" WorkingDirectory="$(TestLocalToolFolder)"
EnvironmentVariables="DOTNET_CLI_HOME=$(DOTNET_CLI_HOME)" EnvironmentVariables="DOTNET_CLI_HOME=$(DOTNET_CLI_HOME)"
IgnoreStandardErrorWarningFormat="true" /> IgnoreStandardErrorWarningFormat="true" />
<PropertyGroup> <PropertyGroup>
<SdkTestPackageVersion>$(MicrosoftNETSdkPackageVersion)</SdkTestPackageVersion> <SdkTestPackageVersion>$(MicrosoftNETSdkPackageVersion)</SdkTestPackageVersion>
<InstallToolCommand>$(RedistLayoutPath)dotnet tool install --local $(ToolCommandName)</InstallToolCommand> <InstallToolCommand>$(RedistLayoutPath)dotnet tool install --local $(ToolCommandName)</InstallToolCommand>
<InstallToolCommand>$(InstallToolCommand) --version $(SdkTestPackageVersion)</InstallToolCommand> <InstallToolCommand>$(InstallToolCommand) --version $(SdkTestPackageVersion)</InstallToolCommand>
</PropertyGroup> </PropertyGroup>
<Exec Command="$(ToolRunPrefix)$(InstallToolCommand)" <Exec Command="$(ToolRunPrefix)$(InstallToolCommand)"
WorkingDirectory="$(TestLocalToolFolder)" WorkingDirectory="$(TestLocalToolFolder)"
EnvironmentVariables="DOTNET_CLI_HOME=$(DOTNET_CLI_HOME)"/> EnvironmentVariables="DOTNET_CLI_HOME=$(DOTNET_CLI_HOME)" />
<!--<Exec Command="$(ToolRunPrefix)dotnet tool restore"
WorkingDirectory="$(TestLocalToolFolder)"
EnvironmentVariables="DOTNET_CLI_HOME=$(DOTNET_CLI_HOME)"/>-->
<PropertyGroup> <PropertyGroup>
<ResultsXmlPath>$(ArtifactsTestResultsDir)$(TestProjectName).xml</ResultsXmlPath> <ResultsXmlPath>$(ArtifactsTestResultsDir)$(TestProjectName).xml</ResultsXmlPath>
@ -216,32 +202,31 @@
<TestArgs>$(TestArgs) -testList SdkIntegrationTests</TestArgs> <TestArgs>$(TestArgs) -testList SdkIntegrationTests</TestArgs>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="('$(OS)' == 'Windows_NT') And ('$(Architecture)' == 'x86')"> <PropertyGroup Condition="('$(OS)' == 'Windows_NT') And ('$(Architecture)' == 'x86')">
<!-- Add list of tests to skip on x86 --> <!-- Add list of tests to skip on x86 -->
<TestArgs>$(TestArgs) -testConfigFile "$(MSBuildThisFileDirectory)TestsToSkipx86.xml"</TestArgs> <TestArgs>$(TestArgs) -testConfigFile "$(MSBuildThisFileDirectory)TestsToSkipx86.xml"</TestArgs>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(IslinuxPortable)' == 'true' "> <PropertyGroup Condition=" $(IslinuxPortable)' == 'true'">
<!-- Add list of tests to skip on Linux Portable --> <!-- Add list of tests to skip on Linux Portable -->
<TestArgs>$(TestArgs) -testConfigFile "$(MSBuildThisFileDirectory)TestsToSkipPortableLinux.xml"</TestArgs> <TestArgs>$(TestArgs) -testConfigFile "$(MSBuildThisFileDirectory)TestsToSkipPortableLinux.xml"</TestArgs>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" $([MSBuild]::IsOSPlatform('LINUX')) "> <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('LINUX'))">
<!-- Add list of tests to skip on Linux Portable --> <!-- Add list of tests to skip on Linux Portable -->
<TestArgs>$(TestArgs) -testConfigFile "$(MSBuildThisFileDirectory)TestsToSkipLinux.xml"</TestArgs> <TestArgs>$(TestArgs) -testConfigFile "$(MSBuildThisFileDirectory)TestsToSkipLinux.xml"</TestArgs>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" $([MSBuild]::IsOSPlatform('OSX')) "> <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))">
<!-- Add list of tests to skip on Linux Portable --> <!-- Add list of tests to skip on Linux Portable -->
<TestArgs>$(TestArgs) -testConfigFile "$(MSBuildThisFileDirectory)TestsToSkipOSX.xml"</TestArgs> <TestArgs>$(TestArgs) -testConfigFile "$(MSBuildThisFileDirectory)TestsToSkipOSX.xml"</TestArgs>
</PropertyGroup> </PropertyGroup>
<Exec Command="$(ToolRunPrefix)$(RedistLayoutPath)dotnet tool run $(ToolCommandName) -- $(TestArgs)" <Exec Command="$(ToolRunPrefix)$(RedistLayoutPath)dotnet tool run $(ToolCommandName) -- $(TestArgs)"
WorkingDirectory="$(TestLocalToolFolder)" WorkingDirectory="$(TestLocalToolFolder)"
EnvironmentVariables="DOTNET_CLI_HOME=$(DOTNET_CLI_HOME)"/> EnvironmentVariables="DOTNET_CLI_HOME=$(DOTNET_CLI_HOME)" />
</Target> </Target>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" /> <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<!-- Remove items which light up build logic which could generate warnings / errors --> <!-- Remove items which light up build logic which could generate warnings / errors -->
@ -253,11 +238,6 @@
<SwrFile Remove="@(SwrFile)" /> <SwrFile Remove="@(SwrFile)" />
</ItemGroup> </ItemGroup>
<PropertyGroup>
<TargetPath></TargetPath>
<!-- Prevent projects referencing this from trying to pass us to the compiler -->
</PropertyGroup>
<Target Name="CoreCompile" /> <Target Name="CoreCompile" />
<!-- Prevent Csc from being called --> <!-- Prevent Csc from being called -->
<Target Name="GenerateTargetFrameworkMonikerAttribute" /> <Target Name="GenerateTargetFrameworkMonikerAttribute" />
@ -266,12 +246,10 @@
<!-- Group always attempts resolve runtime, regardless of <CopyNuGetImplementations>--> <!-- Group always attempts resolve runtime, regardless of <CopyNuGetImplementations>-->
<Target Name="GetReferenceAssemblyPaths" /> <Target Name="GetReferenceAssemblyPaths" />
<!-- Don't go looking for framework reference assemblies--> <!-- Don't go looking for framework reference assemblies-->
<Target Name="GetFrameworkPaths" /> <Target Name="GetFrameworkPaths" />
<!-- ^ -->
<Target Name="GetBuildVersion" /> <Target Name="GetBuildVersion" />
<!-- For Packages projects, which use GetNuGetPackageVersionEx which depends on GetBuildVersion --> <!-- For Packages projects, which use GetNuGetPackageVersionEx which depends on GetBuildVersion -->
<Target Name="Pack" /> <Target Name="Pack" />
<Target Name="Test" DependsOnTargets="RunSdkTests" /> <Target Name="Test" DependsOnTargets="RunSdkTests" />
</Project> </Project>