Sha256: 783871b842817a3d807f1049a1e35147d53f9de83440ee5e6b321ddc8d8ee828

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

namespace :glimmer do
  desc 'Package app for distribution'
  task :package do
    project_name = File.basename(File.expand_path('.'))
    if !File.exists?('config/warble.rb')
      system('mkdir -p config')
      system('warble config')
      new_config = File.read('config/warble.rb').split("\n").inject('') do |output, line|
        if line.include?('config.dirs =')
          line = line.sub('# ', '').sub(/=[^=\n]+$/, '= %w(app config db lib script bin images sounds videos)')
        end
        if line.include?('config.autodeploy_dir =')
          line = line.sub('# ', '')
        end
        output + "\n" + line
      end
      File.write('config/warble.rb', new_config)
    end
    system('mkdir -p dist')
    system('warble')
    puts("javapackager -deploy -native -outdir packages -outfile #{project_name} -srcdir dist -srcfiles #{project_name}.jar -appclass JarMain -name \"#{project_name}\" -title \"#{project_name}\" -BjvmOptions=-XstartOnFirstThread")
    system("javapackager -deploy -native -outdir packages -outfile #{project_name} -srcdir dist -srcfiles #{project_name}.jar -appclass JarMain -name \"#{project_name}\" -title \"#{project_name}\" -BjvmOptions=-XstartOnFirstThread")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
glimmer-0.5.3 lib/glimmer/rake_task.rb
glimmer-0.5.2 lib/glimmer/rake_task.rb