Sharpmake
Sharpmake copied to clipboard
Support IsFileCopy and IsRecurse in BuildStepCopy under MSBuild for parity with FASTBuild
trafficstars
- Use xcopy instead of robocopy for copying single file when IsFileCopy is true
- Specify proper flag for robocopy when IsRecurse is true
Example cases that this change fixes under MSBuild, which work as expected with FASTBuild.
- On MSBuild only top level directory will be copied without subdirectories, despite IsRecurse being set to true by default.
// directory copy
conf.EventPostBuildExe.Add(new Configuration.BuildStepCopy(
sourcePath: "[project.SourceRootPath]\\directory",
destinationPath: "[conf.TargetPath]\\directory",
fileCopy: false
));
- On MSBuild file will not be copied at all. Workaround for compatibility with FASTBuild was to specify only source/destination directories and copy pattern with specific filename.
// single file copy
conf.EventPostBuildExe.Add(new Configuration.BuildStepCopy(
sourcePath: "[project.SourceRootPath]\\executable.exe",
destinationPath: "[conf.TargetPath]\\executable.exe",
fileCopy: true
));
Please note that this change will affect projects that depend on BuildStepCopy not doing recursive copy under MSBuild - these projects will now have to explicitly set IsRecurse to false.