Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 64 lines (51 sloc) 1.201 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
lein_exe = "lein2"

def run_command(command)
  system command
  exit_code = $?.exitstatus
  if exit_code != 0
    raise "Command failed with code #{exit_code}: #{command}"
  else
    puts "Command executed successfully: #{command}"
  end
end

def in_dir(path)
  pwd = Dir.getwd
  Dir.chdir path
  yield
ensure
  Dir.chdir pwd
end


DIRS = %w{chee joodo lein-joodo}

DIRS.each do |dir|

  namespace dir do
    desc "full #{dir} build"
    task :build do
      in_dir dir do
        run_command "#{lein_exe} deps"
        run_command "#{lein_exe} javac"
        run_command "#{lein_exe} spec"
        run_command "#{lein_exe} install"
      end
    end

    desc "push to clojars"
    task :push do
      in_dir dir do
        run_command "#{lein_exe} jar"
        run_command "#{lein_exe} push"
      end
    end

    desc "install locally"
    task :install do
      in_dir dir do
        run_command "#{lein_exe} install"
      end
    end
  end

end

desc "build all projects"
task :build => DIRS.map {|dir| "#{dir}:build"}

desc "push all projects"
task :push => DIRS.map {|dir| "#{dir}:push"}

desc "install all projects"
task :install => DIRS.map {|dir| "#{dir}:install"}

task :default => :build
Something went wrong with that request. Please try again.