Skip to content
Open
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
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
test:
name: Java ${{ matrix.java }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: ['8', '11', '17', '21']

steps:
- name: checkout
uses: actions/checkout@v6
- name: set up Java
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: set up ant (rake-ant shells out to `ant -diagnostics`)
uses: cedx/SetupAnt@v7
- name: build and test
run: ./mvnw -ntp -B verify

# The Central-ready bundle: sources, javadoc and the jar. Signing needs the
# release key, so it is skipped here.
release-profile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '21'
cache: 'maven'
- name: package with release profile
run: ./mvnw -ntp -B -Prelease verify -DskipTests -Dgpg.skip
- uses: actions/upload-artifact@v4
with:
name: jruby-ant-jars
path: target/*.jar
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
target/
.idea/
*.iml
.classpath
.project
.settings/
.vscode/
.DS_Store
.mvn/wrapper/maven-wrapper.jar
9 changes: 9 additions & 0 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<!-- lets Maven resolve rubygems.org gems as rubygems:<name>:<version> artifacts -->
<extension>
<groupId>org.jruby.maven</groupId>
<artifactId>mavengem-wagon</artifactId>
<version>2.0.2</version>
</extension>
</extensions>
3 changes: 3 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# jruby-ant

Ant tasks that run [Rake](https://github.com/ruby/rake) from an Ant build, the opposite
direction of the [rake-ant](https://github.com/jruby/rake-ant) gem (which calls Ant from a
Rakefile). These tasks used to live in JRuby itself as `org.jruby.ant`.

```xml
<taskdef name="rake" classname="org.jruby.ant.Rake"/>
<taskdef name="rake-import" classname="org.jruby.ant.RakeImport"/>

<rake file="Rakefile" task="default"/>
<rake-import file="Rakefile"/>
```

## Maven

```xml
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-ant</artifactId>
<version>1.0.0</version>
</dependency>
```

## Requirements

`jruby-base`/`jruby-complete` and `ant` are `provided`: put them on Ant's classpath yourself,
along with JRuby's standard library (for Rake).

The Ruby half, the [rake-ant](https://github.com/jruby/rake-ant) gem, is bundled into the
jar (its `lib` files sit at the jar root), so there is no separate gem to install. The version
is `rake-ant.version` in `pom.xml`.

rake-ant finds Ant's jars through `ANT_HOME` or by running `ant -diagnostics`, so Ant must be
installed (`ANT_HOME` set or `ant` on `PATH`).

## Building

```
./mvnw verify
```

The build downloads the rake-ant gem from rubygems.org through the
[mavengem](https://github.com/jruby/mavengem-wagon) wagon (`.mvn/extensions.xml`), installs it
with `gem-maven-plugin` and copies its `lib` into `target/classes`. Tests are unit tests against
a stub `RakeWrapper` plus an Ant -> Rake integration test (skipped without Ant installed).

## Releasing

Releases use the Maven release plugin. The plugin runs `deploy` with the `release` profile
(sources and javadoc jars, GPG signing, upload to the Central Portal), so GPG and the `central`
server credentials must be set up in `settings.xml`:

```
./mvnw release:prepare
./mvnw release:perform
```
Loading