I\'m using VSTS as a build server, and while building I want to copy the bin folder contents to the root of the target, and also custom files from another folder to this tar
The "flattenFolders" option is also available as a YAML task parameter. The following code excerpt shows a CopyFiles@2 task which copyies the build output to the $(Build.ArtifactStagingDirectory). When I specify the option flattenFolders: true
the nested folder structure bin\release\...\My.exe
is flattened, means the exe files is copied to the root of $(Build.ArtifactStagingDirectory).
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: '$(system.defaultworkingdirectory)'
Contents: |
**\bin\$(BuildConfiguration)\**\*.exe
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
Further documentation concerning the CopyFiles task can be found here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/copy-files?view=vsts&tabs=yaml