Repository navigation
Add ant_graph_task to draw Ant target dependencies - #7
Merged
Merged
Conversation
JRuby tested this gem with RSpec specs under spec/java_integration/ant, which made Ant a requirement for JRuby's own test suite. Port them here as minitest tests so JRuby can drop them, and convert the existing test-unit test to minitest as well. - test/ant_test_helper.rb replaces ant_spec_helper.rb; the RSpec structure matcher becomes assert_structure/assert_configured_structure - the Ant.load tests stub File.exist? with minitest-mock - the jarjar examples are dropped, since they needed a third-party jar; the jar examples still cover structure matching - target_spec's "does not support ant" example passed only by accident; it now runs Ant's <ant> task against a temporary buildfile - add a GitHub Actions workflow running `rake test` on JRuby with Ant - relax the bundler development dependency so current Bundler works Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JRuby's rakelib/graph.rake (graph:viz, added in 2011 as an "ant target visualizer") drew the targets of JRuby's Ant build.xml with Graphviz. JRuby no longer has an Ant build and removes it in jruby/jruby#9761, so move the idea here as a reusable feature: - Rake::Ant.dot(project) returns Graphviz DOT text with an edge from each dependency to the target that depends on it, sanitizing - and . in target names as graph.rake did - ant_graph_task(name, buildfile, output) defines a task that ant_imports the build file and pipes the DOT text to `dot -Tpng -x` - CI installs Graphviz so the PNG test runs; it skips without `dot` Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
headius
approved these changes
Oct 2, 2026
Member
|
Looks good! Maybe nobody will ever use it, but at least it has a home. |
Member
|
Still marked as draft; let me know when you're satisfied. |
zev
marked this pull request as ready for review
October 2, 2026 15:55
Contributor
Author
|
@headius this is ready. Thanks! |
Contributor
Author
|
@headius friendly ping: this is approved and ready from my side. Could you merge it when you get a chance? |
Member
|
Thank you! I think we are basically done with this and jruby-ant? |
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.
Depends on #6. This branch is stacked on it and uses its minitest setup, so it shows #6's commit until #6 merges. Only the last commit, "Add ant_graph_task to draw Ant target dependencies", is new here.
In jruby/jruby#9761, @headius suggested moving JRuby's
graph:viztask here along with the Ant specs.rakelib/graph.rake(8975245913, 2011, "ant target visualizer") loaded JRuby's Antbuild.xmland drew its target dependencies with Graphviz. JRuby no longer has an Ant build, so this adds the same idea here as a reusable feature:Rake::Ant.dot(project)(lib/rake/ant/graph.rb) returns Graphviz DOT text, with an edge from each dependency to the target that depends on it. Likegraph.rake, it replaces-and.in target names with_.ant_graph_task(name = :'ant:graph', buildfile = 'build.xml', output = 'build_graph.png')(lib/rake/ant/rake.rb, next toant_task) defines a Rake task thatant_imports the build file and pipes the DOT text todot -Tpng -x. It usesIO.popeninstead ofgraph.rake's temp file,catand shell.For example, with
test/graph_example.xml:Testing
test/test_graph.rbchecks the DOT edges fortest/graph_example.xml, that the task is defined, and that the task writes a PNG. The PNG test skips whendotisn't installed.jrubyandjruby-head.Co-authored with Claude Code.