概要
今回ビルドしたのはこれ。
前準備
monoのインストール
brew install mono
xbuildでビルド(エラー編)
$ xbuild websocket-sharp.sln XBuild Engine Version 12.0
Mono, Version 4.2.0.0
Copyright (C) 2005-2013 Various Mono authors
Build started 2015/12/13 0:28:13.
__________________________________________________
: warning : Default tasks file /usr/local/Cellar/mono/4.2.0.179/lib/mono/3.5/Microsoft.Common.tasks not found, ignoring.
: warning : Could not find project file /usr/local/Cellar/mono/4.2.0.179/lib/mono/3.5/Microsoft.CSharp.targets, to import. Ignoring.
: error : Error initializing task Message: Not registered task Message.
Build FAILED.
Warnings:
: warning : Default tasks file /usr/local/Cellar/mono/4.2.0.179/lib/mono/3.5/Microsoft.Common.tasks not found, ignoring.
エラーとワーニングが出てビルド出来ない。
原因はビルドパスの通ってる場所にMicrosoft.CSharp.targetsとMicrosoft.Common.tasksがないため。
パスを通す
エラーメッセージの場所を見ると確かにない。
$ ls /usr/local/Cellar/mono/4.2.0.179/lib/mono/3.5
Microsoft.Build.Engine.dll*
Microsoft.Build.Framework.dll*
Microsoft.Build.Tasks.v3.5.dll*
Microsoft.Build.Utilities.v3.5.dll* Mono.XBuild.Tasks.dll*
4.5を見るとあったのでシンボリックリンクを貼る。
ln -s /usr/local/Cellar/mono/4.2.0.179/lib/mono/4.5/Microsoft.Common.tasks /usr/local/Cellar/mono/4.2.0.179/lib/mono/3.5
ln -s /usr/local/Cellar/mono/4.2.0.179/lib/mono/4.5/Microsoft.CSharp.targets /usr/local/Cellar/mono/4.2.0.179/lib/mono/3.5
再びビルド
$ xbuild websocket-sharp.sln
(省略)
Build succeeded.
0 Warning(s)
0 Error(s)
成功。