Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Address msbuild issues with cross compiled tests in helix
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronRobinsonMSFT committed Sep 12, 2018
1 parent b575d73 commit 7546d3e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/src/Interop/COM/Activator/Activator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<!-- Test unsupported outside of windows -->
<TestUnsupportedOutsideWindows>true</TestUnsupportedOutsideWindows>
<DisableProjectBuild Condition="'$(TargetsUnix)' == 'true'">true</DisableProjectBuild>
<DisableProjectBuild Condition="'$(TargetsWindows)' != 'true'">true</DisableProjectBuild>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
Expand Down
9 changes: 6 additions & 3 deletions tests/src/dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@
</When>
<When Condition="'$(OSGroup)'=='Windows_NT'">
<PropertyGroup>
<TargetsWindows>true</TargetsWindows>
<!-- Since cross compilation of test builds on Windows is possible, the
TargetsWindows property may already be set. Only set the property if
it is not already defined -->
<TargetsWindows Condition="'$(TargetsWindows)' == ''" >true</TargetsWindows>
<TestNugetRuntimeId>win-$(__BuildArch)</TestNugetRuntimeId>
</PropertyGroup>
</When>
Expand Down Expand Up @@ -111,8 +114,8 @@
</Choose>

<PropertyGroup>
<TargetRid Condition="'$(__RuntimeId)' != ''">$(__RuntimeId)</TargetRid>
<TargetRid Condition="'$(__RuntimeId)' == ''">$(TestNugetRuntimeId)</TargetRid>
<TargetRid>$(__RuntimeId)</TargetRid>
<TargetRid Condition="'$(TargetRid)' == ''">$(TestNugetRuntimeId)</TargetRid>
</PropertyGroup>

<PropertyGroup>
Expand Down
12 changes: 6 additions & 6 deletions tests/src/dir.targets
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@
<Import Project="..\dir.targets" />

<!-- Determine if this project should be built or not -->
<PropertyGroup>
<BuildAllProjects Condition=" '$(BuildAllProjects)' == ''">false</BuildAllProjects>
<PropertyGroup>
<BuildAllProjects Condition="'$(BuildAllProjects)' == ''">false</BuildAllProjects>
<_WillCLRTestProjectBuild Condition="'$(_WillCLRTestProjectBuild)' == ''">false</_WillCLRTestProjectBuild>
<_WillCLRTestProjectBuild Condition="'$(BuildAllProjects)' != true">true</_WillCLRTestProjectBuild>
<_WillCLRTestProjectBuild Condition="'$(DisableProjectBuild)' != true And '$(BuildAllProjects)' == true And '$(CLRTestPriority)' &lt;= '$(CLRTestPriorityToBuild)'">true</_WillCLRTestProjectBuild>
<_WillCLRTestProjectBuild Condition="'$(BuildAllProjects)' != 'true'">true</_WillCLRTestProjectBuild>
<_WillCLRTestProjectBuild Condition="'$(DisableProjectBuild)' != 'true' And '$(BuildAllProjects)' == 'true' And '$(CLRTestPriority)' &lt;= '$(CLRTestPriorityToBuild)'">true</_WillCLRTestProjectBuild>
</PropertyGroup>

<!-- if we have determined that there is nothing to build, overwrite the build targets so that nothing happens -->
Expand All @@ -91,7 +91,7 @@

<!-- We will use an imported build here in the instance that we're a non-sdk style project, have source that we need to build, and we are the correct priority...OR if we are being asked to build for
a test with a higher priority. -->
<Import Project="$(ToolsDir)Build.Common.targets" Condition="('$(UsingMicrosoftNETSdk)' != 'true') And ('$(CLRTestKind)'!='RunOnly') And $(_CLRTestCompilesSource) And ('$(_WillCLRTestProjectBuild)')"/>
<Import Project="$(ToolsDir)Build.Common.targets" Condition="('$(UsingMicrosoftNETSdk)' != 'true') And ('$(CLRTestKind)'!='RunOnly') And $(_CLRTestCompilesSource) And ('$(_WillCLRTestProjectBuild)' == 'true')"/>


<Import Project="..\override.targets" Condition="Exists('..\override.targets')"/>
Expand All @@ -114,7 +114,7 @@
<Import Project="CLRTest.Execute.targets" />
<Target Name="CreateExecuteScript"
AfterTargets="Build"
Condition="'$(GenerateRunScript)' != 'false' And ('$(_WillCLRTestProjectBuild)')"
Condition="'$(GenerateRunScript)' != 'false' And ('$(_WillCLRTestProjectBuild)' == 'true')"
DependsOnTargets="GenerateExecutionScriptsInternal" />

<Target Name="CopyNativeProjectBinaries">
Expand Down
2 changes: 1 addition & 1 deletion tests/src/runonly.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Target Name="CoreCompile" />

<!-- if this is a RunOnly project that has been scheduled to build, make the output directory and build any dependent projects -->
<Target Name="Build" Condition="('$(CLRTestKind)'=='RunOnly') And '$(_WillCLRTestProjectBuild)'">
<Target Name="Build" Condition="('$(CLRTestKind)'=='RunOnly') And '$(_WillCLRTestProjectBuild)' == 'true'">
<MSBuild Projects="@(ProjectReference)" />
<MakeDir ContinueOnError="false" Directories="$(OutputPath)" />
</Target>
Expand Down

0 comments on commit 7546d3e

Please sign in to comment.