mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 06:28:54 +00:00
It works kinda
This commit is contained in:
1 parent
ace3a496ef
commit
ecb80cef34
23 files changed
+407
-264
No files matched your search
@@ -0,0 +1,70 @@
|
||||
import net.draycia.carbon.CLOUD_VER
|
||||
import java.util.Locale
|
||||
import org.spongepowered.plugin.metadata.PluginDependency
|
||||
import org.spongepowered.gradle.plugin.config.PluginLoaders
|
||||
|
||||
plugins {
|
||||
id("com.github.johnrengelman.shadow")
|
||||
id("org.spongepowered.gradle.plugin") version "1.0.3"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(projects.carbonchatApi)
|
||||
implementation("cloud.commandframework:cloud-sponge:$CLOUD_VER")
|
||||
}
|
||||
|
||||
tasks {
|
||||
runServer {
|
||||
classpath(shadowJar)
|
||||
}
|
||||
build {
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
shadowJar {
|
||||
minimize()
|
||||
archiveFileName.set(project.name + "-" + project.version + ".jar")
|
||||
doLast {
|
||||
val archive = archiveFile.get().asFile
|
||||
val libs = rootProject.buildDir.resolve("libs")
|
||||
libs.mkdirs()
|
||||
archive.copyTo(libs.resolve(archive.name), overwrite = true)
|
||||
}
|
||||
relocate("org.yaml", "net.draycia.carbon.libs.org.yaml")
|
||||
relocate("org.spongepowered.configurate", "net.draycia.carbon.libs.configurate")
|
||||
relocate("org.checkerframework", "net.draycia.carbon.libs.checkerframework")
|
||||
relocate("org.reactivestreams", "net.draycia.carbon.libs.reactivestreams")
|
||||
relocate("org.codehaus", "net.draycia.carbon.libs.codehaus")
|
||||
relocate("io.leangen.geantyref", "net.draycia.carbon.libs.typereference")
|
||||
relocate("io.lettuce", "net.draycia.carbon.libs.lettuce")
|
||||
relocate("co.aikar.idb", "net.draycia.carbon.libs.idb")
|
||||
relocate("cloud.commandframework", "net.draycia.carbon.libs.cloud")
|
||||
relocate("com.zaxxer.hikari", "net.draycia.carbon.libs.hikari")
|
||||
relocate("com.typesafe.config", "net.draycia.carbon.libs.typesafe.config")
|
||||
relocate("com.google.common", "net.draycia.carbon.libs.google.common")
|
||||
relocate("reactor", "net.draycia.carbon.libs.reactor")
|
||||
relocate("javax.annotation", "net.draycia.carbon.libs.javax.annotation")
|
||||
}
|
||||
}
|
||||
|
||||
sponge {
|
||||
apiVersion("8.0.0")
|
||||
plugin(rootProject.name.toLowerCase(Locale.ROOT)) {
|
||||
loader(PluginLoaders.JAVA_PLAIN)
|
||||
displayName(rootProject.name)
|
||||
mainClass("net.draycia.carbon.sponge.CarbonChatSponge")
|
||||
description(project.description)
|
||||
links {
|
||||
val url = rootProject.ext["github"] as String
|
||||
homepage(url)
|
||||
source(url)
|
||||
issues("$url/issues")
|
||||
}
|
||||
contributor("Vicarious") {
|
||||
description("Lead Developer")
|
||||
}
|
||||
dependency("spongeapi") {
|
||||
loadOrder(PluginDependency.LoadOrder.AFTER)
|
||||
optional(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-bin.zip
|
||||
@@ -0,0 +1,28 @@
|
||||
package net.draycia.carbon.sponge;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import net.draycia.carbon.api.CarbonChat;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.spongepowered.plugin.PluginContainer;
|
||||
import org.spongepowered.plugin.jvm.Plugin;
|
||||
|
||||
@Plugin("carbonchat")
|
||||
public class CarbonChatSponge implements CarbonChat {
|
||||
private final PluginContainer pluginContainer;
|
||||
private final Logger logger;
|
||||
|
||||
@Inject
|
||||
public CarbonChatSponge(
|
||||
final @NonNull PluginContainer pluginContainer,
|
||||
final @NonNull Logger logger
|
||||
) {
|
||||
this.pluginContainer = pluginContainer;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull Logger logger() {
|
||||
return this.logger;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user