74 lines
2.4 KiB
Groovy
74 lines
2.4 KiB
Groovy
/*
|
|
* STAROPENSOURCE ENGINE SOURCE FILE
|
|
* Copyright (c) 2024 The StarOpenSource Engine Contributors
|
|
* Licensed under the GNU Affero General Public License v3
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Affero General Public License as
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
* License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Affero General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
// Plugins
|
|
plugins {
|
|
id("java")
|
|
id("io.freefair.lombok") version("${pluginLombok}")
|
|
id("io.github.goooler.shadow") version("${pluginShadow}")
|
|
}
|
|
|
|
// Dependencies
|
|
dependencies {
|
|
// -> Runtime <-
|
|
// Lombok
|
|
compileOnly("org.projectlombok:lombok:${dependencyLombok}")
|
|
annotationProcessor("org.projectlombok:lombok:${dependencyLombok}")
|
|
|
|
// JetBrains Annotations
|
|
compileOnly("org.jetbrains:annotations:${dependencyJetbrainsAnnotations}")
|
|
|
|
// PaperMC API
|
|
compileOnly("io.papermc.paper:paper-api:${minecraftVersion}${minecraftPaperApiVersion}")
|
|
|
|
// -> Project <-
|
|
implementation(project(":base"))
|
|
implementation(project(":minecraft"))
|
|
implementation(project(":minecraft:bukkit"))
|
|
}
|
|
|
|
// Set to Minecraft's Java version
|
|
java {
|
|
toolchain.languageVersion.set(JavaLanguageVersion.of(project.minecraftJavaVersion))
|
|
}
|
|
|
|
// Fix delombok task
|
|
delombok.doFirst {
|
|
File target = file("${project.projectDir}/src/main/module-info.java")
|
|
File source = file("${project.projectDir}/src/main/java/module-info.java")
|
|
|
|
target.delete()
|
|
source.renameTo(target)
|
|
}
|
|
delombok.doLast {
|
|
File target = file("${project.projectDir}/src/main/java/module-info.java")
|
|
File source = file("${project.projectDir}/src/main/module-info.java")
|
|
|
|
target.delete()
|
|
source.renameTo(target)
|
|
}
|
|
|
|
// Update plugin.yml
|
|
processResources {
|
|
filesMatching("plugin.yml") {
|
|
expand project.properties
|
|
}
|
|
}
|
|
|
|
// Make runServer task of project :minecraft:bukkit depend on 'jar' task
|
|
project(":minecraft:bukkit").getTasks().named("runServer").get().dependsOn(jar)
|