[英]How to build a Monogame c# project on travis-ci
The travis-ci build says travis-ci版本说
.. could not import "$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets"
after moving this file to my project and editit the path from it in my .csproj file it says that the mgcb.exe
cannot be found. 将此文件移到我的项目并在.csproj文件中编辑它的路径后,它说
mgcb.exe
。
Where is the file in travis-ci or how can I add the file. travis-ci中的文件在哪里或如何添加文件。
So we need to install the monogame sdk 所以我们需要安装monogame sdk
Note: It need to be a version =<3.4 because of this 注意:它必须是一个版本= <3.4,因为这
We need to edit or .travis.yml
and install monogame and execute the MGCB.exe
我们需要编辑或
.travis.yml
并安装monogame并执行MGCB.exe
language: csharp
solution: Project.sln
before_install:
- wget http://www.monogame.net/releases/v3.4/MonoGame.Linux.zip
- unzip MonoGame.Linux.zip
- find * -type f -exec chmod 777 {} \; # lazy just make all executable
install:
- sudo apt-get install -qq monodevelop libopenal-dev referenceassemblies-pcl ttf-mscorefonts-installer gtk-sharp2; # install needed packages for the monogame sdk
- sudo ./generate.sh && yes Y|sudo ./monogame-linux.run; # install monogame sdk
script:
- (cd Project/Content && mono /opt/monogame-pipeline/MGCB.exe /rebuild /@:"Content.mgcb" /outputDir:"../bin/Release/Content")
Also I used an older version of the .targets file and added before 我也使用了旧版本的.targets文件,并在
<MonoGameContentBuilderExe Condition="'$(MonoGameContentBuilderExe)' == ''">$(MSBuildExtensionsPath)\MonoGame\v3.0\Tools\MGCB.exe</MonoGameContentBuilderExe>
this: 这个:
<MonoGameContentBuilderExe Condition=" '$(OS)' != 'Windows_NT' And Exists ('/opt/monogame-pipeline/MGCB.exe') ">/opt/monogame-pipeline/MGCB.exe</MonoGameContentBuilderExe>
For me xbuild doesn't automatically build this so I did it manually. 对我来说xbuild不会自动构建它,所以我手动完成了它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.