Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [Unreleased]
### Changed
- Updated dockerhub readme in CI pipeline
- [#7](https://github.com/devatherock/java-to-native/issues/7): Merged contents of `DOCS.md` into `README.md`

## [1.0.0] - 2022-05-17
### Changed
Expand Down
44 changes: 0 additions & 44 deletions DOCS.md

This file was deleted.

52 changes: 48 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@
[![Docker Image Size](https://img.shields.io/docker/image-size/devatherock/java-to-native.svg?sort=date)](https://hub.docker.com/r/devatherock/java-to-native/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
# java-to-native
CI plugin to convert a java program into a [graalvm native image](https://www.graalvm.org/docs/reference-manual/native-image/).
For a listing of available options and usage samples, please take a look at the [docs](DOCS.md).
CI plugin to convert a java program into a [graalvm native image](https://www.graalvm.org/docs/reference-manual/native-image/).

## Plugin config
The following parameters can be set to configure the plugin.

* **debug** - Flag to enable debug logs. Optional, by default, debug logs are disabled
* **jar_name** - Executable jar file to convert into native binary
* **config_file** - Path to a yaml configuration file
* **classpath** - Path containing class files and jars to use as class path. Defaults to `build/libs/*:build/classes`
* **reflection_path** - Path to the reflection configuration if it already exists. If not specified, it will be generated at `build/native/graal-config/`

## Usage
### Docker

Execute from the working directory:

Expand All @@ -17,10 +26,45 @@ docker run --rm \
-w=/work \
-e PLUGIN_JAR_NAME=/work/build/native/libs/YamlValidator.jar \
-e PLUGIN_CONFIG_FILE=/work/config/graal.yml \
devatherock/java-to-native:0.1.3
devatherock/java-to-native:1.0.0
```

### Circle CI

```yaml
java_to_native:
docker:
- image: devatherock/java-to-native:1.0.0
working_directory: ~/drone-yaml-validator
environment:
PLUGIN_JAR_NAME: build/native/libs/YamlValidator.jar
PLUGIN_CONFIG_FILE: config/graal.yml
steps:
- checkout
- attach_workspace:
at: ~/drone-yaml-validator
- run: sh /scripts/entry-point.sh
- persist_to_workspace:
root: ~/drone-yaml-validator
paths:
- YamlValidator
```

### vela

```yaml
steps:
- name: java_to_native
ruleset:
branch: master
event: push
image: devatherock/java-to-native:1.0.0
parameters:
jar_name: build/native/libs/YamlValidator.jar
config_file: config/graal.yml
```

## Configuration
## native-image config
A YAML configuration file can be provided to supply additional arguments to the `native-image` command and to specify
a list of arguments with which to run the main class or the jar to generate reflection config

Expand Down