Sha256: df8eb2a3c2e92c07ed2bb831a1547b7da973293573a0283518ab3e9e0b425959

Contents?: true

Size: 1.71 KB

Versions: 46

Compression:

Stored size: 1.71 KB

Contents

require 'rake/clean'

INCLUDE = "include"
ERLC_FLAGS = "-I#{INCLUDE} +warn_unused_vars +warn_unused_import"

SRC = FileList['src/*.erl']
OBJ = SRC.pathmap("%{src,ebin}X.beam")
CLEAN.include("ebin/*.beam")

directory 'ebin'

rule ".beam" =>  ["%{ebin,src}X.erl"] do |t|
  sh "erlc -pa ebin -W #{ERLC_FLAGS} -o ebin #{t.source}"
end

task :compile => ['ebin'] + OBJ
task :dcompile do
  Dir["#{::File.dirname(__FILE__)}/src/*.erl"].each do |t|
    Kernel.system "erlc -pa ebin -W #{ERLC_FLAGS} -Ddebug -o ebin #{t}"
  end  
end

task :default => :compile

task :run_tests => [:compile] do
  puts "Modules under test:"
  OBJ.each do |obj|
    obj[%r{.*/(.*).beam}]
    mod = $1
    test_output = `erl -pa ebin -run #{mod} test -run init stop`

    if /\*failed\*/ =~ test_output
      test_output[/(Failed.*Aborted.*Skipped.*Succeeded.*$)/]
    else
      test_output[/1>\s*(.*)\n/]
    end

    puts "#{mod}: #{$1}"
  end
end

desc "Clean the beams from the ebin directory"
task :clean do
  cmd = "rm ebin/*.beam"
  Kernel.system cmd
end

desc "Recompile the sources"
task :recompile => [:clean, :compile]

desc "Compile all the sources"
task :compile => ['ebin'] + OBJ

desc "Rebuild the boot scripts"
task :build_boot_scripts => [:recompile] do
  puts "Rebuilding boot scripts"
  @version = "0.1"
  cmd = "erl -pa ./ebin/ -run pm_packager recompile_scripts #{@version} -run init stop -noshell"
  Kernel.system cmd
end

desc "Rebuild and repackage"
task :repackage => [:build_boot_scripts] do  
  cmd = "erl -pa ./ebin -s pm_packager start -s init stop"
  Kernel.system cmd
end

desc "Install messenger"
task :install_messenger do
  cmd = "erl -pa ./ebin/ -run pm_packager install_messenger #{@version} -run init stop -noshell"
  Kernel.system cmd
end

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
auser-poolparty-0.2.46 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.47 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.48 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.49 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.50 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.51 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.52 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.53 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.54 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.55 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.56 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.57 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.58 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.59 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.60 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.61 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.62 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.63 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.64 lib/erlang/messenger/Rakefile
auser-poolparty-0.2.65 lib/erlang/messenger/Rakefile