Skip to content

Commit

Permalink
Modular support for spigot and velocity.
Browse files Browse the repository at this point in the history
  • Loading branch information
atom7xyz committed Jul 22, 2023
1 parent 7821774 commit f746618
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 46 deletions.
100 changes: 55 additions & 45 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,73 @@ import java.util.Date
import java.text.SimpleDateFormat

plugins {
id("java")
id("com.github.johnrengelman.shadow") version "8.1.1"
id("org.jetbrains.kotlin.jvm") version "1.9.0"
java
kotlin("jvm") version "1.9.0" apply false
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
}

group = "xyz.sorridi.velib"
version = "1.0-SNAPSHOT"

repositories {
mavenCentral()
maven {
name = "jitpack"
url = uri("https://www.jitpack.io")
subprojects {
apply {
plugin("java")
plugin("org.jetbrains.kotlin.jvm")
plugin("com.github.johnrengelman.shadow")
}
maven {
name = "mikigal-repo"
url = uri("https://repo.mikigal.pl/releases")
}
maven {
name = "papermc"
url = uri("https://repo.papermc.io/repository/maven-public/")

repositories {
mavenCentral()
maven {
name = "jitpack"
url = uri("https://www.jitpack.io")
}
maven {
name = "mikigal-repo"
url = uri("https://repo.mikigal.pl/releases")
}
maven {
name = "papermc"
url = uri("https://repo.papermc.io/repository/maven-public/")
}
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://oss.sonatype.org/content/repositories/central")
}
}

dependencies {
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
dependencies {
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")

/* Minecraft related */
implementation("com.velocitypowered:velocity-api:3.1.1")
annotationProcessor("com.velocitypowered:velocity-api:3.1.1")
/* Data structures related */
implementation("com.google.guava:guava:32.1.1-jre")
implementation("commons-codec:commons-codec:1.16.0")
implementation("org.apache.commons:commons-collections4:4.4")
implementation("org.apache.commons:commons-math3:3.6.1")
implementation("com.github.ben-manes.caffeine:caffeine:3.1.6")

/* Data structures related */
implementation("com.google.guava:guava:32.1.1-jre")
implementation("commons-codec:commons-codec:1.16.0")
implementation("org.apache.commons:commons-collections4:4.4")
implementation("org.apache.commons:commons-math3:3.6.1")
implementation("com.github.ben-manes.caffeine:caffeine:3.1.6")
/* DB related */
implementation("com.rabbitmq:amqp-client:5.18.0")
implementation("com.zaxxer:HikariCP:5.0.1")
implementation("org.jooq:jooq:3.18.5")

/* DB related */
implementation("com.rabbitmq:amqp-client:5.18.0")
implementation("com.zaxxer:HikariCP:5.0.1")
implementation("org.jooq:jooq:3.18.5")
/* Config related */
implementation("com.github.Carleslc.Simple-YAML:Simple-Yaml:1.8.4")

/* Config related */
implementation("com.github.Carleslc.Simple-YAML:Simple-Yaml:1.8.4")
}
/* Reflections related */
implementation("org.reflections:reflections:0.10.2")
}

tasks.test {
useJUnitPlatform()
}
tasks.test {
useJUnitPlatform()
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}

tasks.withType<ShadowJar> {
val time = SimpleDateFormat("dd-MM-yyyy_HH-mm").format(Date())
archiveFileName.set("${project.name}-${time}.jar")
}
tasks.withType<ShadowJar> {
val time = SimpleDateFormat("dd-MM-yyyy_HH-mm").format(Date())
archiveFileName.set("${project.name}-${time}.jar")
}
}
9 changes: 8 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
rootProject.name = "VeLib"
pluginManagement {
repositories {
mavenCentral()
maven("https://plugins.gradle.org/m2/")
}
}

rootProject.name = "VeLib"
include("velib-spigot", "velib-velocity")
7 changes: 7 additions & 0 deletions velib-spigot/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dependencies {
/* Spigot related */
compileOnly("org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT")

// https://mvnrepository.com/artifact/com.mojang/authlib
implementation("com.mojang:authlib:1.5.25")
}
18 changes: 18 additions & 0 deletions velib-spigot/src/main/java/xyz/sorridi/velib/VeLib.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package xyz.sorridi.velib;

import org.bukkit.plugin.java.JavaPlugin;

public class VeLib extends JavaPlugin
{
@Override
public void onEnable()
{

}

@Override
public void onDisable()
{

}
}
6 changes: 6 additions & 0 deletions velib-spigot/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: VeLib
version: 1.0-SNAPSHOT
main: xyz.sorridi.velib.VeLib
authors: [ Sorridi ]
website: https://github.com/Sorridi/VeLib
load: STARTUP
5 changes: 5 additions & 0 deletions velib-velocity/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependencies {
/* Velocity related */
compileOnly("com.velocitypowered:velocity-api:3.1.1")
annotationProcessor("com.velocitypowered:velocity-api:3.1.1")
}
File renamed without changes.

0 comments on commit f746618

Please sign in to comment.