https://github.com/heretere/hdl
Heretere's Dependency Loader
https://github.com/heretere/hdl
bukkit java spigot
Last synced: 8 months ago
JSON representation
Heretere's Dependency Loader
- Host: GitHub
- URL: https://github.com/heretere/hdl
- Owner: heretere
- License: mit
- Created: 2021-01-09T13:39:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-10-28T11:55:39.000Z (over 4 years ago)
- Last Synced: 2025-01-31T17:52:52.072Z (over 1 year ago)
- Topics: bukkit, java, spigot
- Language: Java
- Homepage:
- Size: 631 KB
- Stars: 8
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Heretere's Dependency Loader
### Description
Heretere's Dependency Loader is a runtime maven dependency handler. It has powered using a Gradle plugin to make solving transitive dependencies simple.
### Why?
Certain websites have capped jar sizes, this library allows you to supply a much smaller jar size without sacrificing
the amount of libraries you use in your project.
### Documentation
- [Wiki](https://github.com/heretere/hdl/wiki)
---
# Features
- Automatically downloads, and loads maven dependencies at runtime
- Easily create your own runtime dependency types on top of Maven
- Downloads are cached to your plugin's data folder or to a different specified directory
- Relocation isn't required since files are loaded into an isolated classloader
#### Currently, Supported Dependency Types
- All Maven repos
---
# Examples
## Gradle Plugin
```kotlin
plugins {
id("com.heretere.hdl.plugin") version "2.0.0"
}
dependencies {
// instead of implementation("com.google.guava:guava:31.0-jre")
hdl("com.google.guava:guava:31.0-jre")
}
```
The plugin will automatically include the core dependency so you can invoke it at runtime.
## Main Class
```java
import com.heretere.hdl.impl.DependencyLoader;
public class Main {
public static void main(String[] args) {
DependencyLoader loader = new DependencyLoader(/*Define a dependency directory path here*/);
boolean success = loader.loadDependencies();
if (!success) {
throw new RuntimeException("Failed to load dependencies")
//dependencies successfully loaded
}
}
}
```
---
# Usage
Usage without Gradle plugin
Maven
```xml
com.heretere.hdl
core
Version
```
```xml
com.heretere.hdl
bukkit
Version
```
Gradle
```groovy
repositories {
mavenCentral()
}
```
```groovy
//Just the Core
dependencies {
implementation 'com.heretere.hdl:core:Version'
}
```
```groovy
//Spigot Version
dependencies {
implementation 'com.heretere.hdl:bukkit:Version'
}
```