Cleanup workloads for testing logic (#60652)
authorSantiago Fernandez Madero <safern@microsoft.com>
Wed, 20 Oct 2021 23:08:17 +0000 (16:08 -0700)
committerGitHub <noreply@github.com>
Wed, 20 Oct 2021 23:08:17 +0000 (16:08 -0700)
* Cleanup workloads for testing logic

* PR Feedback

eng/testing/tests.mobile.targets
eng/testing/workloads-testing.targets [moved from src/libraries/workloads-testing.targets with 92% similarity]
src/libraries/Directory.Build.targets

index acce583..481a309 100644 (file)
     </ItemGroup>
   </Target>
 
+  <Import Project="$(MSBuildThisFileDirectory)workloads-testing.targets" />
+
   <Target Name="PublishTestAsSelfContained"
           Condition="'$(IsCrossTargetingBuild)' != 'true'"
           AfterTargets="Build"
similarity index 92%
rename from src/libraries/workloads-testing.targets
rename to eng/testing/workloads-testing.targets
index 6a8fa50..712a29a 100644 (file)
@@ -1,4 +1,10 @@
 <Project>
+
+  <PropertyGroup Condition="'$(TestUsingWorkloads)' == 'true'">
+    <!-- for non-ci builds, we install the sdk when tests are run -->
+    <InstallWorkloadForTesting Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(ArchiveTests)' == 'true'">true</InstallWorkloadForTesting>
+  </PropertyGroup>
+
   <Target Name="ProvisionSdkForWorkloadTesting"
           DependsOnTargets="_ProvisionSdkWithNoWorkload"
           Condition="!Exists($(SdkWithNoWorkloadStampPath)) or !Exists($(SdkWithWorkloadStampPath))">
     </ItemGroup>
 
     <PropertyGroup>
+      <_PackageVersion>$(PackageVersion)</_PackageVersion>
+      <_PackageVersion Condition="'$(StabilizePackageVersion)' == 'true'">$(ProductVersion)</_PackageVersion>
       <!-- Eg. Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.browser-wasm.6.0.0-dev.nupkg -->
-      <_AOTCrossNuGetPath>$(LibrariesShippingPackagesDir)Microsoft.NETCore.App.Runtime.AOT.$(NETCoreSdkRuntimeIdentifier).Cross.$(RuntimeIdentifier).$(PackageVersion).nupkg</_AOTCrossNuGetPath>
+      <_AOTCrossNuGetPath>$(LibrariesShippingPackagesDir)Microsoft.NETCore.App.Runtime.AOT.$(NETCoreSdkRuntimeIdentifier).Cross.$(RuntimeIdentifier).$(_PackageVersion).nupkg</_AOTCrossNuGetPath>
     </PropertyGroup>
 
     <Error Text="Could not find cross compiler nupkg at $(_AOTCrossNuGetPath). Found packages: @(_BuiltNuGets)"
index 29bd801..362a93e 100644 (file)
@@ -7,11 +7,6 @@
     <StrongNameKeyId Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true'">$(TestStrongNameKeyId)</StrongNameKeyId>
   </PropertyGroup>
 
-  <PropertyGroup Condition="'$(TestUsingWorkloads)' == 'true'">
-    <!-- for non-ci builds, we install the sdk when tests are run -->
-    <InstallWorkloadForTesting Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(ArchiveTests)' == 'true'">true</InstallWorkloadForTesting>
-  </PropertyGroup>
-
   <!-- resources.targets need to be imported before the Arcade SDK. -->
   <Import Project="$(RepositoryEngineeringDir)resources.targets" />
   <Import Project="..\..\Directory.Build.targets" />
     <Error Condition="'%(_AnalyzerPackFile.TargetFramework)' != 'netstandard2.0'"
            Text="Analyzers must only target netstandard2.0 since they run in the compiler which targets netstandard2.0. The following files were found to target '%(_AnalyzerPackFile.TargetFramework)': @(_AnalyzerPackFile)" />
   </Target>
-
-  <Import Project="$(MSBuildThisFileDirectory)workloads-testing.targets" />
 </Project>