Copy all files and folders using msbuild

后端 未结 10 1859
感动是毒
感动是毒 2020-11-30 22:22

Just wondering if someone could help me with some msbuild scripts that I am trying to write. What I would like to do is copy all the files and sub folders from a folder to

10条回答
  •  南笙
    南笙 (楼主)
    2020-11-30 22:51

    If you are working with typical C++ toolchain, another way to go is to add your files into standard CopyFileToFolders list

    
      
        $(MainOutputDirectory)\Resources\materials\%(RecursiveDir)
      
    
    

    Besides being simple, this is a nice way to go because CopyFilesToFolders task will generate appropriate inputs, outputs and even TLog files therefore making sure that copy operations will run only when one of the input files has changed or one of the output files is missing. With TLog, Visual Studio will also properly recognize project as "up to date" or not (it uses a separate U2DCheck mechanism for that).

提交回复
热议问题