-
Notifications
You must be signed in to change notification settings - Fork 346
Building
Visual Studio |
Command line |
Rake |
Mono |
Tips |
- Start Visual Studio 2010.
- Open the
c:\path\to\Solutions\Ruby.sln
solution file - You will get two dialog boxes complaining about source control like VsSourceControlMessage1.png and VsSourceControlMessage2.png at http://www.ironruby.net/Support/Images. Press OK to both.
- Press “F6” to build the solution.
Note for VS Express users: you may see warnings about mscorlib
or System
not being found when using VS Express; just ignore those as it doesn’t seem to handle conditional references for Silverlight. However, this means that Silverlight builds won’t work from the IDE. If you absolutely need to build from the IDE, run this script to transform the csproj files to work in VS Express. Otherwise, see the section below about building from the command line.
Change the working directory to c:\path\to\Solutions and run one of the following commands:
msbuild Ruby.sln /p:Configuration=Debug
produces a debug build for .NET Framework 4.0,
msbuild Ruby.sln /p:Configuration=Release
produces a release build for .NET Framework 4.0,
msbuild Solutions\Ruby.sln /p:Configuration=Silverlight4Debug
produces a debug build for Silverlight 4,
msbuild Ruby.sln /p:Configuration=Silverlight4Release
produces a release build for Silverlight 4,
msbuild Ruby.sln /p:Configuration=Silverlight3Debug
produces a debug build for Silverlight 3, which is what you need for Windows Phone 7,
msbuild Ruby.sln /p:Configuration=Silverlight3Release
produces a release build for Silverlight 3/WP7,
If the build is successful the binaries are stored in C:\path\to\bin\{ConfigurationName}
For most of these commands you can find an alias defined in Alias.txt.
Change the working directory to c:\path\to\Msi and run the following command:
msbuild Installer.proj /p:Configuration=Release
You’ll find both .msi files in C:\path\to\bin\Release directory if the build is successful.
Instructions for building on Mono:
Often you can use the latest Mono release just fine.
Previously, you had to build Mono from SVN. Instruction is still provided below in case it is needed again.
svn co svn://anonsvn.mono-project.com/source/trunk/mono svn co svn://anonsvn.mono-project.com/source/trunk/mcs cd mono ./configure make make install
If you built Mono from source, make sure pkg-config can find the built Mono. For example:
export PKG_CONFIG_PATH=“/opt/mono/lib/pkgconfig”
The branch at http://github.com/casualjim/ironruby is likely to work better with Mono as it has continuous integration for Mono. That said, as of Jan 18 2010 the main ironruby repository (http://github.com/ironruby/ironruby) has now been confirmed as building on OSX against Mono 2.6.
git clone git://github.com/casualjim/ironruby.git cd ironruby git checkout -b linux --track origin/linux
Check the status of the continuous integration to see if there are any known build issues. The steps for the build are:
rake compile MERLIN_ROOT=/path/to/ironruby/Merlin/Main MONO_LIB=/Library/Frameworks/Mono.framework/Versions/current/lib/ configuration=release
Alternatively you can use the build command that is included in that linux branch. That command will compile IronRuby and deploy it to ~/bin. If you then add ~/bin to your PATH environment variable you can run ironruby files by invoking the command ir my_file.rb. Also the iirb, igem, … commands are deployed to the ~/bin.
cd ironruby chmod +x build ./build
And then you can run it with Mono
build/mono_debug/ir
To create a package, run
rake package:ironruby MERLIN_ROOT=/your/path/to/ironruby/Merlin/Main configuration=release
This will create a ready to use ironruby setup under MERLIN_ROOT/../../dist/ironruby
As of 2009/12/16, you’d need to
- export MERLIN_ROOT because test.rake fails to pick up MERLIN_ROOT from the command line causing the build to fail on line 16 (
require "#{ENV['MERLIN_ROOT']}/Languages/Ruby/Scripts/irtests"
). - Remove references to IronPython binaries which for some reason unknown are present in package:ironruby (which seems to be identical to package:ironpython). Comment lines 38, 42 and 47 and uncomment line 39.
As of 2010/01/18 these fixes no longer seem to be required if you’re building against http://github.com/ironruby/ironruby rather than http://github.com/casualjim/ironruby.
- Make sure .NET is installed on your machine; Windows Vista and Windows 7 have .NET 3.0 and .NET 3.5 preinstalled, respectively. The minimum required version is 2.0 (2.0.50727.42).
- Make sure that csc.exe is in your PATH environment variable. Default location is:
c:\Windows\Microsoft.NET\Framework\v2.0.50727
- Make sure that resgen.exe is in your PATH environment variable. Default location is:
c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin