简体   繁体   中英

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?

<PostBuildEvent>
    xcopy "$(TargetDir)afile.extension" "$(TargetDir)..\afile.extension" <!-- anything possible which only copies if newer? -->
</PostBuildEvent>

Xcopy has a switch for doing just that. /D:mdy If you provide a date it will copy only files that were created after that date. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM