2023-06-11 16:34:18 +00:00
|
|
|
plugins {
|
|
|
|
id 'java'
|
2023-06-12 06:43:28 +00:00
|
|
|
id 'com.github.gmazzo.buildconfig' version '4.0.4'
|
2023-06-11 16:34:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
group = 'me.theclashfruit'
|
2023-06-12 06:43:28 +00:00
|
|
|
version = '1.0.0+1.19.4-alpha'
|
|
|
|
|
|
|
|
static def getBuildTimestamp() {
|
|
|
|
return new Date().time
|
|
|
|
}
|
2023-06-11 16:34:18 +00:00
|
|
|
|
|
|
|
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/"
|
|
|
|
}
|
2023-06-12 06:43:28 +00:00
|
|
|
maven {
|
|
|
|
url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
|
|
|
|
}
|
2023-06-11 16:34:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2023-06-12 06:43:28 +00:00
|
|
|
compileOnly 'io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT'
|
|
|
|
compileOnly 'me.clip:placeholderapi:2.11.3'
|
|
|
|
}
|
|
|
|
|
|
|
|
buildConfig {
|
|
|
|
buildConfigField('String', 'NAME', "\"${project.name}\"")
|
|
|
|
buildConfigField('String', 'VERSION', "\"${project.version}\"")
|
|
|
|
buildConfigField('long', 'BUILD_TIME', "${buildTimestamp}L")
|
2023-06-11 16:34:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
|
|
|
def props = [version: version]
|
|
|
|
inputs.properties props
|
|
|
|
filteringCharset 'UTF-8'
|
|
|
|
|
|
|
|
filesMatching('plugin.yml') {
|
|
|
|
expand props
|
|
|
|
}
|
|
|
|
}
|