我通過修改.csproj文件以包含額外的編譯符號,從我的.sln生成兩組不同的DLL文件。我用耙子來構建解決方案,並具有以下構建任務:如何調用兩次耙目標
#==========================================================
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]
你可以看到,我呼籲:在這裏建造兩次。問題是隻有第一個運行。如果我複製/粘貼我的:構建目標並調用它:Build2並更改:BuildNewDLLs第二次調用:Build2,那麼一切正常。那麼,我該如何做到這一點,以便我可以在BuildNewDLLs目標中多次調用:Build目標?
在此先感謝。
我在哪裏可以把這個代碼?我想: '任務:BuildNewDLLs => [:DeleteExistingDLLs,:構建,:UpdateCsprojFilesToBuildAsDrawableGameComponentDLLs,:: Rake.application [ '生成']重新啓用,:建立,:RevertCsprojFilesToBuildRegularDLLs]' ,其提供了一個錯誤「不要不知道如何構建「構建」任務「。 我試着將它添加到UpdateCsprojFilesToBuildAsDrawableGameComponentDLLs任務的底部,但Build仍然沒有運行。 我試着把它放在它自己的任務「:RenableBuildTask」中,並在第二次構建之前調用它,但它仍然沒有第二次運行。 我錯過了什麼? – deadlydog
我也嘗試將此代碼添加到生成任務本身的底部,但它仍然沒有第二次運行。 – deadlydog
我也試過使用:'Rake :: Task [「Build」]。reenable'建議在[link](http://stackoverflow.com/questions/577944/how-to-run-rake-tasks-from-內部耙 - 任務),但有相同的結果:( – deadlydog