61 lines
1.5 KiB
Groovy
61 lines
1.5 KiB
Groovy
plugins {
|
|
id 'com.github.johnrengelman.shadow' version '8.1.1'
|
|
id 'java'
|
|
}
|
|
|
|
group = 'eu.mhsl.craftattack'
|
|
version = '1.0'
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven {
|
|
name = "papermc-repo"
|
|
url = "https://repo.papermc.io/repository/maven-public/"
|
|
}
|
|
maven {
|
|
name = "sonatype"
|
|
url = "https://oss.sonatype.org/content/groups/public/"
|
|
}
|
|
maven {
|
|
url = uri("https://repo.opencollab.dev/main/")
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly 'io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT'
|
|
compileOnly 'org.geysermc.floodgate:api:2.2.2-SNAPSHOT'
|
|
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
|
|
implementation 'com.sparkjava:spark-core:2.9.4'
|
|
}
|
|
|
|
def targetJavaVersion = 17
|
|
java {
|
|
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
|
|
sourceCompatibility = javaVersion
|
|
targetCompatibility = javaVersion
|
|
if (JavaVersion.current() < javaVersion) {
|
|
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
|
|
}
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
|
|
options.release = targetJavaVersion
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
shadowImplementation.extendsFrom implementation
|
|
}
|
|
|
|
shadowJar {
|
|
configurations = [project.configurations.shadowImplementation]
|
|
}
|
|
|
|
tasks.register('copyJarToServer', Exec) {
|
|
dependsOn shadowJar
|
|
mustRunAfter shadowJar
|
|
|
|
commandLine 'scp', 'build/libs/spawn-1.0-all.jar', 'root@10.20.6.1:/home/minecraft/server/plugins'
|
|
}
|