我通过修改.csproj文件以包含额外的编译符号,从我的.sln生成两个不同的DLL文件集。我正在使用rake来构建解决方案,并拥有以下Build任务:
#==========================================================
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 目标呢?
提前感谢。
task :BuildNewDLLs => [:DeleteExistingDLLs, :Build, :UpdateCsprojFilesToBuildAsDrawableGameComponentDLLs, ::Rake.application['Build'].reenable, :Build, :RevertCsprojFilesToBuildRegularDLLs]
但是出现了错误“不知道如何构建任务'Build'”。我尝试将其添加到:UpdateCsprojFilesToBuildAsDrawableGameComponentDLLs任务的底部,但是Build仍然没有运行。我还尝试将其放在自己的任务":RenableBuildTask"中,并在第二个:Build之前调用它,但第二次仍然没有运行。我错过了什么吗? - deadlydog::Rake.application['Build'].invoke
- Daniel Evanstask :ReBuild do ::Rake.application['Build'].reenable ::Rake.application['Build'].invoke end
并将:ReBuild
替换为两个:Build
目标,它仍然只在第一次构建时进行构建,而不会第二次运行。它只是在执行:UpdateCsprojFilesToBuildAsDrawableGameComponentDLLs
任务后跳过到:RevertCsprojFilesToBuildRegularDLLs
任务。还有其他想法吗?非常感谢你迄今为止提供的帮助 :) - deadlydog