Skip to content

Fix require path, add tests, CI and a Central-ready pom - #1

Draft
zev wants to merge 2 commits into
jruby:mainfrom
zev:add-tests-ci-release-pom
Draft

zev wants to merge 2 commits into
jruby:mainfrom
zev:add-tests-ci-release-pom

Conversation

@zev

@zev zev commented Oct 2, 2026

Copy link
Copy Markdown

Follow-up to jruby/jruby#9766, where the `org.jruby.ant` tasks were moved here.

Fixes

  • `RakeTaskBase` required `ant/tasks/raketasks`, which the rake-ant gem ships as `rake/ant/tasks/raketasks`. The tasks have raised `LoadError` since JRuby 9.2. The path now comes from an overridable `rakeTasksLibrary()` so tests can stub it.
  • Dropped `setLoadPaths("lib")` (the old FIXME), which put the current directory's `lib` on the load path.
  • `RakeImport` passed its argument list as one nested element, so `-f ` never reached Rake. It now uses `toArray()` like `Rake`.

Tests and CI

  • `RakeTasksTest`: 6 unit tests against a stub `RakeWrapper`.
  • `RakeIntegrationTest`: runs a real `build.xml` that calls a real Rakefile through the rake-ant gem. It is skipped unless `-Drake.ant.lib=/lib` is set, and the CI workflow sets it.
  • `.github/workflows/ci.yml`: Java 8/11/17/21 matrix plus a job that builds the release bundle without signing. Maven wrapper added.

pom

  • `1.0.0-SNAPSHOT`, Central metadata (description, URL, EPL/GPL/LGPL licenses, developers, SCM, issues) and `maven.compiler.release=8`.
  • A `release` profile mirroring JRuby's: sources and javadoc jars, `maven-gpg-plugin` signing, and `central-publishing-maven-plugin`. The snapshot deploy path is unchanged.

For @headius

  • Please check the GPG signing setup, and remove it if you want to handle it differently.
  • I guessed the tri-license and the developer list from JRuby's pom, so please confirm them. There is no LICENSE file yet.
  • Neither signing nor the Central upload has been tested.
  • rake-ant needs a real Ant install (`ANT_HOME` or `ant` on PATH) even when running inside Ant. The README notes it.

🤖 Generated with Claude Code

- Require rake/ant/tasks/raketasks (the rake-ant gem's path); the old
  ant/tasks/raketasks path has raised LoadError since JRuby 9.2.
- Stop adding the current directory's lib to the load path.
- RakeImport passed its argument list as a single nested element, so -f
  never reached Rake.
- Add unit tests against a stub RakeWrapper and an integration test that
  runs a real build.xml through the rake-ant gem.
- Add CI workflow, Maven wrapper, README and .gitignore.
- pom: 1.0.0-SNAPSHOT, Central metadata, release.version 8, and a release
  profile (sources, javadoc, GPG signing, central-publishing plugin).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* The Ruby library that defines <code>RakeWrapper</code>. It ships in the rake-ant gem.
*/
protected String rakeTasksLibrary() {
return "rake/ant/tasks/raketasks";

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@headius this implies this project needs rake-ant, hence why I was wondering if we should just have this in there vs a new repo.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess our options are

  1. Mixed project that pushes a gem for rake-ant and an artifact for jruby-ant, similar to how JRuby pushes a jruby-jars gem that's equivalent to jruby-core + jruby-stdlib Maven artifacts.
  2. Two separate projects that ship each other to their target.

I don't think anything in rake-ant depends on the Java-based taskdex, though, so perhaps it would be sufficient to have this artifact ship with rake-ant (using mavengem and jruby-maven-plugins to include the contents).

@headius headius left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open question about the best way to include the rake-ant sources, but I think pulling them down via mavengems is the best option.

Comment thread README.md Outdated
./mvnw verify -Drake.ant.lib=/path/to/rake-ant/lib # also runs the real Ant -> Rake test
```

Releases: `./mvnw -Prelease deploy` attaches sources and javadoc, signs with GPG and uploads to

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Releases will use the Maven release plugin, via the release:prepare and release:perform cycle, so this separate of tasks into the release profile may not be the simplest way.

- Resolve rake-ant 1.0.6 from rubygems.org with the mavengem wagon, install
  it with gem-maven-plugin and copy its lib into the jar. The integration
  test and CI no longer need a separate rake-ant checkout.
- The mavengem repository is in a profile that is only active in this
  project, so it does not leak to consumers of jruby-ant.
- Configure maven-release-plugin (releaseProfiles=release, goals=deploy) and
  document release:prepare / release:perform.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@zev

zev commented Oct 2, 2026

Copy link
Copy Markdown
Author

Pushed 5bd29d6 to address the review:

  • rake-ant bundled via mavengem. rake-ant 1.0.6 (currently the latest release on rubygems.org) is resolved with the mavengem wagon, installed with gem-maven-plugin, and its lib is copied into the jar root. A new rake-ant release only needs a rake-ant.version bump. The jar now contains rake/ant/**, so no separate gem install is needed.
  • The integration test no longer needs a rake-ant checkout, and CI dropped the clone step. It still needs a real Ant install, because the gem runs ant -diagnostics.
  • The mavengem repository sits in a profile that is only active when .mvn/extensions.xml exists, so it doesn't leak into consumers' poms. I checked a consumer project: it sees only jruby-ant, with no gem dependency and no mavengem: repository.
  • Release plugin: maven-release-plugin is configured with releaseProfiles=release, goals=deploy and tagNameFormat=@{project.version}. The README now documents release:prepare and release:perform. I haven't run those yet, so signing and the Central upload remain untested.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants