diff --git a/CHANGELOG.md b/CHANGELOG.md index 568af85..30be56e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +**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. + **v2.5.1** Recommend JRuby-9.2.19.0 use. **v2.5.0** Refactor noise to delegate pattern and make OpenSimplex2 noise default noise, implement pdf and svg export libraries. diff --git a/README.md b/README.md index 99d552c..4db7262 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,16 @@ [![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) -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. +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. ## Requirements -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. +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. ## Requirements -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) -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. +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) +Tested and working OpenJDK 11-17, if you have any issues with opengl sketches with distro installed JDK use a JDK from AdoptOpenJDK. ## Configuration @@ -87,7 +87,7 @@ k9 --live sketch.rb # pry is bound to Processing.app # needs `jruby -S gem insta ## Example sketches -[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. +[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. [adopt]: https://adoptopenjdk.net/ [pi]: http://ruby-processing.github.io/JRubyArt/raspberrypi_started/ diff --git a/lib/jruby_art/helper_methods.rb b/lib/jruby_art/helper_methods.rb index 7c4a62a..2da7d97 100644 --- a/lib/jruby_art/helper_methods.rb +++ b/lib/jruby_art/helper_methods.rb @@ -123,14 +123,14 @@ def find_method(method_name) # some methods. Add to this list as needed. def proxy_java_fields fields = %w[key frameRate mousePressed keyPressed] - methods = fields.map { |field| java_class.declared_field(field) } - @declared_fields = Hash[fields.zip(methods)] + methods = fields.map { |field| java_class.field(field) } + @jfields = Hash[fields.zip(methods)] end # Fix java conversion problems getting the last key # If it's ASCII, return the character, otherwise the integer def key - int = @declared_fields['key'].value(java_self) + int = @jfields['key'].value(java_self) int < 256 ? int.chr : int end @@ -167,19 +167,19 @@ def save_strings(filename, strings) # frame_rate needs to support reading and writing def frame_rate(fps = nil) - return @declared_fields['frameRate'].value(java_self) unless fps + return @jfields['frameRate'].value(java_self) unless fps super(fps) end # Is the mouse pressed for this frame? def mouse_pressed? - @declared_fields['mousePressed'].value(java_self) + @jfields['mousePressed'].value(java_self) end # Is a key pressed for this frame? def key_pressed? - @declared_fields['keyPressed'].value(java_self) + @jfields['keyPressed'].value(java_self) end private diff --git a/lib/jruby_art/version.rb b/lib/jruby_art/version.rb index 0592635..b980ec9 100644 --- a/lib/jruby_art/version.rb +++ b/lib/jruby_art/version.rb @@ -2,5 +2,5 @@ # A wrapper for version module JRubyArt - VERSION = '2.5.1' + VERSION = '2.6.0' end diff --git a/pom.rb b/pom.rb index bb5229d..6843999 100644 --- a/pom.rb +++ b/pom.rb @@ -1,7 +1,7 @@ project 'jruby_art', 'https://github.com/ruby-processing/JRubyArt' do model_version '4.0.0' - id 'ruby-processing:jruby_art:2.5.1' + id 'ruby-processing:jruby_art:2.6.0' packaging 'jar' description 'Jar for JRubyArt' @@ -28,11 +28,12 @@ 'polyglot.dump.pom' => 'pom.xml', 'project.build.sourceEncoding' => 'UTF-8', 'jogl.version' => '2.3.2', + 'jruby.version' => '9.3.1.0', 'itextpdf.version' => '5.5.13.2', 'batik.version' => '1.14', 'jruby.api' => 'http://jruby.org/apidocs/' ) - pom 'org.jruby:jruby:9.2.19.0' + jar 'org.jruby:jruby-base:${jruby.version}' jar 'org.jogamp.jogl:jogl-all:${jogl.version}' jar 'org.jogamp.gluegen:gluegen-rt-main:${jogl.version}' jar 'org.processing:video:3.0.2' @@ -76,12 +77,11 @@ build do resource do directory '${source.directory}/main/java' - includes '**/**/*.glsl', '**/*.jnilib' excludes '**/**/*.java' end resource do directory '${source.directory}/main/resources' - includes '**/*.png', '*.txt' + includes '**/*.png', '**/*.txt', '**/*.glsl' end end diff --git a/pom.xml b/pom.xml index 86a67c3..2b8c4de 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ DO NOT MODIFY - GENERATED CODE 4.0.0 ruby-processing jruby_art - 2.5.1 + 2.6.0 jruby_art Jar for JRubyArt https://github.com/ruby-processing/JRubyArt @@ -66,6 +66,7 @@ DO NOT MODIFY - GENERATED CODE 5.5.13.2 2.3.2 http://jruby.org/apidocs/ + 9.3.1.0 ${project.basedir} pom.xml http://processing.github.io/processing-javadocs/core/ @@ -75,9 +76,8 @@ DO NOT MODIFY - GENERATED CODE org.jruby - jruby - 9.2.19.0 - pom + jruby-base + ${jruby.version} org.jogamp.jogl @@ -109,10 +109,6 @@ DO NOT MODIFY - GENERATED CODE ${source.directory}/main/java - - **/**/*.glsl - **/*.jnilib - **/**/*.java @@ -121,7 +117,8 @@ DO NOT MODIFY - GENERATED CODE ${source.directory}/main/resources **/*.png - *.txt + **/*.txt + **/*.glsl diff --git a/vendors/Rakefile b/vendors/Rakefile index 3eb45ea..dab2e35 100644 --- a/vendors/Rakefile +++ b/vendors/Rakefile @@ -11,7 +11,7 @@ WARNING = <<~WARN WARN # https://github.com/processing/processing-video/releases/download/r6-v2.0-beta4/video-2.0-beta4.zip -JRUBYC_VERSION = '9.2.19.0' +JRUBYC_VERSION = '9.3.1.0' SOUND = 'sound.zip' SOUND_VERSION = 'v2.2.3' VIDEO = 'video.zip'