[ANN] Rant 0.3.6

Discussion in 'Ruby' started by Stefan Lang, May 2, 2005.

  1. Stefan Lang

    Stefan Lang Guest

    Rant is a flexible build tool written entirely in Ruby,
    similar to Rake.

    == What's new in this release?

    * Automatic cleanup of generated files
    * Directed rules
    * Constraining variables
    * rant-import searches $LOAD_PATH
    * Immediately build targets from Rantfiles

    I'd appreciate suggestions about new features, names, etc.

    == Installing Rant

    You can install Rant as a RubyGem:
        % gem install --remote rant

    or download the package from RubyForge(http://rubyforge.org/frs/?group_id=615)
    and install with install.rb:
        % ruby install.rb

    == More about Rant

    The equivalent to a Makefile for make is the Rantfile. An
    Rantfile is actually a valid Ruby script that is read by the
    rant command.

    Rant currently features:
    * Defining custom tasks
    * Automated packaging, testing and RDoc generation for Ruby
      applications and libraries.
    * Primitive support for compiling C# sources portably with csc, cscc
      and mcs.
    * Multiple buildfiles (e.g. one per directory).
    * A configure plugin for easy environment and build-parameter
      checking (but not like autoconf!) which saves data in a yaml file.
    * The rant-import command creates a monolithic rant script,
      so you don't depend on an rant installation anymore.


    The following Rantfile solves the problem posted by Mark Probert.
    Consider the following structure:
      Rantfile
      foo
      src_a/
        a_1.c
        a_2.c
      src_b/
        b_1.c
        b_2.c
      obj/
        a_1.o
        a_2.o
        b_1.o
        b_2.o

    The Rantfile could look like:

    import %w(directedrule autoclean)

    desc "Build foo."
    file :foo => "obj/libfoo.a" do |t|
    sys "cc -o #{t.name} #{t.source}"
    end

    gen Directory, "obj"

    ro = gen DirectedRule, "obj" => sys["src_*"], :eek: => :c do |t|
    rac.build "obj"
    sys "cc -c -o #{t.name} #{t.source}"
    end

    file "obj/libfoo.a" => ro.candidates do |t|
    sys "ar cr #{t.name} #{t.prerequisites.arglist}"
    sys "ranlib #{t.name}"
    end

    desc "Cleanup."
    gen AutoClean, :clean

    Running rant:
    % rant --tasks
    rant foo # Build foo.
    rant clean # Cleanup.
    % rant
    mkdir obj
    cc -c -o obj/a_1.o src_a/a_1.c
    cc -c -o obj/a_2.o src_a/a_2.c
    cc -c -o obj/b_1.o src_b/b_1.c
    ar cr obj/libfoo.a obj/a_1.o obj/a_2.o obj/b_1.o
    ranlib obj/libfoo.a
    cc -o foo obj/libfoo.a
    % rant clean
    rm -rf obj
    rm -f foo

    == Resources

    Current docs:: http://make.rubyforge.org
    Rubyforge page:: http://rubyforge.org/projects/make/

    --
    Stefan
    Stefan Lang, May 2, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stefan Lang

    [ANN] First release of Rant

    Stefan Lang, Mar 26, 2005, in forum: Ruby
    Replies:
    3
    Views:
    113
    Florian Gross
    Mar 26, 2005
  2. Stefan Lang

    [ANN] Rant 0.3.2

    Stefan Lang, Apr 3, 2005, in forum: Ruby
    Replies:
    28
    Views:
    305
    Stefan Lang
    Apr 8, 2005
  3. Stefan Lang

    [ANN] Rant 0.3.4

    Stefan Lang, Apr 17, 2005, in forum: Ruby
    Replies:
    0
    Views:
    91
    Stefan Lang
    Apr 17, 2005
  4. Stefan Lang

    [ANN] Rant 0.3.8

    Stefan Lang, May 15, 2005, in forum: Ruby
    Replies:
    10
    Views:
    179
    Stefan Lang
    May 15, 2005
  5. Stefan Lang

    [ANN] Rant 0.4.0

    Stefan Lang, Jul 10, 2005, in forum: Ruby
    Replies:
    3
    Views:
    99
    Austin Ziegler
    Jul 11, 2005
Loading...

Share This Page