Conversation
org.jruby.ant.Rake and RakeImport let an Ant build.xml run Rake through <taskdef>. They require 'ant/tasks/raketasks', which left JRuby when the Ant integration moved to the rake-ant gem (63be80b, 2017); the gem ships it as rake/ant/tasks/raketasks, so the tasks have failed with a LoadError since then. With them gone nothing in JRuby compiles against Ant, so drop the provided org.apache.ant:ant dependency from core and test and the ant.version property. Remove an unused Ant import from AddCallProtocolInstructions and read the expected file with java.nio.file.Files in ReaderInputStreamTest instead of Ant's FileUtils. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
We should create a new Maven artifact org.jruby:jruby-ant so it's available for any remaining Ant + Rake users out there. Or ant-jruby? ant-tasks? Just ant? I feel like I've already spent too much brainpower thinking about it. 😀 Given that this will require a new repo etc I'll create that quickly and get it set up. |
Member
|
It's live: https://github.com/jruby/jruby-ant Publishing isn't fully set up but snapshot deploy works. No tests because apparently we don't have any. |
Member
|
cc @enebo if you have any thoughts on the new jruby-ant artifact |
Contributor
Author
|
Thanks @headius for creating jruby/jruby-ant. I opened a draft PR there that gets it ready to publish: jruby/jruby-ant#1
🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #9761, which removes Ant from JRuby's rake tasks. This removes the last Ant code in JRuby itself.
What
org.jruby.antwasorg.jruby.ant.RakeandRakeImportare Ant tasks that let an Antbuild.xmlcall Rake. That's the opposite direction from the rake-ant gem, which lets a Rakefile call Ant:RakeTaskBasestarts aScriptingContainerand callsrequire 'ant/tasks/raketasks'to get aRakeWrapper.They have been broken since 2017
In 63be80b ("Remove ant DSL/wrapper from stdlib and replace with gem", JRuby 9.2), that file moved into the rake-ant gem as
rake/ant/tasks/raketasks.rb, butRakeTaskBasewas never updated. On current master,require 'ant/tasks/raketasks'raisesLoadError, so both tasks fail as soon as they're constructed. Nothing in JRuby or rake-ant referencesorg.jruby.ant.Changes
core/src/main/java/org/jruby/ant/(3 files, about 100 lines).providedorg.apache.ant:antdependency fromcore/pom.rbandtest/pom.rb, and theant.versionproperty frompom.rb. The pom.xml files are regenerated.org.apache.tools.ant.util.CollectionUtilsimport fromAddCallProtocolInstructions.ReaderInputStreamTest, useFiles.readString(..., Charset.defaultCharset())instead of Ant'sFileUtils.readFully(new FileReader(...)). Both read with the default charset.ant-commons-net, which is declared on maven-antrun-plugin inpom.rb, is unrelated and stays.Question: move the tasks to rake-ant, or drop them?
Old codebases might still have a
build.xmlthattaskdefsorg.jruby.ant.Rake, although it can't have worked on any JRuby since 9.2. The Ruby half (RakeWrapper) already lives in rake-ant. Should these Java tasks go there too? That would mean adding a Java build to rake-ant and fixing the require path. Or should they just be dropped? If they're dropped,RakeWrapperin rake-ant has no callers and could be removed there later.Testing
Temurin 21, no Ant installed:
./mvnw -Pbootstrap clean packagepasses, and the built jars contain noorg/jruby/ant/classes../mvnw -Ptest -pl core test -Dtest=ReaderInputStreamTest: all core test sources compile without the Ant jar, and the test passes (10/10).Co-authored with Claude Code