https://github.com/sammers21/geralt
💰 Toss a coin... Cargo-like build system for Java
https://github.com/sammers21/geralt
Last synced: 25 days ago
JSON representation
💰 Toss a coin... Cargo-like build system for Java
- Host: GitHub
- URL: https://github.com/sammers21/geralt
- Owner: Sammers21
- License: apache-2.0
- Created: 2024-05-17T10:06:42.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-05-18T22:13:16.000Z (12 months ago)
- Last Synced: 2025-02-12T15:27:34.466Z (3 months ago)
- Language: Rust
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Geralt
Geralt is a simple Cargo-like build system for Java projects.
## Hello World
You can initialize a new Geralt project by running:
```bash
$ geralt init
```This will create a new Geralt project in the current directory. The structure of the project will look like this:
```
src/
com/
example/
Main.java
geralt.toml
```The `Main.java` file will contain the following code:
```java
package com.example;public class Main {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
```and the `geralt.toml` file will contain the following configuration:
```toml
[package]
name = "hello-world"
version = "0.1.0"[dependencies]
```You can build the project by running:
```bash
$ geralt run
```This will compile the project and run the `Main` class.
You can also build the project without running it by running:
```bash
$ geralt build
```This will compile the project and create a `target` directory with `hello-world.jar` fat jar file inside.
In order to add dependencies to your project, you can add them to the `geralt.toml` file under the `[dependencies]` section. For example, to add the `org.apache.commons:commons-lang3:3.12.0` dependency, you can add the following line:
```toml
[dependencies]
"org.apache.commons:commons-lang3" = "3.12.0"
```You can then run `geralt build` to download the dependency and build the project.
## Installation
You can install Geralt by running:
MacOS with [Homebrew](https://brew.sh/):
```bash
brew install geralt
```Linux via [sdkman](https://sdkman.io/):
```bash
sdk install geralt
```