[英]msbuild PostBuildEvents copy if newer
Is it possible to define copy events in PostBuildEvents section which only copies the file if the file is newer? 是否可以在PostBuildEvents部分中定义仅复制文件(如果文件较新)的复制事件?
<PostBuildEvent>
xcopy "$(TargetDir)afile.extension" "$(TargetDir)..\afile.extension" <!-- anything possible which only copies if newer? -->
</PostBuildEvent>
Xcopy has a switch for doing just that. Xcopy为此提供了一个开关。 /D:mdy If you provide a date it will copy only files that were created after that date.
/ D:mdy如果提供日期,它将仅复制该日期之后创建的文件。 If you don't provide a date it will copy only those files on the source that are newer than those in the target.
如果您不提供日期,它将仅复制源文件中比目标文件中新的文件。 You might want look at Robocopy,as it has many more options than xcopy.
您可能想看看Robocopy,因为它比xcopy有更多的选择。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.