Sha256: 7010c248238e6da495149f4550bba8fbd138367c03a6d8e72b78a07b7bd44e91

Contents?: true

Size: 1.48 KB

Versions: 8

Compression:

Stored size: 1.48 KB

Contents

namespace :jar do
  target_dir = "classes"

  desc "Compile and create celerity-complete-#{Celerity::VERSION}.jar (includes HtmlUnit)"
  task :fat do
    file_name = "pkg/celerity-complete-#{Celerity::VERSION}.jar"

    ruby_files = Dir['lib/**/*.rb']
    jar_files  = Dir['lib/**/*.jar']
    resources  = Dir['lib/celerity/resources/*']

    rm_rf   target_dir if File.exist? target_dir
    mkdir   target_dir
    mkdir_p resource_dir = "#{target_dir}/celerity/resources"

    sh "jrubyc", "-d", "lib", "-t", target_dir, *ruby_files
    resources.each { |extra| cp extra, resource_dir }

    jar_files.each do |f|
      cp f, target_dir
    end

    top_dir = Dir.pwd
    chdir target_dir, :verbose => true
    Dir['*.jar'].each do |file|
      sh "jar", "xf", file
      rm_f file
    end
    chdir top_dir, :verbose => true

    mkdir_p "pkg"
    sh "jar", "cvf", file_name, '-C', target_dir, '.'
  end

  desc "Compile and create celerity-#{Celerity::VERSION}.jar"
  task :tiny do
    file_name = "pkg/celerity-#{Celerity::VERSION}.jar"

    ruby_files = Dir['lib/**/*.rb']
    resources  = Dir['lib/celerity/resources/*']

    rm_rf   target_dir if File.exist? target_dir
    mkdir   target_dir
    mkdir_p resource_dir = "#{target_dir}/celerity/resources"

    sh "jrubyc", "-d", "lib", "-t", target_dir, *ruby_files
    resources.each { |extra| cp extra, resource_dir }

    mkdir_p "pkg"
    sh "jar", "cvf", file_name, '-C', target_dir, '.'
  end
end

desc 'Alias for jar:tiny'
task :jar => %w[jar:tiny]

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
celerity_thingista-0.9.3 tasks/jar.rake
celerity_thingista-0.9.2 tasks/jar.rake
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/tasks/jar.rake
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/tasks/jar.rake
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/tasks/jar.rake
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/tasks/jar.rake
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/tasks/jar.rake
celerity-0.9.2 tasks/jar.rake