New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add APP, JAR packaging code #136
Conversation
|
@wasnotrice Awesome! I did the following on my Windows 7.
So far worked perfect. I wrote my app and save as Shoes.app do
para 'hello shoes 4!!'
endThen,
I got an error. So, I wrote a snippet and save as call jruby --1.9 -e "$LOAD_PATH.unshift File.expand_path('../lib', __FILE__); require 'shoes/cli'; Shoes::CLI.new.run(['%0','%1', '%2', '%3'])"Then again,
Wow, my app was run! I could see C:\tmp\shoes4>call jruby --1.9 -e "$LOAD_PATH.unshift File.expand_path('../lib',
__FILE__); require 'shoes/cli'; Shoes::CLI.new.run(['bin\shoes','-p', 'swt:app'
, 'c:\tmp\test1.rb'])"
Packaging swt:app...
Creating pkg/tmp/shoesapp.jar
D, [2012-10-21T10:47:01.627000 #11052] DEBUG -- : main_window on_close block beg
in... disposing ::Swt.display
D, [2012-10-21T10:47:01.643000 #11052] DEBUG -- : ::Swt.display disposedBut umm... where is |
|
Found Okay then, I think If so, how to execute the shoesapp.jar file? C:\jruby\bin\pkg\Shoes App.app\Contents\Java>ls
shoesapp.jar
C:\jruby\bin\pkg\Shoes App.app\Contents\Java>java -Djruby.compat.version=1.9 -ja
r shoesapp.jar
NameError: cannot load Java class org.eclipse.jface.viewers.ColumnViewerToolTipS
upport
get_proxy_or_package_under_package at org/jruby/javasupport/JavaUtilities.java
:54
method_missing at file:/c:/ashbb/Temp/jruby563601848452194
8458extract/jruby-core-1.6.8.jar!/builtin/javasupport/java.rb:51
Viewers at file:C:/jruby/bin/pkg/Shoes App.app/Cont
ents/Java/shoesapp.jar!/gems/swt-0.13/lib/swt/full.rb:107
JFace at file:C:/jruby/bin/pkg/Shoes App.app/Cont
ents/Java/shoesapp.jar!/gems/swt-0.13/lib/swt/full.rb:106
(root) at file:C:/jruby/bin/pkg/Shoes App.app/Cont
ents/Java/shoesapp.jar!/gems/swt-0.13/lib/swt/full.rb:101
require at org/jruby/RubyKernel.java:1071
require at file:C:/jruby/bin/pkg/Shoes App.app/Cont
ents/Java/shoesapp.jar!/gems/swt-0.13/lib/swt/full.rb:55
(root) at file:C:/jruby/bin/pkg/Shoes App.app/Cont
ents/Java/shoesapp.jar!/gems/swt-0.13/lib/swt.rb:3
require at org/jruby/RubyKernel.java:1071
require at file:C:/jruby/bin/pkg/Shoes App.app/Cont
ents/Java/shoesapp.jar!/gems/swt-0.13/lib/swt.rb:55
(root) at file:C:/jruby/bin/pkg/Shoes App.app/Cont
ents/Java/shoesapp.jar!/gems/shoes-4.0.0.pre1/lib/shoes/swt.rb:4
require at org/jruby/RubyKernel.java:1071
require at file:C:/jruby/bin/pkg/Shoes App.app/Cont
ents/Java/shoesapp.jar!/gems/shoes-4.0.0.pre1/lib/shoes/swt.rb:55
backend= at file:C:/jruby/bin/pkg/Shoes App.app/Cont
ents/Java/shoesapp.jar!/gems/shoes-4.0.0.pre1/lib/shoes/configuration.rb:24
(root) at file:/C:/jruby/bin/pkg/Shoes App.app/Con
tents/Java/shoesapp.jar!/META-INF/init.rb:8
require at org/jruby/RubyKernel.java:1071
require at file:/C:/jruby/bin/pkg/Shoes App.app/Con
tents/Java/shoesapp.jar!/META-INF/init.rb:36
(root) at <script>:2
Umm,... need to install something? |
|
@ashbb Thanks for trying out packaging on Windows!
Awesome! Except
You were right to expect the .jar and the .app to be in c:\tmp\pkg. This is the right place to look. On OS X, this is where the packages are created. The
Right!
Just as you did. I know this error :) There is a bug in the Swt gem where those JFace libs will get loaded if the gem is installed normally, but will fail if the gem is bundled within a .jar. It's because jar paths contain a |
|
I tried from scratch. :)
call jruby --1.9 -e "$LOAD_PATH.unshift File.expand_path('../lib', __FILE__); require 'shoes/cli'; Shoes::CLI.new.run(['%3', '%1', '%2', '%3'])"
module JFace
path = case Config::CONFIG["host_os"]
when /windows|mswin/i
"../../../../swt-*/vendor/jface/*.jar"
else
"../../../vendor/jface/*.jar"
end
Dir[File.expand_path path, __FILE__].each do |jar_fn|
require jar_fn
end
end
#shell.set_image ::Swt::Graphics::Image.new(::Swt.display, SHOES_ICON)
Shoes.app do
para 'hello shoes 4!!'
end
Finaly, my app was launched from in the shoesapp.jar. :) But there is still one problem. In the above steps, I commented out line 16 in c:\tmp\shoes4\lib\shoes\swt\app.rb. So, SHOES_ICON isn't set on my app window. :( If I didn't comment out the line 16, I got the following error messages when I run the shoesapp.jar. c:\tmp\hello\pkg\Shoes App.app\Contents\Java>java -Djruby.compat.version=1.9 -ja
r shoesapp.jar
NativeException: org.eclipse.swt.SWTException: i/o error (java.io.FileNotFoundEx
ception: file:C:\tmp\hello\pkg\Shoes App.app\Contents\Java\shoesapp.jar!\gems\sh
oes-4.0.0.pre1\lib\shoes\..\..\static\shoes-icon.png (Syntax error: file name or
directory name or volume lavel))
initialize at file:C:/tmp/hello/pkg/Shoes App.app/Contents/Java/shoesapp.jar!/
gems/shoes-4.0.0.pre1/lib/shoes/swt/app.rb:16
tap at org/jruby/RubyKernel.java:1816
initialize at file:C:/tmp/hello/pkg/Shoes App.app/Contents/Java/shoesapp.jar!/
gems/shoes-4.0.0.pre1/lib/shoes/swt/app.rb:15
initialize at file:C:/tmp/hello/pkg/Shoes App.app/Contents/Java/shoesapp.jar!/
gems/shoes-4.0.0.pre1/lib/shoes/app.rb:43
app at file:C:/tmp/hello/pkg/Shoes App.app/Contents/Java/shoesapp.jar!/
gems/shoes-4.0.0.pre1/lib/shoes/app.rb:13
(root) at file:/C:/tmp/hello/pkg/Shoes App.app/Contents/Java/shoesapp.jar!
/shoes-app/hello.rb:1
load at org/jruby/RubyKernel.java:1097
(root) at file:/C:/tmp/hello/pkg/Shoes App.app/Contents/Java/shoesapp.jar!
/shoes-app/hello.rb:1
require at org/jruby/RubyKernel.java:1071
require at file:/C:/tmp/hello/pkg/Shoes App.app/Contents/Java/shoesapp.jar!
/META-INF/main.rb:55
(root) at <script>:3
|
|
@ashbb Thanks for working on this! Would you please give me a link to your
Awesome!
OK. This looks like a problem with ".." in But there is another problem with this line. The |
Download from here, please. :) |
|
@ashbb it works! Hooray! I have now run  there is a small problem with the new application security features in OS X 10.8. By default, applications only run if they have been signed by a developer's key. Otherwise, you get this: This is fine, of course, because you can change that preference, but it's a hassle. I'll have to see if we can allow developers to sign their apps if they have a key from Apple. Then at least some apps wouldn't raise that warning. |
|
Can we possibly get a developer key as "Shoes Project" or something? The Peter Fitzgibbons On Wed, Oct 24, 2012 at 11:53 AM, Eric Watson notifications@github.comwrote:
|

This is the code from wasnotrice/shoes-warbler slurped up into Shoes 4. See the README section on packaging to get started.
Kick the tires, especially on Windows.
Thanks!