我正在尝试为我的所有项目创建一个自动构建,我的一些项目已经有了构建这些项目的MSBuild.xml文件。
是否有通过其他MSBuild.xml文件构建这些MSbuild的选项?
发布于 2014-03-04 17:17:35
可以,停那儿吧。
<Target Name="BuildAnOutsideMSBuild">
<MSBuild Projects="$(WorkingCheckout)\Another_Solution_Or_CsProj_or_MsBuildFile.proj" Targets="Build" Properties="Configuration=$(Configuration)">
<Output TaskParameter="TargetOutputs" ItemName="TargetOutputsItemName"></Output>
</MSBuild>
<Message Text="Build completed" />
</Target>如果您的“子项目”需要任何类型的路径(文件名或文件夹名)。您不能发送相对路径。你必须把整条路都送下去。(一个例外是,如果parent.sln和child.sln存在于同一个directory..but中,而在我的经验中并不经常发生这种情况)
就像这样:
<ConvertToAbsolutePath Paths="..\"> <!-- Some relative path here -->
<Output TaskParameter="AbsolutePaths" PropertyName="MyAbsolutionPathProperty"/>
</ConvertToAbsolutePath>
<Message Text="'MyAbsolutionPathProperty' = '$(MyAbsolutionPathProperty)'" /> 现在,您可以将"MyAbsolutionPathProperty“作为参数发送到”MSBuild .proj外部“。
https://stackoverflow.com/questions/22165427
复制相似问题