当 Nant 被指示从单个目标处理多个单独目标时,为什么处理多个单独目标需要更长的时间?

发布于 2024-07-27 17:34:38 字数 1128 浏览 6 评论 0原文

我有一个 nant 构建脚本,指定各种 Visual Studio 解决方案文件的编译。

<target name="compile.solution1" description="Compiles solution 1">
    <msbuild project="${src.dir}\Solution1.sln" verbosity="${build.verbosity}">
        <property name="Configuration" value="${build.config}" /> 
        <property name="OutputPath" value="${build.fullpath}/${prefix.sol1}" />
        <property name="ReferencePath" value="${assembly.dir}" />
    </msbuild>
</target>   

我在目标compile.solution1、compile.solution2、compile.solution3...compile.solution7中指定了多个解决方案

我还有另一个目标,指定要编译整堆解决方案:

<target name="compile" depends="compile.solution1, compile.solution2,
 compile.solution3, compile.solution4, compile.solution5, compile.solution6,
 compile.solution7" description="Compiles all targets" />

当我计算需要多长时间时执行目标“compile”并将其与执行每个单独的compile.solutionX目标的任务时间总和进行比较,我发现“compile”目标多花了30秒。

我不明白为什么会这样? 在我看来,“编译”目标应该充当 for 循环,它与单独执行每个目标之间的差异应该很小。

有谁知道在处理单个目标中定义的多个解决方案时,Nant 的后台是否会进行更多操作?

抱歉,这个问题的标题太可怕了……我只是不知道如何表达它。

I have a nant build script that specifies the compilation of various Visual Studio solution files.

<target name="compile.solution1" description="Compiles solution 1">
    <msbuild project="${src.dir}\Solution1.sln" verbosity="${build.verbosity}">
        <property name="Configuration" value="${build.config}" /> 
        <property name="OutputPath" value="${build.fullpath}/${prefix.sol1}" />
        <property name="ReferencePath" value="${assembly.dir}" />
    </msbuild>
</target>   

I have multiple solutions specified in targets compile.solution1, compile.solution2, compile.solution3...compile.solution7

I have another target that specifies that the whole bunch of solutions are to be compiled:

<target name="compile" depends="compile.solution1, compile.solution2,
 compile.solution3, compile.solution4, compile.solution5, compile.solution6,
 compile.solution7" description="Compiles all targets" />

When I time how long it it takes to execute the target "compile" and compare it to the sum of the time it tasks to execute each of the individual compile.solutionX targets I find that the "compile" target takes 30 seconds longer.

I don't understand why this is the case? In my mind the "compile" target should act as a for-loop and the difference between it and executing each one individually should be minimal.

Does anyone know if more goes on in the background in Nant when processing multiple solutions defined in a single target?

Sorry for the horrible title of the question....I just didn't know how to phrase it.

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

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

发布评论

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

评论(1

执着的年纪 2024-08-03 17:34:38

我猜想,当您在 depends 属性中列出多个目标时,依赖项评估需要更长的时间,并且添加到列表中的每个重要目标需要更多的额外时间。

I'd guess the dependency evaluation takes longer when you have multiple targets listed in the depends attribute, and that it takes more additional time for each non-trivial target added to the list.

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