|
13 | 13 | <MakeDir Directories="$(DestDir)"/>
|
14 | 14 | </Target>
|
15 | 15 |
|
16 |
| - <!--don't let regenerating these files trigger builds--> |
17 |
| - <UsingTask TaskName="MakeSameWriteTime" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" > |
18 |
| - <ParameterGroup> |
19 |
| - <SourceFile Required="true" ParameterType="System.String"/> |
20 |
| - <DestFile Required="true" ParameterType="System.String"/> |
21 |
| - </ParameterGroup> |
22 |
| - <Task> |
23 |
| - <Code Type="Fragment" Language="cs"> |
24 |
| - <![CDATA[ |
25 |
| - System.IO.File.SetLastWriteTime( DestFile, System.IO.File.GetLastWriteTime( SourceFile ) ); |
26 |
| - ]]> |
27 |
| - </Code> |
28 |
| - </Task> |
29 |
| - </UsingTask> |
30 |
| - |
31 | 16 | <!--see py/py.mk under #qstr data-->
|
32 | 17 | <Target Name="MakeQstrData" DependsOnTargets="MakeDestDir">
|
33 | 18 | <PropertyGroup>
|
34 | 19 | <PreProc>$(DestDir)qstrdefs.preprocessed.h</PreProc>
|
35 | 20 | <QstrDefs>$(MsBuildThisFileDirectory)..\..\unix\qstrdefsport.h</QstrDefs>
|
36 | 21 | <DestFile>$(DestDir)qstrdefs.generated.h</DestFile>
|
37 | 22 | </PropertyGroup>
|
38 |
| - <Exec Command="cl /I$(SrcDir) /I$(MsBuildThisFileDirectory).. /Fi$(PreProc) /P $(SrcDir)qstrdefs.h"/> |
39 |
| - <Exec Command="python $(SrcDir)makeqstrdata.py $(PreProc) $(QstrDefs) > $(DestFile)"/> |
40 |
| - <MakeSameWriteTime SourceFile="$(MsBuildThisFile)" DestFile="$(DestFile)"/> |
| 23 | + <Exec Command="cl /nologo /I$(SrcDir) /I$(MsBuildThisFileDirectory).. /Fi$(PreProc) /P $(SrcDir)qstrdefs.h"/> |
| 24 | + <Exec Command="python $(SrcDir)makeqstrdata.py $(PreProc) $(QstrDefs) > $(DestFile).tmp"/> |
| 25 | + <Exec Command="fc /B $(DestFile).tmp $(DestFile) > NUL 2>&1" IgnoreExitCode="true"> |
| 26 | + <Output TaskParameter="ExitCode" PropertyName="FilesDiffer" /> |
| 27 | + </Exec> |
| 28 | + <Copy SourceFiles="$(DestFile).tmp" DestinationFiles="$(DestFile)" Condition="'$(FilesDiffer)'!='0'"/> |
41 | 29 | </Target>
|
42 | 30 |
|
43 | 31 | <!--see py/py-version.sh-->
|
|
69 | 57 | <Lines Include="#define MICROPY_GIT_HASH "$(GitHash)""/>
|
70 | 58 | <Lines Include="#define MICROPY_BUILD_DATE "$([System.DateTime]::Now.ToString(`yyyy-MM-dd`))""/>
|
71 | 59 | </ItemGroup>
|
72 |
| - <WriteLinesToFile Lines="@(Lines)" File="$(DestFile)" Overwrite="true"/> |
73 |
| - <MakeSameWriteTime SourceFile="$(MsBuildThisFile)" DestFile="$(DestFile)"/> |
| 60 | + <WriteLinesToFile Lines="@(Lines)" File="$(DestFile).tmp" Overwrite="true"/> |
| 61 | + <Exec Command="fc /B $(DestFile).tmp $(DestFile) > NUL 2>&1" IgnoreExitCode="true"> |
| 62 | + <Output TaskParameter="ExitCode" PropertyName="FilesDiffer" /> |
| 63 | + </Exec> |
| 64 | + <Copy SourceFiles="$(DestFile).tmp" DestinationFiles="$(DestFile)" Condition="'$(FilesDiffer)'!='0'"/> |
74 | 65 | </Target>
|
75 | 66 |
|
76 | 67 | </Project>
|
0 commit comments