mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-22 02:25:49 +01:00
chore: improve dev tasks
This commit is contained in:
parent
852221533f
commit
00ab7e4fec
34
build.gradle
34
build.gradle
@ -186,6 +186,36 @@ task discordupload {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// This is used to download my plugin for helping reload the server in tandem with the copyPlugin task
|
||||
tasks.register('downloadSekCDevToolsPlugin') {
|
||||
doLast {
|
||||
// Define the URL and destination path
|
||||
def url = 'https://github.com/sekwah41/SekCDevToolsPlugin/releases/download/v1.0.0/SekCDevToolsPlugin-1.0-SNAPSHOT.jar'
|
||||
def destinationDir = new File("$buildDir/MinecraftServer/plugins")
|
||||
def destinationFile = new File(destinationDir, 'SekCDevToolsPlugin-1.0-SNAPSHOT.jar')
|
||||
|
||||
// Create the directory if it doesn't exist
|
||||
if (!destinationDir.exists()) {
|
||||
destinationDir.mkdirs()
|
||||
}
|
||||
|
||||
// Download the file if it doesn't exist
|
||||
if (!destinationFile.exists()) {
|
||||
println "Downloading SekCDevToolsPlugin..."
|
||||
new URL(url).withInputStream { i ->
|
||||
destinationFile.withOutputStream {
|
||||
it << i
|
||||
}
|
||||
}
|
||||
} else {
|
||||
println "SekCDevToolsPlugin already downloaded"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.launchMinecraftServer.dependsOn(downloadSekCDevToolsPlugin)
|
||||
|
||||
minecraftServerConfig {
|
||||
jarUrl.set('https://download.getbukkit.org/spigot/spigot-1.20.2.jar')
|
||||
jvmArgument = ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005", "-DIReallyKnowWhatIAmDoingISwear=true"]
|
||||
@ -195,7 +225,11 @@ tasks.withType(Jar) {
|
||||
duplicatesStrategy = DuplicatesStrategy.WARN
|
||||
}
|
||||
|
||||
/**
|
||||
* Will build then copy it to the minecraft server folder for use with the launch task and dev tools plugin
|
||||
*/
|
||||
task copyPlugin() {
|
||||
dependsOn(build)
|
||||
doLast {
|
||||
copy {
|
||||
println "$buildDir/libs/Advanced-Portals-${getVersion()}.jar"
|
||||
|
Loading…
Reference in New Issue
Block a user