-
Notifications
You must be signed in to change notification settings - Fork 346
Building
Visual Studio |
Command line |
Rake |
Mono |
Tips |
- Start Visual Studio 2008 Professional or Expresss.
- Open the
c:\path\to\Merlin\Main\Languages\Ruby\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.
If you have run dev.bat:
brbdThis is an alias for
msbuild c:\path\to\Merlin\Main\Languages\Ruby\Ruby.sln /p:Configuration=Debug
. See Alias.txt for the full list of aliases.
You must have Silverlight installed to build for it. If not, you can install it from here. Note: this is the developer version of Silverlight, which has more descriptive error messages.
To build for Silverlight:
bsdThis is an alias for
msbuild c:\path\to\Merlin\Main\Hosts\Silverlight\Silverlight.sln /p:Configuration="Silverlight Debug" /p:SilverlightPath="C:\Program Files\Microsoft Silverlight\3.0.40624.0"
.
If you see a strange build error, then you probably have a newer/older version of Silverlight than the sources expect. To correc this, supply your machine’s path to Silverlight:
bsd /p:SilverlightPath=“C:\Program Files\Microsoft Silverlight\3.0.40723.0”And feel free to submit a patch to Alias.txt so this can get fixed.
- Install the latest Ruby with gems enabled (such as the Ruby One-Click Installer v1.8.6-25 or below)
- Install required gem. Open a command-prompt and type:
gem install pathname2 rake
- Run dev.bat to get a nicely configured Command prompt.
- To view a list of all available rake targets, run the following command from anywhere under the
Merlin
directory of the source code:
rake —tasks
- Run the following command
rake compile
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.
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/2.4/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.
- 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