Skip to content

Commit 47b98a2

Browse files
committed
Simplify code that regenerates test bindings
1 parent 1926e69 commit 47b98a2

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tests/Test.Generator.props

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<Project>
22
<PropertyGroup>
33
<GeneratorOutput>$(BaseIntermediateOutputPath)$(TestName).Bindings.timestamp</GeneratorOutput>
4+
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
5+
<PostBuildEvent>$(DotNetCmd) "$(OutputPath)$(TestGeneratorName).$(GeneratorFileExtension)"</PostBuildEvent>
46
</PropertyGroup>
57

68
<ItemGroup>
@@ -20,12 +22,9 @@
2022
<UpToDateCheckBuilt Include="$(GeneratorOutput)" Set="Bindings" />
2123
</ItemGroup>
2224

23-
<Target Name="GenerateBindings" Inputs="@(GeneratorInputs)" Outputs="$(GeneratorOutput)" AfterTargets="AfterBuild">
24-
<Exec command='$(DotNetCmd) "$(OutputPath)$(TestGeneratorName).$(GeneratorFileExtension)"' />
25-
<Touch Files="$(GeneratorOutput)" AlwaysCreate="true" />
26-
27-
<ItemGroup>
28-
<FileWrites Include="$(GeneratorOutput)"/>
29-
</ItemGroup>
25+
<Target Name="UpdateBindingsTimestamp" AfterTargets="PostBuildEvent">
26+
<Touch Files="$(GeneratorOutput)" AlwaysCreate="true">
27+
<Output TaskParameter="TouchedFiles" ItemName="FileWrites" />
28+
</Touch>
3029
</Target>
3130
</Project>

0 commit comments

Comments
 (0)