2009-07-06 1 views
0

배포 프로세스를 다시 수행하면서 기존 배치 파일 대신 MSBuild 프로젝트를 사용했습니다. 모든 주요 요소가 제 위치에 있으며, 나는 한 두 걸음을 자르려고했지만 걸림돌을 만났습니다.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)를 할당하면 다른 항목 그룹이 생기고 $ 접근 자로 참조 할 수있는 속성은 생성되지 않습니다. 나는 추악한 해결 방법을 가지고 있지만, 이것을 다소 깨끗하게하고 싶다.

감사합니다,

답변

1

DOH을

-Jose! 확실히 무지, 출력 요소에 잘못된 속성을 사용했습니다.

<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 = ""를 사용해야합니다.