Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Working application export on windows, still a little crappy though
Former-commit-id: 7d996ba
Former-commit-id: f5d4afe2dd9495bdc498a38eab9ab1da85f94de4
  • Loading branch information
jashkenas committed Jan 16, 2009
1 parent ad1c818 commit a1e3856
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions lib/ruby-processing/exporters/application_exporter.rb
Expand Up @@ -37,21 +37,22 @@ def export!(sketch)
file_list = Dir.glob(app_dir + "{/**/*.{rb,jar},/data/*.*}").map {|f| f.sub(app_dir + "/", "")}
@class_path = file_list.map {|f| "$JAVAROOT/" + f.sub(prefix+"/", "") }.join(":")
@linux_class_path = file_list.map{|f| f.sub(prefix+"/", "")}.join(":")
@windows_class_path = file_list.map{|f| f.sub(prefix+"/", "")}.join(",")
@windows_class_path = file_list.map{|f| f.sub(prefix+"/", "").gsub('/', '\\')}.join(";")

# Do it.
render_erb_in_path_with_binding(app_dir, binding, :delete => true)
rm Dir.glob(app_dir + "/**/*.{class,java}")
runnable = app_dir + "/" + File.basename(@main_file, ".rb")
move app_dir + "/run", runnable
move app_dir + "/run.exe", runnable + ".exe"
move app_dir + "/run.bat", "#{runnable}.bat"
chmod 0755, runnable
chmod 0755, "#{runnable}.bat"
cd app_dir + "/Contents/Resources"
# Poor ol' windows can't symlink.
# TODO...
win = RUBY_PLATFORM.match(/mswin/)
puts "I'm afraid windows can't export Apps quite yet" and exit if win
ln_s('../../lib', 'Java')
puts "\nSorry. Applications exported from Windows won't run on Macs...\n" if win
ln_s('../../lib', 'Java') unless win
end

def usage(predicate)
Expand Down
4 changes: 0 additions & 4 deletions lib/templates/application/lib/args.txt.erb

This file was deleted.

4 changes: 4 additions & 0 deletions lib/templates/application/run.bat.erb
@@ -0,0 +1,4 @@
@echo off
echo loading...
cd lib
java -cp "<%= @windows_class_path %>" org.jruby.Main ruby-processing/runners/run.rb <%= @main_file %>
Binary file removed lib/templates/application/run.exe
Binary file not shown.

0 comments on commit a1e3856

Please sign in to comment.