lib/glimmer/package.rb in glimmer-dsl-swt-0.4.1 vs lib/glimmer/package.rb in glimmer-dsl-swt-0.5.0

- old
+ new

@@ -15,11 +15,11 @@ def config project_name = File.basename(File.expand_path('.')) if !File.exists?('config/warble.rb') puts 'Generating JAR configuration (config/warble.rb) to use with Warbler...' - system('mkdir -p config') + FileUtils.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 docs fonts icons images sounds videos vendor)') end @@ -34,11 +34,11 @@ File.write('config/warble.rb', new_config) end end def jar - system('mkdir -p dist') + FileUtils.mkdir_p('dist') puts "Generating JAR with Warbler..." system('warble') end def native @@ -47,14 +47,16 @@ project_name = File.basename(File.expand_path('.')) version_file = File.expand_path('./VERSION') version = (File.read(version_file).strip if File.exists?(version_file) && File.file?(version_file)) rescue nil license_file = File.expand_path('./LICENSE.txt') license = (File.read(license_file).strip if File.exists?(license_file) && File.file?(license_file)) rescue nil + copyright = license.split("\n").first human_name = project_name.underscore.titlecase - command = "javapackager -deploy -native -outdir packages -outfile \"#{project_name}\" -srcfiles \"dist/#{project_name}.jar\" -appclass JarMain -name \"#{human_name}\" -title \"#{human_name}\" -Bmac.CFBundleName=\"#{human_name}\" -Bmac.CFBundleIdentifier=\"org.#{project_name}.application.#{project_name}\" -Bmac.category=\"public.app-category.business\" " + command = "javapackager -deploy -native -outdir packages -outfile \"#{project_name}\" -srcfiles \"dist/#{project_name}.jar\" -appclass JarMain -name \"#{human_name}\" -title \"#{human_name}\" -Bmac.CFBundleName=\"#{human_name}\" -Bmac.CFBundleIdentifier=\"org.#{project_name}.application.#{project_name}\" -Bmac.category=\"public.app-category.business\" -BinstalldirChooser=true -Bvendor=\"#{human_name}\" -Bwin.menuGroup=\"#{human_name}\" -BsystemWide=false " command += " -BjvmOptions=-XstartOnFirstThread " if OS.mac? command += " -BappVersion=#{version} -Bmac.CFBundleVersion=#{version} " if version command += " -srcfiles LICENSE.txt -BlicenseFile=LICENSE.txt " if license + command += " -Bcopyright=\"#{copyright}\" " if copyright command += " #{javapackager_extra_args} " if javapackager_extra_args command += " #{ENV['JAVAPACKAGER_EXTRA_ARGS']} " if ENV['JAVAPACKAGER_EXTRA_ARGS'] puts "Generating DMG/PKG/APP/JNLP with javapackager..." puts command system command