update dependencies and repositories
This commit is contained in:
parent
c44be4ebd7
commit
bad541cc65
|
|
@ -1,53 +1,66 @@
|
||||||
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
java
|
java
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
id("com.github.johnrengelman.shadow") version "7.0.0"
|
id("com.github.johnrengelman.shadow") version "7.1.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
group = "com.alttd.proxydiscordlink"
|
||||||
val build = System.getenv("BUILD_NUMBER") ?: "SNAPSHOT"
|
version = "1.0.0-BETA-SNAPSHOT"
|
||||||
group = "com.alttd.proxydiscordlink"
|
description = "A velocity plugin to link Discord and Minecraft accounts."
|
||||||
version = "1.0.0-BETA-$build"
|
|
||||||
description = "A velocity plugin to link Discord and Minecraft accounts."
|
|
||||||
|
|
||||||
apply(plugin = "java")
|
|
||||||
apply(plugin = "maven-publish")
|
|
||||||
|
|
||||||
java {
|
java {
|
||||||
toolchain {
|
toolchain {
|
||||||
languageVersion.set(JavaLanguageVersion.of(16))
|
languageVersion.set(JavaLanguageVersion.of(17))
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks {
|
|
||||||
withType<JavaCompile> {
|
|
||||||
options.encoding = Charsets.UTF_8.name()
|
|
||||||
options.release.set(16)
|
|
||||||
}
|
|
||||||
|
|
||||||
withType<Javadoc> {
|
|
||||||
options.encoding = Charsets.UTF_8.name()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks {
|
||||||
|
withType<JavaCompile> {
|
||||||
|
options.encoding = Charsets.UTF_8.name()
|
||||||
|
options.release.set(17)
|
||||||
|
}
|
||||||
|
|
||||||
|
withType<Javadoc> {
|
||||||
|
options.encoding = Charsets.UTF_8.name()
|
||||||
|
}
|
||||||
|
|
||||||
|
shadowJar {
|
||||||
|
dependsOn(getByName("relocateJars") as ConfigureShadowRelocation)
|
||||||
|
archiveFileName.set("${project.name}-${project.version}.jar")
|
||||||
|
minimize()
|
||||||
|
configurations = listOf(project.configurations.shadow.get())
|
||||||
|
}
|
||||||
|
|
||||||
|
build {
|
||||||
|
dependsOn(shadowJar)
|
||||||
|
}
|
||||||
|
|
||||||
|
create<ConfigureShadowRelocation>("relocateJars") {
|
||||||
|
target = shadowJar.get()
|
||||||
|
prefix = "${project.name}.lib"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// Minimessage
|
// Minimessage // TODO : update all usages to 4.2
|
||||||
implementation("net.kyori:adventure-text-minimessage:4.1.0-SNAPSHOT") {
|
shadow("net.kyori:adventure-text-minimessage:4.2.0-SNAPSHOT") {
|
||||||
exclude("net.kyori")
|
exclude("net.kyori", "adventure-api")
|
||||||
exclude("net.kyori.examination")
|
|
||||||
}
|
}
|
||||||
// Velocity
|
// Velocity
|
||||||
compileOnly("com.velocitypowered:velocity-api:1.1.5")
|
compileOnly("com.velocitypowered:velocity-api:3.0.1")
|
||||||
annotationProcessor("com.velocitypowered:velocity-api:1.1.5")
|
annotationProcessor("com.velocitypowered:velocity-api:3.0.1")
|
||||||
// JDA
|
// JDA
|
||||||
implementation("net.dv8tion:JDA:4.3.0_283") {
|
shadow("net.dv8tion:JDA:5.0.0-alpha.3") {
|
||||||
exclude("opus-java") // exclude audio
|
exclude("opus-java") // exclude audio
|
||||||
}
|
}
|
||||||
// LuckPerms
|
// LuckPerms
|
||||||
compileOnly("net.luckperms:api:5.3")
|
compileOnly("net.luckperms:api:5.3")
|
||||||
// MySQL
|
// MySQL
|
||||||
runtimeOnly("mysql:mysql-connector-java:8.0.23")
|
shadow("mysql:mysql-connector-java:8.0.25")
|
||||||
// ShutdownInfo
|
// ShutdownInfo
|
||||||
compileOnly("com.alttd:ShutdownInfo:1.0")
|
compileOnly("com.alttd:ShutdownInfo:1.0")
|
||||||
}
|
}
|
||||||
|
|
@ -62,28 +75,8 @@ publishing {
|
||||||
repositories{
|
repositories{
|
||||||
maven {
|
maven {
|
||||||
name = "maven"
|
name = "maven"
|
||||||
url = uri("http://leo:8081/")
|
url = uri("https://repo.destro.xyz/snapshots")
|
||||||
isAllowInsecureProtocol = true
|
|
||||||
credentials(PasswordCredentials::class)
|
credentials(PasswordCredentials::class)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
|
||||||
|
|
||||||
shadowJar {
|
|
||||||
archiveFileName.set("${project.name}-${project.version}.jar")
|
|
||||||
// exclude("net.kyori")
|
|
||||||
// exclude("net.kyori.examination")
|
|
||||||
listOf(
|
|
||||||
// "net.kyori",
|
|
||||||
"net.dv8tion.jda",
|
|
||||||
"net.kyori.adventure.text.minimessage"
|
|
||||||
).forEach { relocate(it, "${rootProject.group}.lib.$it") }
|
|
||||||
}
|
|
||||||
|
|
||||||
build {
|
|
||||||
dependsOn(shadowJar)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -6,9 +6,8 @@ dependencyResolutionManagement {
|
||||||
// Altitude
|
// Altitude
|
||||||
maven {
|
maven {
|
||||||
name = "maven"
|
name = "maven"
|
||||||
url = uri("http://leo:8081/")
|
url = uri("https://repo.destro.xyz/snapshots")
|
||||||
isAllowInsecureProtocol = true
|
credentials(PasswordCredentials::class)
|
||||||
//credentials(PasswordCredentials::class)
|
|
||||||
}
|
}
|
||||||
// Velocity
|
// Velocity
|
||||||
maven("https://nexus.velocitypowered.com/repository/maven-public/")
|
maven("https://nexus.velocitypowered.com/repository/maven-public/")
|
||||||
|
|
@ -16,8 +15,6 @@ dependencyResolutionManagement {
|
||||||
maven("https://m2.dv8tion.net/releases/")
|
maven("https://m2.dv8tion.net/releases/")
|
||||||
// MiniMessage
|
// MiniMessage
|
||||||
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||||
// Local maven repo .m2
|
|
||||||
mavenLocal()
|
|
||||||
}
|
}
|
||||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,9 +87,9 @@ public class Bot {
|
||||||
if (embedBuilder.isEmpty()) return;
|
if (embedBuilder.isEmpty()) return;
|
||||||
try {
|
try {
|
||||||
if (secondsTillDelete < 0) {
|
if (secondsTillDelete < 0) {
|
||||||
channel.sendMessage(embedBuilder.build()).queue();
|
channel.sendMessageEmbeds(embedBuilder.build()).queue();
|
||||||
} else {
|
} else {
|
||||||
channel.sendMessage(embedBuilder.build()).queue(message -> message.delete().queueAfter(secondsTillDelete, TimeUnit.SECONDS));
|
channel.sendMessageEmbeds(embedBuilder.build()).queue(message -> message.delete().queueAfter(secondsTillDelete, TimeUnit.SECONDS));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ALogger.error("caught some exception, " + e);
|
ALogger.error("caught some exception, " + e);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import com.alttd.proxydiscordlink.DiscordLink;
|
||||||
import com.alttd.proxydiscordlink.bot.Bot;
|
import com.alttd.proxydiscordlink.bot.Bot;
|
||||||
import com.alttd.proxydiscordlink.bot.DiscordCommand;
|
import com.alttd.proxydiscordlink.bot.DiscordCommand;
|
||||||
import com.alttd.proxydiscordlink.config.BotConfig;
|
import com.alttd.proxydiscordlink.config.BotConfig;
|
||||||
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent;
|
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
@ -21,7 +21,7 @@ public class DiscordMessageListener extends ListenerAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGuildMessageReceived(GuildMessageReceivedEvent event) {
|
public void onMessageReceived(MessageReceivedEvent event) {
|
||||||
if (event.getAuthor() == event.getJDA().getSelfUser()) {
|
if (event.getAuthor() == event.getJDA().getSelfUser()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user