65 lines
1.4 KiB
Groovy
65 lines
1.4 KiB
Groovy
plugins {
|
|
id 'java'
|
|
}
|
|
|
|
group = 'ru.erius'
|
|
version = '1.0'
|
|
def serverPath = 'C:/mc_servers/1.17.1/plugins'
|
|
def EriusLibPath = 'D:/mc_plugins/EriusLib/build/libs'
|
|
def devPath = 'D:/spigot_dev'
|
|
def spigotJar = 'spigot-1.17.1'
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
flatDir {
|
|
dirs devPath
|
|
}
|
|
maven {
|
|
name = 'papermc-repo'
|
|
url = 'https://papermc.io/repo/repository/maven-public/'
|
|
}
|
|
maven {
|
|
name = 'sonatype'
|
|
url = 'https://oss.sonatype.org/content/groups/public/'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly 'io.papermc.paper:paper-api:1.17.1-R0.1-SNAPSHOT'
|
|
compileOnly name: spigotJar
|
|
compileOnly fileTree(dir: EriusLibPath, include: '*.jar')
|
|
}
|
|
|
|
def targetJavaVersion = 16
|
|
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
|
|
}
|
|
}
|
|
|
|
processResources {
|
|
def props = [version: version]
|
|
inputs.properties props
|
|
filteringCharset 'UTF-8'
|
|
filesMatching('plugin.yml') {
|
|
expand props
|
|
}
|
|
}
|
|
|
|
build {
|
|
doLast {
|
|
copy {
|
|
from libsDirectory
|
|
into serverPath
|
|
}
|
|
}
|
|
}
|