-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
714 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,62 @@ | ||
# panda_lib | ||
A Common Libary plugin used by my plugins | ||
# PandaLib | ||
|
||
- [About](#about) | ||
- [Included Libraries](#packaged-libraries) | ||
- [How to use](#using-the-library) | ||
|
||
--- | ||
|
||
# About | ||
[^ back to top](#pandalib) | ||
|
||
A Common Library plugin containing common libraries and functions for my plugins. | ||
|
||
This is mainly used to help keep plugin sizes down and allow for easy cross compatibility | ||
|
||
# Packaged Libraries | ||
[^ back to top](#pandalib) | ||
|
||
These are the induced libraries and their versions. | ||
|
||
- [Kotlin](https://kotlinlang.org/) ![Version](https://img.shields.io/badge/V-1.9.0-green.svg) | ||
- [Cloud](https://github.com/Incendo/cloud/tree/master/docs) ![Version](https://img.shields.io/badge/V-1.7.1-green.svg) | ||
- cloud-core | ||
- cloud-kotlin-extensions | ||
- cloud-paper | ||
- cloud-minecraft-extras | ||
- [Kyori Adventure](https://docs.advntr.dev/index.html) ![Version](https://img.shields.io/badge/V-4.14.0-green.svg) | ||
- adventure-api | ||
- adventure-text-serializer-plain | ||
- adventure-text-minimessage | ||
- adventure-text-feature-pagination ![Version](https://img.shields.io/badge/V-4.0.0%20SNAPSHOT-yellow.svg) | ||
|
||
# Using the library | ||
[^ back to top](#pandalib) | ||
|
||
To proven clashes with other plugins all the packaged libraries have been relocated to `com.kruthers.lib` | ||
|
||
To use on gradle it requires use of [Shadow](https://imperceptiblethoughts.com/shadow/) | ||
|
||
### Gradle (Groovy) | ||
```groovy | ||
dependencies { | ||
compileonly "<library here from its sources>" | ||
} | ||
//todo | ||
``` | ||
|
||
### Gradle (Kotlin DSL) | ||
```groovy | ||
dependencies { | ||
compileonly("<library here from its sources>") | ||
} | ||
tasks { | ||
shadowJar { | ||
relocate("net.kyori","com.kruthers.lib.net.kyori") | ||
relocate("cloud","com.kruthers.lib.cloud") | ||
relocate("kotlin","com.kruthers.lib.kotlin") | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
plugins { | ||
kotlin("jvm") version "1.9.0" | ||
id("com.github.johnrengelman.shadow") version "8.1.1" | ||
} | ||
|
||
group = project.properties["maven_group"].toString() | ||
version = project.properties["plugin_version"].toString() | ||
|
||
repositories { | ||
mavenCentral() | ||
repositories { | ||
maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots/") { | ||
name = "sonatype-oss-snapshots" | ||
} | ||
} | ||
|
||
maven("https://repo.papermc.io/repository/maven-public/") | ||
} | ||
|
||
dependencies { | ||
implementation(kotlin("stdlib")) | ||
|
||
//paper | ||
val paperVersion = "${project.properties["minecraft_version"]}-${project.properties["paper_version"]}" | ||
compileOnly("io.papermc.paper","paper-api", paperVersion) | ||
|
||
|
||
//cloud | ||
val cloudVersion = project.properties["cloud_version"].toString() | ||
implementation("cloud.commandframework","cloud-core",cloudVersion) | ||
implementation("cloud.commandframework","cloud-kotlin-extensions",cloudVersion) | ||
implementation("cloud.commandframework","cloud-paper",cloudVersion) | ||
implementation("cloud.commandframework","cloud-minecraft-extras",cloudVersion) | ||
|
||
//kyori | ||
val adventureVersion = project.properties["adventure_version"].toString() | ||
implementation("net.kyori","adventure-api",adventureVersion) | ||
implementation("net.kyori","adventure-text-serializer-plain",adventureVersion) | ||
implementation("net.kyori","adventure-text-minimessage",adventureVersion) | ||
|
||
implementation("net.kyori","adventure-text-feature-pagination","4.0.0-SNAPSHOT") | ||
|
||
} | ||
|
||
tasks { | ||
shadowJar { | ||
archiveClassifier = "" | ||
|
||
relocate("net.kyori","com.kruthers.lib.net.kyori") | ||
relocate("cloud","com.kruthers.lib.cloud") | ||
relocate("kotlin","com.kruthers.lib.kotlin") | ||
} | ||
build { | ||
dependsOn(shadowJar) | ||
dependsOn(processResources) | ||
} | ||
processResources { | ||
expand( | ||
"plugin_name" to project.name, | ||
"plugin_version" to project.version, | ||
"maven_group" to project.group, | ||
"kotlin_version" to kotlin.coreLibrariesVersion, | ||
"minecraft_version" to project.properties["minecraft_version"].toString(), | ||
"paper_version" to project.properties["paper_version"].toString(), | ||
"cloud_version" to project.properties["cloud_version"].toString(), | ||
"adventure_version" to project.properties["adventure_version"].toString(), | ||
) | ||
} | ||
} | ||
|
||
|
||
kotlin { | ||
jvmToolchain(17) | ||
} | ||
|
||
java { | ||
toolchain.languageVersion.set(JavaLanguageVersion.of(17)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
kotlin.code.style=official | ||
|
||
# Plugin Properties | ||
plugin_version=1.0.0 | ||
maven_group=com.kruthers | ||
|
||
#Minectraft verions | ||
minecraft_version=1.20.1 | ||
paper_version=R0.1-SNAPSHOT | ||
|
||
#APi Versions | ||
cloud_version=1.7.1 | ||
adventure_version=4.14.0 | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.