如何调用耙目标的两倍 [英] How to call rake target twice

查看:164
本文介绍了如何调用耙目标的两倍的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过修改的.csproj文件以包括额外的编译符号生成从我的.sln两套不同的DLL文件。我用耙子来构建解决方案,并具有以下构建任务:

I generate two different sets of DLL files from my .sln by modifying the .csproj files to include an extra compilation symbol. I'm using rake to build the solution, and have the following Build task:

#==========================================================
desc "Builds the DPSF.sln in Release mode."
msbuild :Build do |msb|
    puts 'Building the DPSF solution...'
    msb.properties :configuration => :Release
    msb.targets [:Clean, :Rebuild]
    msb.solution = DPSF_SOLUTION_FILE_PATH
    msb.parameters "/nologo", "/maxcpucount", "/fileLogger", "/noconsolelogger"
    msb.verbosity = "quiet" # Use "diagnostic" instead of "quiet" for troubleshooting build problems.

    # Delete the build log file if the build was successful (otherwise the script will puke before this point).
    File.delete('msbuild.log')
end

然后我尝试使用生成两套DLL文件:

I then try to generate both sets of DLL files using:

desc "Builds new regular and AsDrawableGameComponent DLLs."
task :BuildNewDLLs => [:DeleteExistingDLLs, :Build, :UpdateCsprojFilesToBuildAsDrawableGameComponentDLLs, :Build, :RevertCsprojFilesToBuildRegularDLLs]

您可以看到,我呼吁:建立在这里两次。的问题是,只有第一个运行。如果我复制/粘贴我:构建目标,并将其命名为:BUILD2和变化:BuildNewDLLs致电:BUILD2第二次,然后一切工作正常。那么,如何可以让这个我可以调用:从内部构建目标,多次:BuildNewDLLs目标

You can see that I call :Build twice here. The problem is that only the first one runs. If I copy/paste my :Build target and call it :Build2 and change :BuildNewDLLs to call :Build2 the second time, then everything works fine. So how can I make it so that I can call the :Build target multiple times from within the :BuildNewDLLs target?

先谢谢了。

推荐答案

耙将默认情况下,确保每个rake任务是一劳永逸每节只执行一次。您可以重新启用具有以下code您的构建工作。

Rake will, by default, ensure that each rake task is executed once and only once per session. You can re-enable your build task with the following code.

::Rake.application['Build'].reenable

这将允许在同一个会话它被重新执行。

That will allow it to be re-executed in the same session.

这篇关于如何调用耙目标的两倍的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆