Skip to content

Commit

Permalink
Sync build.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphiMC committed Nov 20, 2024
1 parent bc4a86d commit 155ca07
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id "java"
id "java-library"
id "idea"
}

base {
Expand Down Expand Up @@ -71,3 +72,31 @@ jar {
rename { "${it}_${project.name ?: rootProject.name}" }
}
}

idea {
module {
["run"].each {
excludeDirs << file("$it")
}
}
}

tasks.register("runViaProxy", JavaExec) {
dependsOn tasks.jar

mainClass = "net.raphimc.viaproxy.ViaProxy"
classpath = sourceSets.main.compileClasspath
workingDir = file("run")
jvmArgs = ["-DskipUpdateCheck"]

doFirst {
def pluginsDir = file("$workingDir/plugins")
pluginsDir.mkdirs()
file("$pluginsDir/${project.name}.jar").bytes = tasks.jar.archiveFile.get().asFile.bytes
}

doLast {
file("$workingDir/plugins/${project.name}.jar").delete()
file("$workingDir/logs").deleteDir()
}
}

0 comments on commit 155ca07

Please sign in to comment.