2009-07-06 1 views
0

私たちの展開プロセスをやり直す際、私は既存のバッチファイルの代わりにMSBuildプロジェクトを使用しました。すべての主要な要素が整っていて、私は1つまたは2つのステップを切り抜くことを考えていましたが、邪魔になりました。MSBuild煩わしさ(または私の面識のないこと)

私はCombinePathタスクを使用してOutputPathというプロパティを作成しています。作成した後に問題なくアクセスできますが、私の使い方を忘れてしまいました。次のようにしてください:

<CombinePath BasePath ="$(DeployFolderRoot)" Paths ="$(DeployReleaseFolder)$(ReleaseFolderFormatted)" > 
    <Output TaskParameter ="CombinedPaths" ItemName ="OutputFolder"/> 
</CombinePath> 

<MakeDir Directories="@(OutputFolder)" /> 
<MakeDir Directories="@(OutputFolder)\Foo" /> 
<MakeDir Directories="@(OutputFolder)\Bar" /> 

私は配列を参照しているため、文字列で連結しようとしているため、コマンド2と3が失敗します。プロパティを作成して@(OutputFolder)を割り当てると、$ accessorで参照できるプロパティではなく、別のアイテムグループになります。私は醜い回避策を持っているが、私はこれを幾分クリアしたい。

おかげで、

-Jose

答えて

1

DOH!間違いなく、Output要素に間違った属性を使用しました。

<CombinePath BasePath ="$(DeployFolderRoot)" Paths ="$(DeployReleaseFolder)$(ReleaseFolderFormatted)" > 
    <Output TaskParameter ="CombinedPaths" PropertyName="OutputFolder"/> 
</CombinePath> 

<MakeDir Directories="$(OutputFolder)" /> 
<MakeDir Directories="$(OutputFolder)\Foo" /> 
<MakeDir Directories="$(OutputFolder)\Bar" /> 
2

私は正確に答えのわからないが、ここでアイデアです:基本的に

<CombinePath BasePath ="$(DeployFolderRoot)" Paths ="$(DeployReleaseFolder)$(ReleaseFolderFormatted)" > 
    <Output TaskParameter ="CombinedPaths" ItemName ="OutputFolder"/> 
</CombinePath> 

<OutputFolder Include="$(DeployFolderRoot)$(DeployReleaseFolder)$(ReleaseFolderFormatted)\Foo" /> 
<OutputFolder Include="$(DeployFolderRoot)$(DeployReleaseFolder)$(ReleaseFolderFormatted)\Bar" /> 

<MakeDir Directories="@(OutputFolder)" /> 

、あなたは、彼らは単にリストに追加されるパスとOutputFolderアイテムを作成する場合。これは要素btwになければならず、Include = ""を使用する必要があります。

関連する問題