TeamBuild에서 MSBuild로 값을 전달하십시오
-
20-08-2019 - |
문제
TFS TeamBuild에서 실행중인 빌드가 있습니다. TFSBuild.proj가 구축 한 각 프로젝트에 대해 실행되는 MSBuild로 재산을 전달하고 싶습니다.
예시:
tfsbuild.proj
<PropertyGroup>
<Version>0.0.0.0</Version>
</PropertyGroup>
<Target Name="BuildNumberOverrideTarget"
DependsOnTargets="AfterInitializeWorkspace">
<!--Code that loads the version from a file (removed).-->
<PropertyGroup>
<!--Save off the version.-->
<Version>$(TxCompleteVersion)</Version>
</PropertyGroup>
mywixprojectfile.wixproj
<Target Name="BeforeBuild">
<PropertyGroup>
<!--If Version is defined then use that.
Else just use all zeros to show that this is a developer built version-->
<CurrentVersion Condition="'$(Version)' == ''" >0.0.0.0</CurrentVersion>
<CurrentVersion Condition="'$(Version)' != ''" >$(Version)</CurrentVersion>
</PropertyGroup>
<Message Condition="'$(Version)' == ''"
Text="Version info is empty (i.e. a developer build). Version set to $(CurrentVersion)"/>
</Target>
mywixprojectfile.wixproj가 매번 $ (version)가 공백이라는 메시지를 보여주는 메시지를 작성하면 매번 인쇄된다는 메시지를 작성합니다.
tfsbuild.proj 속성을 볼 수있는 프로젝트 파일을 가져올 수있는 어쨌든 있습니까?
백 카노
해결책 2
이것은 SolutionTobuild 태그의 특성 메타 데이터를 통해 수행됩니다. 예를 들어:
<ItemGroup>
<SolutionToBuild Include="$(BuildProjectFolderPath)\ChangeThisOne.sln">
<Targets></Targets>
<Properties>Change=True</Properties>
</SolutionToBuild>
<SolutionToBuild Include="$(BuildProjectFolderPath)\ChangeThisToo.sln">
<Targets></Targets>
<Properties>Change=True</Properties>
</SolutionToBuild>
<SolutionToBuild Include="$(BuildProjectFolderPath)\DontChangeThis.sln">
<Targets></Targets>
<Properties>Don'tChange=False</Properties>
</SolutionToBuild>
</ItemGroup>
다른 팁
Im Wix의 전문가는 아니지만 나는 이것을 찾았고 당신이 그것을 시도 할 수 있다고 생각했습니다.
옵션 1
msbuild를 사용하여 mywixprojectfile.wixproj를 직접 호출하고 버전을 속성으로 호출하십시오.
옵션 2
Wix의 빌드를 자체 자체 자체 포함 스크립트로 추상화 한 다음 MSBuild를 사용하여 직접 호출하고 필요한 모든 속성을 전달하십시오. 이 작업을 수행하는 전체 구현이있는 블로그가 있습니다 http://blog.newagesolution.net/2008/06/how-to-use-msbuild-and-wix-to-msi.html 그것은 당신에게 관심이있을 수 있습니다.
제휴하지 않습니다 StackOverflow