我正在使用scons構建項目。工作得很好。但是我們的構建命令只是向stdout輸出結果,而我需要使這對我們的軟件團隊更有用。將scons構建器輸出重定向到文件
下面是我想要的行爲,按優先順序排列。任何人都可以幫我實施它們嗎?
沒有真正的改善:
scons > build-summary.txt
- 這只是標準輸出重定向到一個文件中。是的,如果我記得我的系統(WinXP)上適當的語法,我也可以重定向stderr,但它不能幫助我將詳細的構建輸出與正在構建的文件的重要摘要分開。分離彙總+詳細的生成信息的:所有構建 GET標準輸出+標準錯誤命令重定向到一個指定的輸出文件(如集結的summary.txt),但是從scons的本身打算離開輸出到標準輸出/標準錯誤。
結構構建輸出使用XML:所有構建 GET標準輸出+標準錯誤命令重定向到一個指定的輸出文件,並以XML格式做到這一點,例如如下。輸出已經夠詳細了,我不關心是否存在XML開銷。顯然,stdout和stderr的內容需要轉義以包含在XML中。
<build-step builder="Compiler"> <output>c:/foo/someFile.obj</output> <input>c:/foo/someFile.cpp c:/foo/someFile.h</input> <command>cc someFile.cpp -l someLib.lib ...</command> <stdout>Remark: you should be using lint</stdout> <stderr>Warning: variable foo was declared but never referenced</stderr> </build-step> <build-step builder="Compiler"> <output>c:/foo/someFile.exe</output> <input>c:/foo/someFile.obj c:/foo/otherFile.obj</input> <command>cc -o someFile.exe someFile.obj otherFile.obj</command> <stdout>Success! Hurray!</stdout> <stderr></stderr> </build-step>
這是一個值得的練習。自己做點麻煩有點麻煩,但值得付出努力。 – 2010-12-28 17:07:48