我通过修改 .csproj 文件以包含额外的编译符号,从 .sln 生成两组不同的 DLL 文件。我正在使用 rake 构建解决方案,并执行以下构建任务:
#==========================================================
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 文件:
desc "Builds new regular and AsDrawableGameComponent DLLs."
task :BuildNewDLLs => [:DeleteExistingDLLs, :Build, :UpdateCsprojFilesToBuildAsDrawableGameComponentDLLs, :Build, :RevertCsprojFilesToBuildRegularDLLs]
你可以看到我在这里调用了 :Build 两次。问题是只有第一个运行。如果我复制/粘贴我的 :Build 目标并将其称为 :Build2 并更改 :BuildNewDLLs 以第二次调用 :Build2 ,那么一切都会正常。那么如何才能从 :BuildNewDLLs 目标中多次调用 :Build 目标呢?
提前致谢。
我知道这是一个老问题,但我只花了 15 分钟来解决这个问题,所以为了文档的缘故,这里是:
您可以致电reenable
从您希望重新启用的同一任务中。并且自从task
块产生当前任务作为第一个参数,你可以这样做:
task :thing do |t|
puts "hello"
t.reenable
end
现在这有效了:
rake thing thing
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)