Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

214 lines (188 sloc) 12.807 kb
<?xml version="1.0"?>
<project name="MonoGame Build Script" default="build_installer" basedir=".">
<description>Default MonoGame Automated Build script</description>
<property name="os" value="${operating-system::get-platform(environment::get-operating-system())}" />
<property name="mdtooldir" value="/Applications/MonoDevelop.app/Contents/MacOS"/>
<property name="psmtooldir" value="C:\Program Files (x86)\SCE\PSM\tools\PsmStudio\bin" />
<property name="msbuild12dir" value="C:\Program Files (x86)\MSBuild\12.0\Bin" />
<!-- Temporary work around so that we don't need to change the targets on the build server -->
<target name="build" depends="build_code,run_tests,build_docs,build_installer" />
<target name="checkos" description="check the operating system">
<property name="os" value="${operating-system::get-platform(environment::get-operating-system())}"/>
<if test="${os == 'Unix'}">
<if test="${directory::exists('/Applications') and directory::exists('/Library')}">
<property name="os" value="MacOS"/>
<if test="${not directory::exists(mdtooldir)}">
<property name="mdtooldir" value="${path::get-full-path('/Applications/Xamarin Studio.app/Contents/MacOS')}"/>
</if>
</if>
</if>
<echo message="Detected : ${os}"/>
</target>
<target name="clean">
<delete dir="${project::get-base-directory()}\MonoGame.Framework\obj" />
<delete dir="${project::get-base-directory()}\MonoGame.Framework.Content.Pipeline\obj" />
</target>
<target name="build_code" description="Build all the projects." depends="checkos">
<call target="build_windows"/>
<call target="build_windows8" />
<call target="build_windowsphone" />
<call target="build_windowsphone81" />
<call target="build_psm" />
<call target="build_web" />
<call target="build_linux"/>
<call target="build_android" />
<call target="build_mac" />
<call target="build_ios" />
<call target="build_contentprocessor"/>
</target>
<target name="build_psm" description="Build Play Station Mobile" depends="clean">
<if test="${os == 'Win32NT'}">
<if test="${file::exists('C:\Program Files (x86)\SCE\PSM\tools\PsmStudio\bin\mdtool.exe')}">
<exec program="Protobuild" commandline="-generate PSMobile" />
<exec program="mdtool.exe" basedir="${psmtooldir}" commandline="build -t:Clean -c:Release MonoGame.Framework.PSMobile.sln" />
<exec program="mdtool.exe" basedir="${psmtooldir}" commandline="build -t:Build -c:Release MonoGame.Framework.PSMobile.sln" />
</if>
</if>
</target>
<target name="build_windows" description="Build Windows" depends="clean">
<if test="${os == 'Win32NT'}">
<exec program="Protobuild" commandline="-generate Windows" />
<exec program="msbuild " commandline="MonoGame.Framework.Windows.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.Windows.sln /t:Build /p:Configuration=Release" />
<exec program="Protobuild" commandline="-generate WindowsGL" />
<exec program="msbuild " commandline="MonoGame.Framework.WindowsGL.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.WindowsGL.sln /t:Build /p:Configuration=Release" />
</if>
<if test="${os == 'Unix'}">
<exec program="mono" commandline="Protobuild.exe -generate Windows" />
<exec program="xbuild" commandline="/t:Clean /p:Configuration=Release MonoGame.Framework.Windows.sln" />
<exec program="xbuild" commandline="/t:Build /p:Configuration=Release MonoGame.Framework.Windows.sln" />
<exec program="mono" commandline="Protobuild.exe -generate WindowsGL" />
<exec program="xbuild" commandline="/t:Clean /p:Configuration=Release MonoGame.Framework.WindowsGL.sln" />
<exec program="xbuild" commandline="/t:Build /p:Configuration=Release MonoGame.Framework.WindowsGL.sln" />
</if>
</target>
<target name="build_linux" description="Build Linux" depends="clean">
<if test="${os == 'Win32NT'}">
<exec program="Protobuild" commandline="-generate Linux" />
<exec program="msbuild " commandline="MonoGame.Framework.Linux.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.Linux.sln /t:Build /p:Configuration=Release" />
</if>
<if test="${os == 'Unix'}">
<exec program="mono" commandline="Protobuild.exe -generate Linux" />
<exec program="xbuild" commandline="/t:Clean /p:Configuration=Release MonoGame.Framework.Linux.sln" />
<exec program="xbuild" commandline="/t:Build /p:Configuration=Release MonoGame.Framework.Linux.sln" />
</if>
</target>
<target name="build_web" description="Build Web JSIL" depends="clean">
<if test="${os == 'Win32NT'}">
<exec program="Protobuild" commandline="-generate Web">
<environment>
<variable name="JSIL_DIRECTORY" value="C:\JSIL" />
</environment>
</exec>
<exec program="msbuild " commandline="MonoGame.Framework.Web.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.Web.sln /t:Build /p:Configuration=Release" />
</if>
<if test="${os == 'Unix'}">
<exec program="mono" commandline="Protobuild.exe -generate Web" />
<exec program="xbuild" commandline="/t:Clean /p:Configuration=Release MonoGame.Framework.Web.sln" />
<exec program="xbuild" commandline="/t:Build /p:Configuration=Release MonoGame.Framework.Web.sln" />
</if>
</target>
<target name="build_mac" description="Build MacOS" depends="clean">
<if test="${os == 'MacOS'}">
<exec program="mono" commandline="Protobuild.exe -generate MacOS" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Clean -c:Release MonoGame.Framework.MacOS.sln" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Build -c:Release MonoGame.Framework.MacOS.sln" />
<delete dir="${project::get-base-directory()}\Tools\Pipeline\bin\MacOS\AnyCPU\Release\*.pkg" />
<exec program="pkgbuild" workingdir="Tools/Pipeline/bin/MacOS/AnyCPU/Release" commandline=" --component ./Pipeline.app --identifier com.monogame.pipeline --version 1 --install-location /Applications Pipeline.MacOS.pkg" />
<exec program="productbuild" workingdir="Tools/Pipeline/bin/MacOS/AnyCPU/Release" commandline=" --distribution distribution.xml --resources ./Resources --package-path Pipeline.MacOS.pkg Pipeline.Installer.pkg" />
</if>
</target>
<target name="build_ios" description="Build iOS" depends="clean">
<if test="${os == 'MacOS'}">
<if test="${file::exists('/Developer/MonoTouch/MSBuild/Xamarin.ObjcBinding.CSharp.targets') or file::exists('/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Xamarin.ObjcBinding.CSharp.targets')}">
<exec program="mono" commandline="Protobuild.exe -generate iOS" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Clean -c:Release\|iPhoneSimulator MonoGame.Framework.iOS.sln" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Build -c:Release\|iPhoneSimulator MonoGame.Framework.iOS.sln" />
</if>
</if>
</target>
<target name="build_android" description="Build Android" depends="clean">
<if test="${os == 'Win32NT'}">
<if test="${file::exists('C:\Program Files (x86)\MSBuild\Novell\Novell.MonoDroid.CSharp.targets')}">
<exec program="Protobuild" commandline="-generate Android" />
<exec program="msbuild " commandline="MonoGame.Framework.Android.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.Android.sln /t:Build /p:Configuration=Release" />
<exec program="Protobuild" commandline="-generate Ouya" />
<exec program="msbuild " commandline="MonoGame.Framework.Ouya.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.Ouya.sln /t:Build /p:Configuration=Release" />
</if>
</if>
<if test="${os == 'MacOS'}">
<if test="${file::exists('/Developer/MonoAndroid/usr/bin/mandroid')}">
<exec program="mono" commandline="Protobuild.exe -generate Android" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Clean -c:Release MonoGame.Framework.Android.sln" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Build -c:Release MonoGame.Framework.Android.sln" />
<exec program="mono" commandline="Protobuild.exe -generate Ouya" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Clean -c:Release MonoGame.Framework.Ouya.sln" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Build -c:Release MonoGame.Framework.Ouya.sln" />
</if>
</if>
</target>
<target name="build_windows8" description="Build Windows 8" depends="clean">
<if test="${os == 'Win32NT'}">
<exec program="Protobuild" commandline="-generate Windows8" />
<exec program="msbuild " commandline="MonoGame.Framework.Windows8.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.Windows8.sln /t:Build /p:Configuration=Release" />
</if>
</target>
<target name="build_windowsphone" description="Build Windows Phone" depends="clean">
<if test="${os == 'Win32NT'}">
<if test="${file::exists('c:\Program Files (x86)\MSBuild\Microsoft\WindowsPhone\v8.0\Microsoft.Cpp.WindowsPhone.8.0.targets')}">
<exec program="Protobuild" commandline="-generate WindowsPhone" />
<exec program="msbuild " commandline='MonoGame.Framework.WindowsPhone.sln /t:Clean /p:Configuration=Release /p:Platform="ARM"' />
<exec program="msbuild " commandline='MonoGame.Framework.WindowsPhone.sln /t:Build /p:Configuration=Release /p:Platform="ARM"' />
<exec program="msbuild " commandline='MonoGame.Framework.WindowsPhone.sln /t:Clean /p:Configuration=Release /p:Platform="x86"' />
<exec program="msbuild " commandline='MonoGame.Framework.WindowsPhone.sln /t:Build /p:Configuration=Release /p:Platform="x86"' />
</if>
</if>
</target>
<target name="build_windowsphone81" description="Build Windows Phone 8.1" depends="clean">
<if test="${os == 'Win32NT'}">
<if test="${file::exists('c:\Program Files (x86)\MSBuild\Microsoft\WindowsPhone\v8.1\Microsoft.Cpp.WindowsPhone.8.1.targets')}">
<exec program="Protobuild" commandline="-generate WindowsPhone81" />
<exec program="${msbuild12dir}\msbuild.exe " commandline='MonoGame.Framework.WindowsPhone81.sln /t:Clean /p:Configuration=Release /p:Platform="Any CPU"' />
<exec program="${msbuild12dir}\msbuild.exe " commandline='MonoGame.Framework.WindowsPhone81.sln /t:Build /p:Configuration=Release /p:Platform="Any CPU"' />
</if>
</if>
</target>
<target name="build_contentprocessor" description="Build the old content processors" depends="clean">
<if test="${os == 'Win32NT'}">
<exec program="msbuild " commandline="MonoGame.ContentPipeline\ContentProcessors\MonoGameContentProcessors.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.ContentPipeline\ContentProcessors\MonoGameContentProcessors.sln /t:Build /p:Configuration=Release" />
</if>
</target>
<target name="run_tests" description="Run all the tests" depends="build_code">
<nunit2 if="${os == 'Win32NT'}">
<formatter type="Xml" usefile="true" extension=".xml" outputdir="Test\bin\Windows\AnyCPU\Release" />
<test assemblyname="Test\bin\Windows\AnyCPU\Release\MonoGameTests.exe" />
</nunit2>
</target>
<target name="build_docs" description="Build the documentation." depends="build_code,run_tests">
<if test="${os == 'Win32NT'}">
<delete dir="${project::get-base-directory()}\Documentation\Output" />
<exec program="SharpDoc.exe" basedir="ThirdParty\Dependencies\SharpDoc" commandline="-config Documentation\config.xml" />
</if>
</target>
<target name="build_installer" description="Build the installers." depends="build_code,build_docs,run_tests">
<nant buildfile="ProjectTemplates/MonoDevelop/MonoDevelop.MonoGame/default.build" target="build" />
<nant buildfile="ProjectTemplates/VisualStudio2010/default.build" target="build" />
<nant buildfile="ProjectTemplates/VisualStudio2012/default.build" target="build" />
<nant buildfile="ProjectTemplates/VisualStudio2013/default.build" target="build" />
<nant buildfile="IDE/MonoDevelop/default.build" target="build"/>
<nant buildfile="Installers/default.build" target="build" />
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.