Skip to content

Commit

Permalink
docs: Added project logo and improved README. (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
amunra authored Jan 20, 2023
1 parent c3d1ccd commit 510a797
Show file tree
Hide file tree
Showing 4 changed files with 7,988 additions and 6 deletions.
50 changes: 44 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,50 @@
# rust-maven-plugin
Build Rust Cargo crates within a Java Maven Project

<img src="./artwork/logo_outline_text.svg" alt="rust-maven-plugin">

Build Rust Cargo crates within a Java Maven Project with this plugin.

The use case is to simplify the build process of
[Rust JNI libs](https://crates.io/crates/jni) inside a Java
[Maven](https://maven.apache.org/) project.

# Features

The plugin provides the following features:

* Calls `cargo build` as part of a `mvn compile` step.

* If Rust isn't found, points users to https://www.rust-lang.org/tools/install.

* Builds inside Maven's target directory:
* Passes `${project.build.directory}/rust-maven-plugin/${crate_name}` as
`cargo build --target-dir`.
* Thus, `mvn clean` also cleans the Rust crates without additional `pom.xml`
setup.

* Optionally:
* Can be configured to copy the compiled cdylib(s) to the
`${project.build.directory}/classes/` directory so the binaries ends up
bundled in the JAR.

* As a separate runtime dependency we also provide [`jar-jni`](jar-jni/),
a helper java library to load the libs from the JAR using a sub-directory
per `os.name`/`os.arch` so the JAR can contain binaries for multiple
platforms.

# Example
See the [`rust-maven-example`](rust-maven-example/) directory for a working
example.

# Status
* Building, cleaning and bundling into a .jar now works.
* Running Rust tests doesn't yet.
* Pre-production:
* Building, cleaning, and bundling into a `.jar` now works.
* Running Rust tests (calling `cargo test`) isn't implemented yet.
* Not yet available on maven central:
In the meantime `cd rust-maven-plugin && mvn install`.

If you want to help out, check out our
[open issues](https://github.com/questdb/rust-maven-plugin/issues).

# Dev Commands

Expand All @@ -24,9 +65,6 @@ mvn install
mvn io.questdb:rust-maven-plugin:build -Drelease=true
```

# Example
See `rust-maven-example` directory for a working example.

# Special thanks

* OktaDev for covering custom Maven plugins on YouTube: https://www.youtube.com/watch?v=wHX4j0z-sUU
Expand Down
Loading

0 comments on commit 510a797

Please sign in to comment.