我通过修改 .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 目标呢?
提前致谢。