Skip to content

Commit

Permalink
feat: use gradle plugin "su.plo.voice.plugin" to generate entrypoints…
Browse files Browse the repository at this point in the history
… for all supported platforms
  • Loading branch information
Apehum committed Mar 24, 2023
1 parent dc7889d commit 6a6604e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 48 deletions.
35 changes: 6 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ Addon library bundled with [LavaPlayer fork](https://github.com/Walkyst/lavaplay

1. Download the add-on from [Modrinth](https://modrinth.com/mod/pv-addon-lavaplayer-lib)
2. Install the add-on:
- If you need the library for a Paper add-on, install it as a Paper plugin in the `~/plugins` directory.
- If you need the library for a universal add-on, install it as a universal PV add-on.
- For Paper, install the library in `~/plugins/PlasmoVoice/addons`.
- For Fabric or Forge, install the library in `~/mods/PlasmoVoice/addons`.
- If you have both universal and Paper add-ons that require the library, you need to install it as both a universal and a Paper add-on.
- For Paper, install the library in `~/plugins`.
- For Fabric or Forge, install the library in `~/mods`.
3. Restart the server

## Adding to the project (For developers)
Expand All @@ -37,7 +34,7 @@ repositories {
}

dependencies {
compileOnly("su.plo:pv-addon-lavaplayer-lib:1.0.1")
compileOnly("su.plo:pv-addon-lavaplayer-lib:1.0.2")
}
```
### Groovy DSL
Expand All @@ -47,37 +44,17 @@ repositories {
}
dependencies {
compileOnly 'su.plo:pv-addon-lavaplayer-lib:1.0.1'
compileOnly 'su.plo:pv-addon-lavaplayer-lib:1.0.2'
}
```
### Maven
```xml
<project>
<repositories>
<repository>
<id>plasmo-repo</id>
<url>https://repo.plo.su</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>su.plo</groupId>
<artifactId>pv-addon-lavaplayer-lib</artifactId>
<version>1.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
```

## Using with universal addons
### Kotlin
```kotlin
@Addon(
...
dependencies = [
Dependency(id = "lavaplayer-lib")
Dependency(id = "pv-addon-lavaplayer-lib")
]
)
```
Expand All @@ -86,7 +63,7 @@ dependencies {
@Addon(
...
dependencies = {
@Dependency(id = "lavaplayer-lib")
@Dependency(id = "pv-addon-lavaplayer-lib")
}
)
```
Expand Down
19 changes: 6 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
plugins {
kotlin("jvm") version("1.6.10")
kotlin("kapt") version ("1.6.10")
id("com.github.johnrengelman.shadow") version("7.0.0")
id("net.minecrell.plugin-yml.bukkit") version "0.5.2" // Generates plugin.yml
id("su.plo.voice.plugin") version("1.0.0")
`maven-publish`
}

group = "su.plo"
version = "1.0.1"
version = "1.0.2"

repositories {
mavenCentral()
Expand All @@ -19,15 +18,17 @@ repositories {
}

dependencies {
compileOnly(kotlin("stdlib-jdk8"))

compileOnly("com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT")

compileOnly("su.plo.voice.api:server:2.0.0+ALPHA")
compileOnly("su.plo.voice.api:proxy:2.0.0+ALPHA")

implementation("com.github.walkyst:lavaplayer-fork:1.4.0")
shadow("com.github.walkyst:lavaplayer-fork:1.4.0") {
exclude("org.slf4j")
}

kapt("su.plo.voice.api:server:2.0.0+ALPHA")
}

tasks {
Expand Down Expand Up @@ -77,11 +78,3 @@ configure<PublishingExtension> {
}
}
}

bukkit {
load = net.minecrell.pluginyml.bukkit.BukkitPluginDescription.PluginLoadOrder.STARTUP
main = "su.plo.voice.lavaplayer.BukkitEntryPoint"
apiVersion = "1.16"
authors = listOf("Apehum")
depend = listOf("PlasmoVoice")
}
12 changes: 11 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
rootProject.name = "pv-addon-lavaplayer-lib"
pluginManagement {
repositories {
gradlePluginPortal()
mavenLocal()
mavenCentral()
maven("https://repo.plo.su")
maven("https://jitpack.io/")
maven("https://maven.minecraftforge.net")
}
}

rootProject.name = "pv-addon-lavaplayer-lib"
3 changes: 0 additions & 3 deletions src/main/kotlin/su/plo/voice/lavaplayer/BukkitEntryPoint.kt

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/kotlin/su/plo/voice/lavaplayer/LavaPlayerAddon.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package su.plo.voice.lavaplayer

import su.plo.voice.api.addon.AddonScope
import su.plo.voice.api.addon.AddonLoaderScope
import su.plo.voice.api.addon.annotation.Addon

@Addon(id = "lavaplayer-lib", scope = AddonScope.LIB_SERVER, version = "1.0.1", authors = ["Apehum"])
@Addon(id = "pv-addon-lavaplayer-lib", scope = AddonLoaderScope.ANY_SERVER, version = "1.0.2", authors = ["Apehum"])
class LavaPlayerAddon

0 comments on commit 6a6604e

Please sign in to comment.