Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
- { os: ubuntu-latest , ruby: 3.4, env: "JSON_DEBUG=1" }
- { os: macos-13, ruby: 3.4 }
- { os: windows-latest , ruby: mswin } # ruby/ruby windows CI
- { os: macos-latest , ruby: jruby-9.4 } # Ruby 3.1
- { os: ubuntu-latest , ruby: jruby-9.4 } # Ruby 3.1
- { os: macos-latest , ruby: truffleruby-head }
- { os: ubuntu-latest , ruby: truffleruby-head }
Expand Down
12 changes: 11 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ JAVA_CLASSES = []
JRUBY_PARSER_JAR = File.expand_path("lib/json/ext/parser.jar")
JRUBY_GENERATOR_JAR = File.expand_path("lib/json/ext/generator.jar")

CLEAN.concat FileList["java/src/**/*.class"]
CLEAN << JRUBY_PARSER_JAR
CLEAN << JRUBY_GENERATOR_JAR

CLOBBER << JAVA_PARSER_SRC

which = lambda { |c|
w = `which #{c}`
break w.chomp unless w.empty?
Expand Down Expand Up @@ -140,7 +146,11 @@ if defined?(RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
classpath = (Dir['java/lib/*.jar'] << 'java/src' << JRUBY_JAR) * path_separator
obj = src.sub(/\.java\Z/, '.class')
file obj => src do
sh 'javac', '-classpath', classpath, '-source', '1.8', '-target', '1.8', src
if File.exist?(File.join(ENV['JAVA_HOME'], "lib", "modules"))
sh 'javac', '-classpath', classpath, '--release', '8', src
else
sh 'javac', '-classpath', classpath, '-source', '1.8', '-target', '1.8', src
end
end
JAVA_CLASSES << obj
end
Expand Down
Loading