【问题标题】:Why does processing multiple individual targets take longer when Nant is directed to process them from a single target?当 Nant 被指示从单个目标处理多个单个目标时,为什么处理多个单个目标需要更长的时间?
【发布时间】:2009-09-10 20:00:01
【问题描述】:

我有一个 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.solutionX 目标的时间总和进行比较时,我发现“编译”目标需要 30 秒更长。

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

有谁知道在处理单个目标中定义的多个解决方案时,Nant 的后台是否会发生更多事情?

对不起,这个问题的标题太糟糕了......我只是不知道如何表达它。

【问题讨论】:

    标签: optimization msbuild nant performance build-script


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-02-06
      • 1970-01-01
      • 2019-02-03
      • 2010-10-02
      • 2011-12-16
      • 2012-10-08
      • 2022-12-06
      相关资源
      最近更新 更多