Skip to content

Commit e138a17

Browse files
authored
Merge pull request #54 from ruby-processing/jruby-9.3.1.0
Jruby 9.3.1.0
2 parents 3edf1d9 + 55d70b1 commit e138a17

File tree

7 files changed

+25
-26
lines changed

7 files changed

+25
-26
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
**v2.6.0** Recommend JRuby-9.3.1.0 use, move non-java files to resources (simplifies path). Use `field` not `declared_field` to access java_class fields.
2+
13
**v2.5.1** Recommend JRuby-9.2.19.0 use.
24

35
**v2.5.0** Refactor noise to delegate pattern and make OpenSimplex2 noise default noise, implement pdf and svg export libraries.

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
[![Gem Version](https://badge.fury.io/rb/jruby_art.svg)](https://badge.fury.io/rb/jruby_art) ![Travis CI](https://travis-ci.org/ruby-processing/JRubyArt.svg)
44

5-
A new version for jdk11 use, does not require an installed `vanilla processing`, however if installed you can use processing-ide to download libraries. Configuration file is incompatible with that of previous version of JRubyArt (and you should move or rename old `config.yml` to keep it). This version will run with a default configuration file but you won't be able to use processing libraries, until you match configuration to your setup. Illegal reflective access warning should be fixed for this release (by using JOGL-2.4.0-rc jars), though you may need to define `JAVA_HOME` for JRuby warnings to be suppressed.
5+
A new version for jdk11+ and JRuby-9.3.1.0 use, does not require an installed `vanilla processing`, however if installed you can use processing-ide to download libraries. Configuration file is incompatible with that of previous version of JRubyArt (and you should move or rename old `config.yml` to keep it). This version will run with a default configuration file but you won't be able to use processing libraries, until you match configuration to your setup. Illegal reflective access warning should be fixed for this release (by using JOGL-2.4.0-rc jars), though you may need to define `JAVA_HOME` for JRuby warnings to be suppressed.
66

77
## Requirements
88

9-
A clean start for `jruby_art` with custom processing core included, built for [jruby-9.2.16.0](http://jruby.org/download) see [wiki](https://github.com/ruby-processing/JRubyArt/wiki/Building-latest-gem) for building gem from this repo.
9+
A clean start for `jruby_art` with custom processing core included, built for [jruby-9.3.1.0](http://jruby.org/download) see [wiki](https://github.com/ruby-processing/JRubyArt/wiki/Building-latest-gem) for building gem from this repo.
1010

1111
## Requirements
1212

13-
A suitable version of ruby (MRI `ruby 2.5+` or `jruby-9.2.16.0`) to download gem. NB: avoid ruby 2.7, it is guaranteed to give you problems (you've been warned)
14-
Tested and working AdoptOpenJDK 11-13, OpenJ9 14, if you have any issues with opengl sketches with distro installed JDK use a JDK from AdoptOpenJDK.
13+
A suitable version of ruby (MRI `ruby 2.6+` or `jruby-9.3.1.0`) to download gem. NB: avoid ruby 2.7, it is guaranteed to give you problems (you've been warned)
14+
Tested and working OpenJDK 11-17, if you have any issues with opengl sketches with distro installed JDK use a JDK from AdoptOpenJDK.
1515

1616

1717
## Configuration
@@ -87,7 +87,7 @@ k9 --live sketch.rb # pry is bound to Processing.app # needs `jruby -S gem insta
8787

8888
## Example sketches
8989

90-
[Worked Examples](https://github.com/ruby-processing/JRubyArt-examples) and, [The-Nature-of-Code-Examples-for-JRubyArt](https://github.com/ruby-processing/The-Nature-of-Code-for-JRubyArt) feel free to add your own, especially ruby-2.4+ syntax now we can. These can now be downloaded using `k9 --install` please move existing `k9_samples` if you wish to keep them.
90+
[Worked Examples](https://github.com/ruby-processing/JRubyArt-examples) and, [The-Nature-of-Code-Examples-for-JRubyArt](https://github.com/ruby-processing/The-Nature-of-Code-for-JRubyArt) feel free to add your own, especially ruby-2.6+ syntax now we can. These can now be downloaded using `k9 --install` please move existing `k9_samples` if you wish to keep them.
9191

9292
[adopt]: https://adoptopenjdk.net/
9393
[pi]: http://ruby-processing.github.io/JRubyArt/raspberrypi_started/

lib/jruby_art/helper_methods.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ def find_method(method_name)
123123
# some methods. Add to this list as needed.
124124
def proxy_java_fields
125125
fields = %w[key frameRate mousePressed keyPressed]
126-
methods = fields.map { |field| java_class.declared_field(field) }
127-
@declared_fields = Hash[fields.zip(methods)]
126+
methods = fields.map { |field| java_class.field(field) }
127+
@jfields = Hash[fields.zip(methods)]
128128
end
129129

130130
# Fix java conversion problems getting the last key
131131
# If it's ASCII, return the character, otherwise the integer
132132
def key
133-
int = @declared_fields['key'].value(java_self)
133+
int = @jfields['key'].value(java_self)
134134
int < 256 ? int.chr : int
135135
end
136136

@@ -167,19 +167,19 @@ def save_strings(filename, strings)
167167

168168
# frame_rate needs to support reading and writing
169169
def frame_rate(fps = nil)
170-
return @declared_fields['frameRate'].value(java_self) unless fps
170+
return @jfields['frameRate'].value(java_self) unless fps
171171

172172
super(fps)
173173
end
174174

175175
# Is the mouse pressed for this frame?
176176
def mouse_pressed?
177-
@declared_fields['mousePressed'].value(java_self)
177+
@jfields['mousePressed'].value(java_self)
178178
end
179179

180180
# Is a key pressed for this frame?
181181
def key_pressed?
182-
@declared_fields['keyPressed'].value(java_self)
182+
@jfields['keyPressed'].value(java_self)
183183
end
184184

185185
private

lib/jruby_art/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
# A wrapper for version
44
module JRubyArt
5-
VERSION = '2.5.1'
5+
VERSION = '2.6.0'
66
end

pom.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project 'jruby_art', 'https://github.com/ruby-processing/JRubyArt' do
22

33
model_version '4.0.0'
4-
id 'ruby-processing:jruby_art:2.5.1'
4+
id 'ruby-processing:jruby_art:2.6.0'
55
packaging 'jar'
66

77
description 'Jar for JRubyArt'
@@ -28,11 +28,12 @@
2828
'polyglot.dump.pom' => 'pom.xml',
2929
'project.build.sourceEncoding' => 'UTF-8',
3030
'jogl.version' => '2.3.2',
31+
'jruby.version' => '9.3.1.0',
3132
'itextpdf.version' => '5.5.13.2',
3233
'batik.version' => '1.14',
3334
'jruby.api' => 'http://jruby.org/apidocs/' )
3435

35-
pom 'org.jruby:jruby:9.2.19.0'
36+
jar 'org.jruby:jruby-base:${jruby.version}'
3637
jar 'org.jogamp.jogl:jogl-all:${jogl.version}'
3738
jar 'org.jogamp.gluegen:gluegen-rt-main:${jogl.version}'
3839
jar 'org.processing:video:3.0.2'
@@ -76,12 +77,11 @@
7677
build do
7778
resource do
7879
directory '${source.directory}/main/java'
79-
includes '**/**/*.glsl', '**/*.jnilib'
8080
excludes '**/**/*.java'
8181
end
8282
resource do
8383
directory '${source.directory}/main/resources'
84-
includes '**/*.png', '*.txt'
84+
includes '**/*.png', '**/*.txt', '**/*.glsl'
8585
end
8686
end
8787

pom.xml

+6-9
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ DO NOT MODIFY - GENERATED CODE
1111
<modelVersion>4.0.0</modelVersion>
1212
<groupId>ruby-processing</groupId>
1313
<artifactId>jruby_art</artifactId>
14-
<version>2.5.1</version>
14+
<version>2.6.0</version>
1515
<name>jruby_art</name>
1616
<description>Jar for JRubyArt</description>
1717
<url>https://github.com/ruby-processing/JRubyArt</url>
@@ -66,6 +66,7 @@ DO NOT MODIFY - GENERATED CODE
6666
<itextpdf.version>5.5.13.2</itextpdf.version>
6767
<jogl.version>2.3.2</jogl.version>
6868
<jruby.api>http://jruby.org/apidocs/</jruby.api>
69+
<jruby.version>9.3.1.0</jruby.version>
6970
<jruby_art.basedir>${project.basedir}</jruby_art.basedir>
7071
<polyglot.dump.pom>pom.xml</polyglot.dump.pom>
7172
<processing.api>http://processing.github.io/processing-javadocs/core/</processing.api>
@@ -75,9 +76,8 @@ DO NOT MODIFY - GENERATED CODE
7576
<dependencies>
7677
<dependency>
7778
<groupId>org.jruby</groupId>
78-
<artifactId>jruby</artifactId>
79-
<version>9.2.19.0</version>
80-
<type>pom</type>
79+
<artifactId>jruby-base</artifactId>
80+
<version>${jruby.version}</version>
8181
</dependency>
8282
<dependency>
8383
<groupId>org.jogamp.jogl</groupId>
@@ -109,10 +109,6 @@ DO NOT MODIFY - GENERATED CODE
109109
<resources>
110110
<resource>
111111
<directory>${source.directory}/main/java</directory>
112-
<includes>
113-
<include>**/**/*.glsl</include>
114-
<include>**/*.jnilib</include>
115-
</includes>
116112
<excludes>
117113
<exclude>**/**/*.java</exclude>
118114
</excludes>
@@ -121,7 +117,8 @@ DO NOT MODIFY - GENERATED CODE
121117
<directory>${source.directory}/main/resources</directory>
122118
<includes>
123119
<include>**/*.png</include>
124-
<include>*.txt</include>
120+
<include>**/*.txt</include>
121+
<include>**/*.glsl</include>
125122
</includes>
126123
</resource>
127124
</resources>

vendors/Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ WARNING = <<~WARN
1111
1212
WARN
1313
# https://github.com/processing/processing-video/releases/download/r6-v2.0-beta4/video-2.0-beta4.zip
14-
JRUBYC_VERSION = '9.2.19.0'
14+
JRUBYC_VERSION = '9.3.1.0'
1515
SOUND = 'sound.zip'
1616
SOUND_VERSION = 'v2.2.3'
1717
VIDEO = 'video.zip'

0 commit comments

Comments
 (0)