团队建设目标未执行

发布于 2024-11-17 02:07:25 字数 1322 浏览 2 评论 0原文

我有一个 tfs 2008 版本,需要添加 WiX 编译。

目前,构建执行并编译并将所有输出复制到以下目标中的放置位置,

<Target Name="AfterCompile"> .... </Target>

我在其正下方添加了另一个目标,如下所示:

<UsingTask TaskName="HeatDirectory" AssemblyFile="$(WixTasksPath)" />

<Target Name="BuildMsi" DependsOnTargets="AfterCompile">
  <Message Text="Start harvesting Website files for Wix compliation" />
  <HeatDirectory
                ToolPath="$(WixToolPath)"
                Directory="$(DropLocation)\Latest\x86\Release\_PublishedWebsites\IFMA.MasterPlan.Web"
                GenerateGuidsNow="yes"
                ComponentGroupName="Web"
                OutputFile="$(MSBuildProjectDirectory)\Setup\Product\Fragments\wwwfiles.wxs"
                SuppressFragments="yes"
                DirectoryRefId="WebRoot"
                KeepEmptyDirectories="yes"
                PreprocessorVariable="var.WebRoot"
                SuppressRegistry="yes"
                SuppressRootDirectory="yes"
                SuppressCom="yes"
                   />

  <Message Text="Finished harvesting Website files for Wix compliation" />

</Target>

BuildMsi 目标从未执行,但 AfterCompile 目标肯定会执行。

BuildMsi 未在默认构建目标中列出 但我认为由于它依赖于 AfterCompile ,因此它会在它之后执行。

我在这里缺少什么?

I have a tfs 2008 build that I need to add WiX compliation to.

Currently the build executes and compiles and copies all output to a drops location in the following target

<Target Name="AfterCompile"> .... </Target>

I have added another target directly below it that looks like the following

<UsingTask TaskName="HeatDirectory" AssemblyFile="$(WixTasksPath)" />

<Target Name="BuildMsi" DependsOnTargets="AfterCompile">
  <Message Text="Start harvesting Website files for Wix compliation" />
  <HeatDirectory
                ToolPath="$(WixToolPath)"
                Directory="$(DropLocation)\Latest\x86\Release\_PublishedWebsites\IFMA.MasterPlan.Web"
                GenerateGuidsNow="yes"
                ComponentGroupName="Web"
                OutputFile="$(MSBuildProjectDirectory)\Setup\Product\Fragments\wwwfiles.wxs"
                SuppressFragments="yes"
                DirectoryRefId="WebRoot"
                KeepEmptyDirectories="yes"
                PreprocessorVariable="var.WebRoot"
                SuppressRegistry="yes"
                SuppressRootDirectory="yes"
                SuppressCom="yes"
                   />

  <Message Text="Finished harvesting Website files for Wix compliation" />

</Target>

The BuildMsi target is never executed but the AfterCompile one definitly is.

The BuildMsi isn't listed in the default build targets

but I thought that since it has a dependency on AfterCompile it would be executed after it.

What am I missing here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回忆凄美了谁 2024-11-24 02:07:25

DependsOnTargets 列出了您的目标运行之前必须执行的目标,它不会强制您的目标在目标列表运行后运行。

请参阅:http://msdn.microsoft.com/ en-us/library/t50z2hka(v=VS.90).aspx

如果您使用的是 MSBuild 4.0,AfterTargets 属性是您所需要的:

AfterTargets:可选属性。

以分号分隔的目标列表
名称。当指定时,表明
该目标应该在
指定的一个或多个目标。这
让项目作者扩展一个
现有的一组目标没有
直接修改它们。

或者,您可以使用目标注入,这基本上是覆盖 .proj 文件中的 CompileDependsOn 属性以在末尾包含您的目标。您需要在导入公共目标文件后声明此属性,以确保它是该属性的最后一个定义。

<PropertyGroup>
    <CompileDependsOn>
        $(CompileDependsOn);
        MyCustomTarget
    </CompileDependsOn>
</PropertyGroup>

有关更多详细信息,请参阅“如何扩展 Visual Studio 构建过程”

DependsOnTargets lists the targets that must be executed before your target can run, it does not force your target to run after the list of targets run.

See: http://msdn.microsoft.com/en-us/library/t50z2hka(v=VS.90).aspx

If you're using MSBuild 4.0, AfterTargets attribute is what you need:

AfterTargets: Optional attribute.

A semicolon-separated list of target
names. When specified, indicates that
this target should run after the
specified target or targets. This
lets the project author extend an
existing set of targets without
modifying them directly.

Alternatively you can use target injection, which basically is overriding the CompileDependsOn property in your .proj file to include your target at the end. You need to declare this property after the imports of the common target files to ensure it is the last definition of the property.

<PropertyGroup>
    <CompileDependsOn>
        $(CompileDependsOn);
        MyCustomTarget
    </CompileDependsOn>
</PropertyGroup>

See "How to extend the visual studio build process" for more details.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文