diff --git a/VelocityCore/DiscordDependency/build.gradle.kts b/VelocityCore/Dependencies/build.gradle.kts similarity index 83% rename from VelocityCore/DiscordDependency/build.gradle.kts rename to VelocityCore/Dependencies/build.gradle.kts index dbe2ac56..d71a6c10 100644 --- a/VelocityCore/DiscordDependency/build.gradle.kts +++ b/VelocityCore/Dependencies/build.gradle.kts @@ -22,6 +22,10 @@ plugins { alias(libs.plugins.shadow) } +tasks.build { + finalizedBy(tasks.shadowJar) +} + java { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 @@ -34,4 +38,12 @@ dependencies { implementation(libs.jda) { exclude(module = "opus-java") } + + implementation(libs.sqlite) + implementation(libs.mysql) + + implementation(libs.msgpack) + implementation(libs.apolloprotos) + + implementation(libs.nbt) } \ No newline at end of file diff --git a/VelocityCore/DiscordDependency/src/de/steamwar/discord/Discord.java b/VelocityCore/Dependencies/src/de/steamwar/discord/Dependencies.java similarity index 88% rename from VelocityCore/DiscordDependency/src/de/steamwar/discord/Discord.java rename to VelocityCore/Dependencies/src/de/steamwar/discord/Dependencies.java index e4548697..f3b2a243 100644 --- a/VelocityCore/DiscordDependency/src/de/steamwar/discord/Discord.java +++ b/VelocityCore/Dependencies/src/de/steamwar/discord/Dependencies.java @@ -22,8 +22,8 @@ package de.steamwar.discord; import com.velocitypowered.api.plugin.Plugin; @Plugin( - id = "discordvelocitycore", - name = "DiscordVelocityCore" + id = "depencendiesvelocitycore", + name = "DepencendiesVelocityCore" ) -public class Discord { +public class Dependencies { } diff --git a/VelocityCore/build.gradle.kts b/VelocityCore/build.gradle.kts index 5074c280..91121ea3 100644 --- a/VelocityCore/build.gradle.kts +++ b/VelocityCore/build.gradle.kts @@ -51,18 +51,10 @@ dependencies { compileOnly(libs.viavelocity) compileOnly(project(":VelocityCore:Persistent", "default")) - compileOnly(project(":VelocityCore:DiscordDependency", "default")) + compileOnly(project(":VelocityCore:Dependencies", "default")) implementation(project(":CommonCore")) implementation(project(":CommandFramework")) - - implementation(libs.sqlite) - implementation(libs.mysql) - - implementation(libs.msgpack) - implementation(libs.apolloprotos) - - implementation(libs.nbt) } tasks.register("DevVelocity") { @@ -70,6 +62,6 @@ tasks.register("DevVelocity") { description = "Run a Dev Velocity" dependsOn(":VelocityCore:shadowJar") dependsOn(":VelocityCore:Persistent:jar") - dependsOn(":VelocityCore:DiscordDependency:jar") + dependsOn(":VelocityCore:Dependencies:shadowJar") template = "DevVelocity" } diff --git a/VelocityCore/src/de/steamwar/velocitycore/VelocityCore.java b/VelocityCore/src/de/steamwar/velocitycore/VelocityCore.java index 22b64f64..aa98a034 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/VelocityCore.java +++ b/VelocityCore/src/de/steamwar/velocitycore/VelocityCore.java @@ -60,7 +60,7 @@ import java.util.logging.Logger; @Plugin( id = "velocitycore", name = "VelocityCore", - dependencies = { @Dependency(id = "persistentvelocitycore"), @Dependency(id = "discordvelocitycore") } + dependencies = { @Dependency(id = "persistentvelocitycore"), @Dependency(id = "depencendiesvelocitycore") } ) public class VelocityCore implements ReloadablePlugin { diff --git a/buildSrc/src/steamwar.devserver.gradle b/buildSrc/src/steamwar.devserver.gradle index 53f8be3d..5d75c087 100644 --- a/buildSrc/src/steamwar.devserver.gradle +++ b/buildSrc/src/steamwar.devserver.gradle @@ -46,6 +46,19 @@ class DevServer extends DefaultTask { DevServer() { super() + List upToDateTasks = [] + project.gradle.taskGraph.addTaskExecutionListener(new TaskExecutionListener() { + @Override + void beforeExecute(Task task) { + } + + @Override + void afterExecute(Task task, TaskState state) { + if (state.upToDate) { + upToDateTasks.add(task); + } + } + }) doFirst { List projects = [] projects.add(project) @@ -70,7 +83,7 @@ class DevServer extends DefaultTask { } doLast { checkHasTemplate() - uploadDependencies() + uploadDependencies(upToDateTasks) startDevServer() } finalizedBy(new Finalizer()) @@ -107,7 +120,7 @@ class DevServer extends DefaultTask { } } - void uploadDependencies() { + void uploadDependencies(List upToDateTasks) { def base = plugins == null ? "$template/plugins" : plugins println("Uploading to ~/$base") this.dependsOn.forEach { @@ -119,8 +132,12 @@ class DevServer extends DefaultTask { } else { throw new GradleException("Illegal argument for uploading dependencies") } - def archive = archiveTask.archiveFile.get().asFile + if (upToDateTasks.contains(archiveTask)) { + println("Skipping $archive") + return + } + println("Uploading $archive") new ProcessBuilder("ssh", host, "-T", "rm $base/${archive.name.replace("-all", "")}").start().waitFor() new ProcessBuilder("scp", archive.absolutePath, "$host:~/$base/${archive.name.replace("-all", "")}").start().waitFor() diff --git a/settings.gradle.kts b/settings.gradle.kts index cb175882..8ab618ff 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -247,7 +247,7 @@ include("TutorialSystem") include( "VelocityCore", - "VelocityCore:DiscordDependency", + "VelocityCore:Dependencies", "VelocityCore:Persistent" )