jrubyfx-master 1.1.1.brakemanpro1-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +202 -0
- data/README.md +121 -0
- data/bin/jrubyfx-compile +32 -0
- data/bin/jrubyfx-generator +98 -0
- data/bin/jrubyfx-jarify +115 -0
- data/lib/jrubyfx/application.rb +42 -0
- data/lib/jrubyfx/compiler_app.rb +51 -0
- data/lib/jrubyfx/controller.rb +375 -0
- data/lib/jrubyfx/core_ext/border_pane.rb +30 -0
- data/lib/jrubyfx/core_ext/column_constraints.rb +43 -0
- data/lib/jrubyfx/core_ext/drag_event.rb +32 -0
- data/lib/jrubyfx/core_ext/duration.rb +30 -0
- data/lib/jrubyfx/core_ext/effects.rb +32 -0
- data/lib/jrubyfx/core_ext/exts.yml +57 -0
- data/lib/jrubyfx/core_ext/file_chooser.rb +63 -0
- data/lib/jrubyfx/core_ext/geometry.rb +27 -0
- data/lib/jrubyfx/core_ext/grid_pane.rb +30 -0
- data/lib/jrubyfx/core_ext/image_view.rb +25 -0
- data/lib/jrubyfx/core_ext/media_player.rb +25 -0
- data/lib/jrubyfx/core_ext/observable_value.rb +158 -0
- data/lib/jrubyfx/core_ext/pagination.rb +28 -0
- data/lib/jrubyfx/core_ext/path.rb +37 -0
- data/lib/jrubyfx/core_ext/precompiled.rb +1883 -0
- data/lib/jrubyfx/core_ext/progress_indicator.rb +41 -0
- data/lib/jrubyfx/core_ext/radial_gradient.rb +37 -0
- data/lib/jrubyfx/core_ext/region.rb +42 -0
- data/lib/jrubyfx/core_ext/rotate.rb +39 -0
- data/lib/jrubyfx/core_ext/stage.rb +89 -0
- data/lib/jrubyfx/core_ext/table_view.rb +31 -0
- data/lib/jrubyfx/core_ext/timeline.rb +56 -0
- data/lib/jrubyfx/core_ext/transition.rb +26 -0
- data/lib/jrubyfx/core_ext/tree_view.rb +40 -0
- data/lib/jrubyfx/core_ext/xy_chart.rb +53 -0
- data/lib/jrubyfx/dsl.rb +330 -0
- data/lib/jrubyfx/dsl_control.rb +28 -0
- data/lib/jrubyfx/dsl_map.rb +273 -0
- data/lib/jrubyfx/imports.rb +310 -0
- data/lib/jrubyfx/java_fx_impl.rb +137 -0
- data/lib/jrubyfx/module.rb +178 -0
- data/lib/jrubyfx/part_imports.rb +127 -0
- data/lib/jrubyfx/utils/__ignore_java_stupid_rdoc.rb +30 -0
- data/lib/jrubyfx/utils/common_converters.rb +223 -0
- data/lib/jrubyfx/utils/common_utils.rb +72 -0
- data/lib/jrubyfx/utils/string_utils.rb +48 -0
- data/lib/jrubyfx/utils.rb +76 -0
- data/lib/jrubyfx/version.rb +4 -0
- data/lib/jrubyfx.rb +41 -0
- data/lib/jrubyfx_tasks.rb +183 -0
- metadata +145 -0
@@ -0,0 +1,183 @@
|
|
1
|
+
=begin
|
2
|
+
JRubyFX - Write JavaFX and FXML in Ruby
|
3
|
+
Copyright (C) 2013 The JRubyFX Team
|
4
|
+
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
you may not use this file except in compliance with the License.
|
7
|
+
You may obtain a copy of the License at
|
8
|
+
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
See the License for the specific language governing permissions and
|
15
|
+
limitations under the License.
|
16
|
+
=end
|
17
|
+
|
18
|
+
# DO NOT INCLUDE ANY JRUBYFX CODE DIRECTLY!!! THIS IS A RAKEFILE EXTENSION!!!
|
19
|
+
require 'open-uri'
|
20
|
+
require 'rake'
|
21
|
+
require 'tmpdir'
|
22
|
+
require "pathname"
|
23
|
+
|
24
|
+
module JRubyFX
|
25
|
+
# This module contains utilities to jarify an app, and can be used in a rakefile or a running app.
|
26
|
+
module Tasks
|
27
|
+
extend Rake::DSL
|
28
|
+
# Base URL of JRuby-complete.jar download location
|
29
|
+
BASE_URL='http://jruby.org.s3.amazonaws.com/downloads'
|
30
|
+
|
31
|
+
##
|
32
|
+
# Downloads the jruby-complete jar file for `jruby_version` and save in
|
33
|
+
# ~/.jruby-jar/jruby-complete.jar unless it already exits. If the jar is
|
34
|
+
# corrupt or an older version, set force to true to delete and re-download
|
35
|
+
def download_jruby(jruby_version, force=false)
|
36
|
+
dist = "#{Dir.home}/.jruby-jar"
|
37
|
+
unless force || (File.exists?("#{dist}/jruby-complete-#{jruby_version}.jar") && File.size("#{dist}/jruby-complete-#{jruby_version}.jar") > 0)
|
38
|
+
mkdir_p dist
|
39
|
+
base_dir = Dir.pwd
|
40
|
+
cd dist
|
41
|
+
$stderr.puts "JRuby complete jar not found. Downloading... (May take awhile)"
|
42
|
+
download(jruby_version)
|
43
|
+
cd base_dir
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
##
|
48
|
+
# Creates a full jar from the given source pattern (must be a pattern to match
|
49
|
+
# files), with the given main script as the script to launch when the jarfile
|
50
|
+
# is run. The output jar is saved in the `target` dir, which also doubles as a
|
51
|
+
# temporary work dir. `jar` is the executable that makes jars. If `target` is
|
52
|
+
# nill then a random temporary directory is created, and output_jar is the
|
53
|
+
# full path to the jar file to save
|
54
|
+
def jarify_jrubyfx(src="src/*" ,main_script=nil, target="target", output_jar="jrubyfx-app.jar", opts = {})
|
55
|
+
if target_was_nil = target == nil
|
56
|
+
target = Dir.mktmpdir("jrubyfx")
|
57
|
+
final_jar = output_jar
|
58
|
+
output_jar = File.basename output_jar
|
59
|
+
end
|
60
|
+
# set defaults
|
61
|
+
opts = {file_filter: ->(f){true},jar: "jar"}.merge(opts)
|
62
|
+
|
63
|
+
mkdir_p target
|
64
|
+
|
65
|
+
#copy jruby jar file in, along with script and our rb files
|
66
|
+
cp "#{ENV['HOME']}/.jruby-jar/jruby-complete-#{opts[:version] || JRUBY_VERSION}.jar", "#{target}/#{output_jar}"
|
67
|
+
|
68
|
+
#copy source in
|
69
|
+
FileList[src].each do |iv_srv|
|
70
|
+
cp_r iv_srv, "#{target}/#{File.basename(iv_srv)}" if (main_script == nil || main_script != iv_srv) && opts[:file_filter].call(iv_srv)
|
71
|
+
end
|
72
|
+
cp main_script, "#{target}/jar-bootstrap.rb" unless main_script == nil
|
73
|
+
|
74
|
+
unless File.exists? "#{target}/jar-bootstrap.rb"
|
75
|
+
$stderr.puts "@"*79
|
76
|
+
$stderr.puts "@#{"!!!WARNING!!!".center(79-2)}@"
|
77
|
+
$stderr.puts "@#{"jar-bootstrap.rb NOT FOUND!".center(79-2)}@"
|
78
|
+
$stderr.puts "@#{"Did you set main_src= or have jar-bootstrap in src= ?".center(79-2)}@"
|
79
|
+
$stderr.puts "@"*79
|
80
|
+
end
|
81
|
+
|
82
|
+
#copy our libs in
|
83
|
+
FileList["#{File.dirname(__FILE__)}/*"].each do |librb|
|
84
|
+
cp_r librb, target
|
85
|
+
end
|
86
|
+
|
87
|
+
fxml_loader_path = nil
|
88
|
+
# this will find it if we are calling ruby -I whatever
|
89
|
+
$LOAD_PATH.each do |pth|
|
90
|
+
if File.exist? File.join(pth, "jrubyfx-fxmlloader.rb")
|
91
|
+
fxml_loader_path = pth
|
92
|
+
break
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
# default to gems
|
97
|
+
unless fxml_loader_path
|
98
|
+
fxml_loader_path = File.join(Gem::Specification.find_by_path('jrubyfx-fxmlloader').full_gem_path, "lib")
|
99
|
+
end
|
100
|
+
#copy fxmlloader in
|
101
|
+
FileList["#{fxml_loader_path}/*"].each do |librb|
|
102
|
+
cp_r librb, target
|
103
|
+
end
|
104
|
+
|
105
|
+
# edit the jar
|
106
|
+
base_dir = Dir.pwd
|
107
|
+
cd target
|
108
|
+
sh "#{opts[:jar]} ufe '#{output_jar}' org.jruby.JarBootstrapMain *"
|
109
|
+
chmod 0775, output_jar
|
110
|
+
cd base_dir
|
111
|
+
|
112
|
+
if target_was_nil
|
113
|
+
mv "#{target}/#{output_jar}", final_jar
|
114
|
+
rm_rf target
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
# Uses Java 8 Ant task to create a native bundle (exe, deb, rpm, etc) of the
|
119
|
+
# specified jar-ified ruby script
|
120
|
+
def native_bundles(base_dir=Dir.pwd, output_jar, verbosity, app_name)
|
121
|
+
# Currently only JDK8 will package up JRuby apps. In the near
|
122
|
+
# future the necessary tools will be in maven central and
|
123
|
+
# we can download them as needed, so this can be changed then.
|
124
|
+
# this is in format "1.7.0_11-b21", check for all jdk's less than 8
|
125
|
+
if ENV_JAVA["java.runtime.version"].match(/^1\.[0-7]{1}\..*/)
|
126
|
+
raise "You must install JDK 8 to use the native-bundle packaging tools. You can still create an executable jar, though."
|
127
|
+
end
|
128
|
+
|
129
|
+
# the native bundling uses ant
|
130
|
+
require "ant"
|
131
|
+
|
132
|
+
output_jar = Pathname.new(output_jar)
|
133
|
+
dist_dir = output_jar.parent
|
134
|
+
jar_name = File.basename(output_jar)
|
135
|
+
out_name = File.basename(output_jar, '.*')
|
136
|
+
|
137
|
+
# Can't access the "fx" xml namespace directly, so we get it via __send__.
|
138
|
+
ant do
|
139
|
+
taskdef(resource: "com/sun/javafx/tools/ant/antlib.xml",
|
140
|
+
uri: "javafx:com.sun.javafx.tools.ant",
|
141
|
+
classpath: ".:${java.home}/../lib/ant-javafx.jar")
|
142
|
+
__send__("javafx:com.sun.javafx.tools.ant:deploy", nativeBundles: "all",
|
143
|
+
width: "100", height: "100", outdir: "#{base_dir}/build/",
|
144
|
+
outfile: out_name, verbose: verbosity) do
|
145
|
+
application(mainClass: "org.jruby.JarBootstrapMain", name: app_name)
|
146
|
+
resources do
|
147
|
+
fileset(dir: dist_dir) do
|
148
|
+
include name: jar_name
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
# These webstart files don't work, and the packager doesn't have an option to
|
155
|
+
# disable them, so remove them so the user isn't confused.
|
156
|
+
# FIXME: jnlp webstart
|
157
|
+
full_build_dir = "#{base_dir}/build/"
|
158
|
+
rm FileList["#{full_build_dir}*.html","#{full_build_dir}*.jnlp"]
|
159
|
+
end
|
160
|
+
|
161
|
+
def compile(cmdline)
|
162
|
+
require 'jrubyfx/compiler_app'
|
163
|
+
$JRUBYFX_AOT_COMPILING = true
|
164
|
+
$JRUBYFX_AOT_ERROR = false
|
165
|
+
CompilerApp.launch(*cmdline) # must use this to provide a full javafx environ so controls will build properly
|
166
|
+
raise $JRUBYFX_AOT_ERROR if $JRUBYFX_AOT_ERROR
|
167
|
+
end
|
168
|
+
|
169
|
+
|
170
|
+
private
|
171
|
+
def download(version_string) #:nodoc:
|
172
|
+
File.open("jruby-complete-#{version_string}.jar","wb") do |f|
|
173
|
+
f.write(open("#{BASE_URL}/#{version_string}/jruby-complete-#{version_string}.jar").read)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
module_function :jarify_jrubyfx
|
178
|
+
module_function :download_jruby
|
179
|
+
module_function :native_bundles
|
180
|
+
module_function :download
|
181
|
+
module_function :compile
|
182
|
+
end
|
183
|
+
end
|
metadata
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jrubyfx-master
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.1.brakemanpro1
|
5
|
+
platform: java
|
6
|
+
authors:
|
7
|
+
- Patrick Plenefisch
|
8
|
+
- Thomas E Enebo
|
9
|
+
- Hiroshi Nakamura
|
10
|
+
- Hiro Asari
|
11
|
+
- Neil Matatall
|
12
|
+
autorequire:
|
13
|
+
bindir: bin
|
14
|
+
cert_chain: []
|
15
|
+
date: 2015-10-05 00:00:00.000000000 Z
|
16
|
+
dependencies:
|
17
|
+
- !ruby/object:Gem::Dependency
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
23
|
+
name: rake
|
24
|
+
prerelease: false
|
25
|
+
type: :development
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - '>='
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0'
|
37
|
+
name: rspec
|
38
|
+
prerelease: false
|
39
|
+
type: :development
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - '='
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 0.4.master.2015.9.30
|
51
|
+
name: jrubyfx-fxmlloader-master
|
52
|
+
prerelease: false
|
53
|
+
type: :runtime
|
54
|
+
version_requirements: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - '='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: 0.4.master.2015.9.30
|
59
|
+
description: Enables JavaFX with FXML controllers and application in pure ruby. With some customizations.
|
60
|
+
email:
|
61
|
+
- simonpatp@gmail.com
|
62
|
+
- tom.enebo@gmail.com
|
63
|
+
- nahi@ruby-lang.org
|
64
|
+
- asari.ruby@gmail.com
|
65
|
+
- neil.matatall@gmail.com
|
66
|
+
executables:
|
67
|
+
- jrubyfx-generator
|
68
|
+
- jrubyfx-jarify
|
69
|
+
- jrubyfx-compile
|
70
|
+
extensions: []
|
71
|
+
extra_rdoc_files: []
|
72
|
+
files:
|
73
|
+
- lib/jrubyfx.rb
|
74
|
+
- lib/jrubyfx_tasks.rb
|
75
|
+
- lib/jrubyfx/application.rb
|
76
|
+
- lib/jrubyfx/compiler_app.rb
|
77
|
+
- lib/jrubyfx/controller.rb
|
78
|
+
- lib/jrubyfx/dsl.rb
|
79
|
+
- lib/jrubyfx/dsl_control.rb
|
80
|
+
- lib/jrubyfx/dsl_map.rb
|
81
|
+
- lib/jrubyfx/imports.rb
|
82
|
+
- lib/jrubyfx/java_fx_impl.rb
|
83
|
+
- lib/jrubyfx/module.rb
|
84
|
+
- lib/jrubyfx/part_imports.rb
|
85
|
+
- lib/jrubyfx/utils.rb
|
86
|
+
- lib/jrubyfx/version.rb
|
87
|
+
- lib/jrubyfx/core_ext/border_pane.rb
|
88
|
+
- lib/jrubyfx/core_ext/column_constraints.rb
|
89
|
+
- lib/jrubyfx/core_ext/drag_event.rb
|
90
|
+
- lib/jrubyfx/core_ext/duration.rb
|
91
|
+
- lib/jrubyfx/core_ext/effects.rb
|
92
|
+
- lib/jrubyfx/core_ext/exts.yml
|
93
|
+
- lib/jrubyfx/core_ext/file_chooser.rb
|
94
|
+
- lib/jrubyfx/core_ext/geometry.rb
|
95
|
+
- lib/jrubyfx/core_ext/grid_pane.rb
|
96
|
+
- lib/jrubyfx/core_ext/image_view.rb
|
97
|
+
- lib/jrubyfx/core_ext/media_player.rb
|
98
|
+
- lib/jrubyfx/core_ext/observable_value.rb
|
99
|
+
- lib/jrubyfx/core_ext/pagination.rb
|
100
|
+
- lib/jrubyfx/core_ext/path.rb
|
101
|
+
- lib/jrubyfx/core_ext/precompiled.rb
|
102
|
+
- lib/jrubyfx/core_ext/progress_indicator.rb
|
103
|
+
- lib/jrubyfx/core_ext/radial_gradient.rb
|
104
|
+
- lib/jrubyfx/core_ext/region.rb
|
105
|
+
- lib/jrubyfx/core_ext/rotate.rb
|
106
|
+
- lib/jrubyfx/core_ext/stage.rb
|
107
|
+
- lib/jrubyfx/core_ext/table_view.rb
|
108
|
+
- lib/jrubyfx/core_ext/timeline.rb
|
109
|
+
- lib/jrubyfx/core_ext/transition.rb
|
110
|
+
- lib/jrubyfx/core_ext/tree_view.rb
|
111
|
+
- lib/jrubyfx/core_ext/xy_chart.rb
|
112
|
+
- lib/jrubyfx/utils/__ignore_java_stupid_rdoc.rb
|
113
|
+
- lib/jrubyfx/utils/common_converters.rb
|
114
|
+
- lib/jrubyfx/utils/common_utils.rb
|
115
|
+
- lib/jrubyfx/utils/string_utils.rb
|
116
|
+
- LICENSE
|
117
|
+
- README.md
|
118
|
+
- bin/jrubyfx-generator
|
119
|
+
- bin/jrubyfx-jarify
|
120
|
+
- bin/jrubyfx-compile
|
121
|
+
homepage: https://github.com/jruby/jrubyfx
|
122
|
+
licenses:
|
123
|
+
- Apache-2.0
|
124
|
+
metadata: {}
|
125
|
+
post_install_message:
|
126
|
+
rdoc_options: []
|
127
|
+
require_paths:
|
128
|
+
- lib
|
129
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '>'
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 1.3.1
|
139
|
+
requirements: []
|
140
|
+
rubyforge_project:
|
141
|
+
rubygems_version: 2.1.9
|
142
|
+
signing_key:
|
143
|
+
specification_version: 4
|
144
|
+
summary: JavaFX for JRuby with FXML
|
145
|
+
test_files: []
|