0

MSBuild 拡張パックを使用しています。ビルド ディレクトリの内容全体をファイル システムの別のディレクトリにコピーしたいと考えています。宛先ディレクトリの名前を変更したくありません。内容を置き換えるだけです。msbuild extensionpack に慣れていない可能性がありますが、これは簡単なようで、Web 上ですぐに入手できるドキュメントを見つけることができませんでした。

ビルドが成功した後、継続的インテグレーション環境に自動的にデプロイされるサービスをセットアップしようとしています。

4

1 に答える 1

1

As far as I remember, you'll need to clear and copy in separate steps. So do the delete/purge first, then copy over. I wasn't able (at the time I last did) to find a way to "overwrite". This actually worked better for us b/c one build may remove files that a previous one contained, so we wouldn't want them to "linger".

To delete, try (assuming DeploymentDesintationPath is a property with the path):

<MSBuild.ExtensionPack.FileSystem.Folder
     TaskAction="RemoveContent" 
     path="$(DeploymentDestinationPath)" />

And then copy (notice you need to populate an itemgroup for both the source and the destination)

<ItemGroup>    
      <DeploymentSourceFiles
           Include="$(BuildFolder)\**\*"
      />  
      <DeploymentDestinationFiles
           Include="@(DeploymentSourceFiles->
           '$(DeploymentDestinationPath)\%(RecursiveDir)%(Filename)%(Extension)')"
      />  
</ItemGroup>

<Copy SourceFiles="@(DeploymentSourceFiles)"
     DestinationFiles="@(DeploymentDestinationFiles)" />

I haven't done this in a few months, so pardon if any of these examples require a bit of tweaking.

于 2011-01-27T21:55:07.033 に答える