Skip to content

Commit

Permalink
Use property for placeholder simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
jviau committed Dec 5, 2024
1 parent 623f5b5 commit 03c6985
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions eng/build/Engineering.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@

<Import Project="$(MSBuildThisFileDirectory)Release.props" />

<!-- Uncomment below to run with placeholder simulation enabled. -->
<!-- <Import Project="$(MSBuildThisFileDirectory)PlaceholderSimulation.props" /> -->
<!-- To use PlaceholderSimulation:
1. Set env variable PlaceholderSimulation=true
2. OR build with -p:PlaceholderSimulation=true
-->
<Import Project="$(MSBuildThisFileDirectory)PlaceholderSimulation.props" Condition="'$(PlaceholderSimulation)' == 'true'"/>

</Project>
5 changes: 5 additions & 0 deletions eng/build/PlaceholderSimulation.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>

<PropertyGroup>
<!-- This should already be true. But adding here for good measure. -->
<PlaceholderSimulation>true</PlaceholderSimulation>
<DefineConstants>$(DefineConstants)PLACEHOLDER_SIMULATION;</DefineConstants>
</PropertyGroup>
Expand All @@ -9,4 +10,8 @@
<Error Text="PlaceholderSimulation is enabled, but CI is true. PlaceholderSimulation is not allowed in CI." />
</Targets>

<Targets Name="_PlaceholderFailIfWrongValue" BeforeTargets="Build" Condition="'$(PlaceholderSimulation)' != 'true'">
<Error Text="Expected 'PlaceholderSimulation' to be 'true'. Actual value: '$(PlaceholderSimulation)'." />
</Targets>

</Project>

0 comments on commit 03c6985

Please sign in to comment.