AlamoCoders May 09 - Rake
Upcoming SlideShare
Loading in...5

Like this? Share it with your network


AlamoCoders May 09 - Rake

Uploaded on

Rake 101 for .NET developers.

Rake 101 for .NET developers.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads


Total Views
On Slideshare
From Embeds
Number of Embeds



Embeds 2 2

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide
  • - Pablo, LT pitch
  • - how many of you have had to do either of these?
    - were your builds consistent?
  • - Automation - let’s help Skynet take over faster
    - once complete, you only really need to touch it to handle new features
    - SOX compliance - be able to have another human handle the process with a single command
  • - i have an example coming up soon

  • - Hello world task
    - 4 different ways to name rakefile
    - require rake (One Click installer put the rake call into your environment variables PATH)
    - description, task name (string or symbol) and block
  • - the rake command will walk upward (the file directory) until it finds it first Rakefile (or variant)


  • 1. Rake Jason Meridth AlamoCoders May 2009
  • 2. Manual Builds • Compile + X-Copy • Zip file
  • 3. Why Automate? • Once done, rarely need to touch it again • Immediate feedback • Can work on other stuff besides the build • Remove human interaction (decrease errors) • Reproducible
  • 4. Current Solutions • NAnt • MSBuild
  • 5. Old School: NAnt <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <project name=quot;HelloUserquot; default=quot;completequot; xmlns=quot; <copy todir=quot;${build.dir}quot; overwrite=quot;truequot;> nant.xsdquot;> <fileset basedir=quot;HelloUserbinDebugquot;> <property name=quot;build.dirquot; value=quot;buildquot; /> <include name=quot;HelloUser.exequot; /> <property name=quot;dist.dirquot; value=quot;distquot; /> <include name=quot;HelloUser.pdbquot; /> <property name=quot;build.numberquot; value=quot;; /> <include name=quot;HelloUserLibrary.dllquot; /> <property name=quot;productquot; value=quot;HelloUserquot; /> <include name=quot;HelloUserLibrary.pdbquot; /> <property name=quot;copyrightquot; value=quot;Copyright 2008-2009 Jason Meridth. All </fileset> rights reservedquot; /> </copy> <property name=quot;clr.versionquot; value=quot;v3.5quot; /> </target> <property name=quot;msbuildquot; value=quot;${environment::get-variable('WINDIR')}/ Microsoft.NET/Framework/${clr.version}/MSBuild.exequot; /> <target name=quot;setupquot; depends=quot;compilequot;> <target name=quot;completequot; depends=quot;prepare, compile, setup, unit_test, </target> create_zipquot; description=quot;Compile and Run Testsquot; /> <target name=quot;unit_testquot;> <target name=quot;preparequot; description=quot;Deletes all generated folders and files to <exec program=quot;nunit-console.exequot; basedir=quot;libnunitquot;> start with clean folder structurequot;> <arg value=quot;HelloUserLibraryTestsbinDebug <delete dir=quot;${build.dir}quot; /> HelloUserLibraryTests.dllquot; /> <delete dir=quot;${dist.dir}quot; /> </exec> </target> <mkdir dir=quot;${build.dir}quot; if=quot;${not directory::exists(build.dir)}quot;/> <mkdir dir=quot;${dist.dir}quot; if=quot;${not directory::exists(dist.dir)}quot;/> <target name=quot;create_zipquot;> </target> <zip zipfile=quot;${dist.dir}HelloUser-bin-${build.number}.zipquot;> <fileset basedir=quot;${build.dir}quot;> <target name=quot;compilequot; description=quot;Compiles debug solutionquot;> <include name=quot;**quot; /> <exec program=quot;${msbuild}quot;> </fileset> <arg value=quot;HelloUser.slnquot; /> </zip> <arg value=quot;/verbosity:minimalquot; /> </target> <arg value=quot;/p:Configuration=debugquot; /> </project> <arg value=quot;/p:WarningLevel=0quot; /> </exec>
  • 6. What is Rake? “...a simple Ruby build program with capabilities similar to make” ~ Jim Weirich (creator)
  • 7. Install on Windows One Click Installer Cue VM...
  • 8. Hello World # Rakefile (or rakefile or rakefile.rb or Rakefile.rb) require 'rake' desc quot;Hello World!quot; task :hello_world do puts quot;Hello World!quot; end
  • 9. rake -T (--tasks) jasonmeridth@laptop ~/code/presentations/rake $ rake -T (in /Users/jasonmeridth/code/presentations/rake) rake hello_world # Hello World!
  • 10. run rake ~/code/presentations/rake $ rake hello_world (in /Users/jasonmeridth/code/presentations/rake) Hello World!
  • 11. A good Rakefile Example JAGregregory’s Fluent-NHibernate Rakefile (
  • 12. Gotchas It is the RubyZip gem, _NOT_ ZipRuby. (Go ahead Joe, laugh)
  • 13. I can haz knowledge • One click install • Obeying Pragmatic Programmers - Learn a new language once a year • Easy to extend • Easy to read • Easy to learn
  • 14. You can haz questions ???
  • 15. Resources • • • • 2009/05/08/how-a-net-developer-learned- ruby-and-rake-to-build-net-apps-in- windows.aspx • rails-rake-tutorial • nhibernate/tree/master