I am trying to copy multiple projects DLLs generated using with Devops build pipeline into one folder:
I have below projects structure in Devops, two .NET CORE 3.1 console applications:
I wrote a build pipeline in Devops and below is the code:
trigger:
- none
pool:
vmImage: 'windows-latest'
variables:
buildProjects: '**/*.csproj'
buildConfiguration: 'Release'
solution: '**/*.sln'
ArtifactName: drop
jobs:
- job: Main_Build
displayName: Main Build
steps:
- task: UseDotNet@2
displayName: Use .Net Core 3.1.x SDK
inputs:
packageType: 'sdk'
version: '3.1.x'
- task: DotNetCoreCLI@2
displayName: Restore Packages
inputs:
command: 'restore'
projects: '$(solution)'
feedsToUse: 'select'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: 'build'
projects: '$(buildProjects)'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: Publish
inputs:
command: 'publish'
publishWebProjects: false
projects: '$(buildProjects)'
arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/PressTrust/Bin'
zipAfterPublish: false
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: '$(ArtifactName)'
publishLocation: 'Container'
It published the artifacts in below folder structure:
However if you can see PressTrustBatchJob & PressTrustPurge two individual folders are created and all the ddls are in that folder. I want to build and copy all the dlls into one folder :
How can I build the dlls and generate artifacts like PressTrust/Bin --> and all dlls of both the projects should be in the Bin folder, it shouldn't create individual project folders.
I tried to use copy task but it is also copying folders also not files inside folders only.