plugins { id 'java' id 'com.github.gmazzo.buildconfig' version '4.0.4' id 'com.github.johnrengelman.shadow' version '7.1.2' } group = 'me.theclashfruit' version = '1.0.0+1.19.4-alpha' static def getBuildTimestamp() { return new Date().time } 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 = 'https://repo.extendedclip.com/content/repositories/placeholderapi/' } maven { url = 'https://repo.codemc.org/repository/maven-public/' } } dependencies { compileOnly 'io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT' compileOnly 'me.clip:placeholderapi:2.11.3' implementation 'com.github.zafarkhaja:java-semver:0.9.0' implementation 'de.tr7zw:item-nbt-api-plugin:2.11.3' } shadowJar { minimize() archiveBaseName.set(project.name) archiveClassifier.set('') archiveVersion.set(project.version) relocate 'de.tr7zw', 'me.theclashfruit.tr7zw' } buildConfig { buildConfigField('String', 'NAME', "\"${project.name}\"") buildConfigField('String', 'VERSION', "\"${project.version}\"") buildConfigField('long', 'BUILD_TIME', "${buildTimestamp}L") } 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 } }