Sha256: 7c94fbdb2cd1917243dc6b1cf9415df0d8bc2ca0d72272d43fbe3f3442742b67

Contents?: true

Size: 1.49 KB

Versions: 36

Compression:

Stored size: 1.49 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

36 entries across 36 versions & 5 rubygems

Version Path
jarib-celerity-0.0.6.19 tasks/jar.rake
jarib-celerity-0.0.7.1 tasks/jar.rake
celerity-0.9.1 tasks/jar.rake
no-click-exception-celerity-0.9.0 tasks/jar.rake
celerity-0.9.0 tasks/jar.rake
celerity-0.8.9 tasks/jar.rake
celerity-0.8.9.pre tasks/jar.rake
celerity-0.8.8 tasks/jar.rake
celerity-0.8.7 tasks/jar.rake
celerity-0.8.6 tasks/jar.rake
celerity-0.8.5 tasks/jar.rake
celerity-0.8.4 tasks/jar.rake
celerity-0.8.2 tasks/jar.rake
celerity-0.8.1 tasks/jar.rake
oki-celerity-0.8.2 tasks/jar.rake
oki-celerity-0.8.1 tasks/jar.rake
oki-celerity-0.8.1.dev tasks/jar.rake
celerity-0.8.0 tasks/jar.rake
celerity-0.8.0.beta.4 tasks/jar.rake
celerity-0.8.0.beta.3 tasks/jar.rake