316 lines
10 KiB
Groovy
316 lines
10 KiB
Groovy
|
|
plugins {
|
||
|
|
id 'java'
|
||
|
|
id("xyz.jpenilla.run-paper") version "2.3.1"
|
||
|
|
id 'com.gradleup.shadow' version '8.3.5'
|
||
|
|
}
|
||
|
|
|
||
|
|
group = 'de.winniepat'
|
||
|
|
version = 'alpha-11'
|
||
|
|
|
||
|
|
base {
|
||
|
|
archivesName = 'MinePanel'
|
||
|
|
}
|
||
|
|
|
||
|
|
repositories {
|
||
|
|
mavenCentral()
|
||
|
|
maven {
|
||
|
|
name = "papermc-repo"
|
||
|
|
url = "https://repo.papermc.io/repository/maven-public/"
|
||
|
|
}
|
||
|
|
maven {
|
||
|
|
name = "luckperms-repo"
|
||
|
|
url = "https://repo.lucko.me/"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
dependencies {
|
||
|
|
compileOnly("io.papermc.paper:paper-api:1.21.11-R0.1-SNAPSHOT")
|
||
|
|
compileOnly("net.luckperms:api:5.4")
|
||
|
|
implementation("com.sparkjava:spark-core:2.9.4")
|
||
|
|
implementation("org.xerial:sqlite-jdbc:3.46.1.3")
|
||
|
|
implementation("org.mindrot:jbcrypt:0.4")
|
||
|
|
implementation("com.google.code.gson:gson:2.11.0")
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.named('shadowJar') {
|
||
|
|
archiveClassifier.set('')
|
||
|
|
exclude('de/winniepat/minePanel/extensions/reports/**')
|
||
|
|
exclude('de/winniepat/minePanel/extensions/playermanagement/**')
|
||
|
|
exclude('de/winniepat/minePanel/extensions/luckperms/**')
|
||
|
|
exclude('de/winniepat/minePanel/extensions/playerstats/**')
|
||
|
|
exclude('de/winniepat/minePanel/extensions/tickets/**')
|
||
|
|
exclude('de/winniepat/minePanel/extensions/worldbackups/**')
|
||
|
|
exclude('de/winniepat/minePanel/extensions/airstrike/**')
|
||
|
|
exclude('de/winniepat/minePanel/extensions/maintenance/**')
|
||
|
|
exclude('de/winniepat/minePanel/extensions/whitelist/**')
|
||
|
|
exclude('de/winniepat/minePanel/extensions/announcements/**')
|
||
|
|
}
|
||
|
|
|
||
|
|
def extensionOutputDir = layout.buildDirectory.dir('libs/extensions')
|
||
|
|
|
||
|
|
tasks.register('reportsExtensionJar', Jar) {
|
||
|
|
group = 'build'
|
||
|
|
description = 'Builds the MinePanel reports extension jar.'
|
||
|
|
dependsOn(tasks.named('classes'))
|
||
|
|
|
||
|
|
archiveBaseName.set('MinePanel-Extension-Reports')
|
||
|
|
archiveVersion.set(project.version.toString())
|
||
|
|
destinationDirectory.set(extensionOutputDir)
|
||
|
|
|
||
|
|
from(sourceSets.main.output) {
|
||
|
|
include('de/winniepat/minePanel/extensions/reports/**')
|
||
|
|
}
|
||
|
|
|
||
|
|
from(resources.text.fromString('de.winniepat.minePanel.extensions.reports.ReportSystemExtension\n')) {
|
||
|
|
into('META-INF/services')
|
||
|
|
rename { 'de.winniepat.minePanel.extensions.MinePanelExtension' }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.register('playerManagementExtensionJar', Jar) {
|
||
|
|
group = 'build'
|
||
|
|
description = 'Builds the MinePanel player-management extension jar.'
|
||
|
|
dependsOn(tasks.named('classes'))
|
||
|
|
|
||
|
|
archiveBaseName.set('MinePanel-Extension-PlayerManagement')
|
||
|
|
archiveVersion.set(project.version.toString())
|
||
|
|
destinationDirectory.set(extensionOutputDir)
|
||
|
|
|
||
|
|
from(sourceSets.main.output) {
|
||
|
|
include('de/winniepat/minePanel/extensions/playermanagement/**')
|
||
|
|
}
|
||
|
|
|
||
|
|
from(resources.text.fromString('de.winniepat.minePanel.extensions.playermanagement.PlayerManagementExtension\n')) {
|
||
|
|
into('META-INF/services')
|
||
|
|
rename { 'de.winniepat.minePanel.extensions.MinePanelExtension' }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.register('luckPermsExtensionJar', Jar) {
|
||
|
|
group = 'build'
|
||
|
|
description = 'Builds the MinePanel LuckPerms extension jar.'
|
||
|
|
dependsOn(tasks.named('classes'))
|
||
|
|
|
||
|
|
archiveBaseName.set('MinePanel-Extension-LuckPerms')
|
||
|
|
archiveVersion.set(project.version.toString())
|
||
|
|
destinationDirectory.set(extensionOutputDir)
|
||
|
|
|
||
|
|
from(sourceSets.main.output) {
|
||
|
|
include('de/winniepat/minePanel/extensions/luckperms/**')
|
||
|
|
}
|
||
|
|
|
||
|
|
from(resources.text.fromString('de.winniepat.minePanel.extensions.luckperms.LuckPermsExtension\n')) {
|
||
|
|
into('META-INF/services')
|
||
|
|
rename { 'de.winniepat.minePanel.extensions.MinePanelExtension' }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.register('playerStatsExtensionJar', Jar) {
|
||
|
|
group = 'build'
|
||
|
|
description = 'Builds the MinePanel player stats extension jar.'
|
||
|
|
dependsOn(tasks.named('classes'))
|
||
|
|
|
||
|
|
archiveBaseName.set('MinePanel-Extension-PlayerStats')
|
||
|
|
archiveVersion.set(project.version.toString())
|
||
|
|
destinationDirectory.set(extensionOutputDir)
|
||
|
|
|
||
|
|
from(sourceSets.main.output) {
|
||
|
|
include('de/winniepat/minePanel/extensions/playerstats/**')
|
||
|
|
}
|
||
|
|
|
||
|
|
from(resources.text.fromString('de.winniepat.minePanel.extensions.playerstats.PlayerStatsExtension\n')) {
|
||
|
|
into('META-INF/services')
|
||
|
|
rename { 'de.winniepat.minePanel.extensions.MinePanelExtension' }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.register('ticketsExtensionJar', Jar) {
|
||
|
|
group = 'build'
|
||
|
|
description = 'Builds the MinePanel ticket-system extension jar.'
|
||
|
|
dependsOn(tasks.named('classes'))
|
||
|
|
|
||
|
|
archiveBaseName.set('MinePanel-Extension-Tickets')
|
||
|
|
archiveVersion.set(project.version.toString())
|
||
|
|
destinationDirectory.set(extensionOutputDir)
|
||
|
|
|
||
|
|
from(sourceSets.main.output) {
|
||
|
|
include('de/winniepat/minePanel/extensions/tickets/**')
|
||
|
|
}
|
||
|
|
|
||
|
|
from(resources.text.fromString('de.winniepat.minePanel.extensions.tickets.TicketSystemExtension\n')) {
|
||
|
|
into('META-INF/services')
|
||
|
|
rename { 'de.winniepat.minePanel.extensions.MinePanelExtension' }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.register('worldBackupsExtensionJar', Jar) {
|
||
|
|
group = 'build'
|
||
|
|
description = 'Builds the MinePanel world-backups extension jar.'
|
||
|
|
dependsOn(tasks.named('classes'))
|
||
|
|
|
||
|
|
archiveBaseName.set('MinePanel-Extension-WorldBackups')
|
||
|
|
archiveVersion.set(project.version.toString())
|
||
|
|
destinationDirectory.set(extensionOutputDir)
|
||
|
|
|
||
|
|
from(sourceSets.main.output) {
|
||
|
|
include('de/winniepat/minePanel/extensions/worldbackups/**')
|
||
|
|
}
|
||
|
|
|
||
|
|
from(resources.text.fromString('de.winniepat.minePanel.extensions.worldbackups.WorldBackupsExtension\n')) {
|
||
|
|
into('META-INF/services')
|
||
|
|
rename { 'de.winniepat.minePanel.extensions.MinePanelExtension' }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.register('airstrikeExtensionJar', Jar) {
|
||
|
|
group = 'build'
|
||
|
|
description = 'Builds the MinePanel airstrike extension jar.'
|
||
|
|
dependsOn(tasks.named('classes'))
|
||
|
|
|
||
|
|
archiveBaseName.set('MinePanel-Extension-Airstrike')
|
||
|
|
archiveVersion.set(project.version.toString())
|
||
|
|
destinationDirectory.set(extensionOutputDir)
|
||
|
|
|
||
|
|
from(sourceSets.main.output) {
|
||
|
|
include('de/winniepat/minePanel/extensions/airstrike/**')
|
||
|
|
}
|
||
|
|
|
||
|
|
from(resources.text.fromString('de.winniepat.minePanel.extensions.airstrike.AirstrikeExtension\n')) {
|
||
|
|
into('META-INF/services')
|
||
|
|
rename { 'de.winniepat.minePanel.extensions.MinePanelExtension' }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.register('maintenanceExtensionJar', Jar) {
|
||
|
|
group = 'build'
|
||
|
|
description = 'Builds the MinePanel maintenance extension jar.'
|
||
|
|
dependsOn(tasks.named('classes'))
|
||
|
|
|
||
|
|
archiveBaseName.set('MinePanel-Extension-Maintenance')
|
||
|
|
archiveVersion.set(project.version.toString())
|
||
|
|
destinationDirectory.set(extensionOutputDir)
|
||
|
|
|
||
|
|
from(sourceSets.main.output) {
|
||
|
|
include('de/winniepat/minePanel/extensions/maintenance/**')
|
||
|
|
}
|
||
|
|
|
||
|
|
from(resources.text.fromString('de.winniepat.minePanel.extensions.maintenance.MaintenanceExtension\n')) {
|
||
|
|
into('META-INF/services')
|
||
|
|
rename { 'de.winniepat.minePanel.extensions.MinePanelExtension' }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.register('whitelistExtensionJar', Jar) {
|
||
|
|
group = 'build'
|
||
|
|
description = 'Builds the MinePanel whitelist extension jar.'
|
||
|
|
dependsOn(tasks.named('classes'))
|
||
|
|
|
||
|
|
archiveBaseName.set('MinePanel-Extension-Whitelist')
|
||
|
|
archiveVersion.set(project.version.toString())
|
||
|
|
destinationDirectory.set(extensionOutputDir)
|
||
|
|
|
||
|
|
from(sourceSets.main.output) {
|
||
|
|
include('de/winniepat/minePanel/extensions/whitelist/**')
|
||
|
|
}
|
||
|
|
|
||
|
|
from(resources.text.fromString('de.winniepat.minePanel.extensions.whitelist.WhitelistExtension\n')) {
|
||
|
|
into('META-INF/services')
|
||
|
|
rename { 'de.winniepat.minePanel.extensions.MinePanelExtension' }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.register('announcementsExtensionJar', Jar) {
|
||
|
|
group = 'build'
|
||
|
|
description = 'Builds the MinePanel announcements extension jar.'
|
||
|
|
dependsOn(tasks.named('classes'))
|
||
|
|
|
||
|
|
archiveBaseName.set('MinePanel-Extension-Announcements')
|
||
|
|
archiveVersion.set(project.version.toString())
|
||
|
|
destinationDirectory.set(extensionOutputDir)
|
||
|
|
|
||
|
|
from(sourceSets.main.output) {
|
||
|
|
include('de/winniepat/minePanel/extensions/announcements/**')
|
||
|
|
}
|
||
|
|
|
||
|
|
from(resources.text.fromString('de.winniepat.minePanel.extensions.announcements.AnnouncementsExtension\n')) {
|
||
|
|
into('META-INF/services')
|
||
|
|
rename { 'de.winniepat.minePanel.extensions.MinePanelExtension' }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.register('installExtensionsToRunServer', Copy) {
|
||
|
|
group = 'build'
|
||
|
|
description = 'Copies built extension jars into run/plugins/MinePanel/extensions for local testing.'
|
||
|
|
dependsOn(
|
||
|
|
tasks.named('reportsExtensionJar'),
|
||
|
|
tasks.named('playerManagementExtensionJar'),
|
||
|
|
tasks.named('luckPermsExtensionJar'),
|
||
|
|
tasks.named('playerStatsExtensionJar'),
|
||
|
|
tasks.named('ticketsExtensionJar'),
|
||
|
|
tasks.named('worldBackupsExtensionJar'),
|
||
|
|
tasks.named('airstrikeExtensionJar'),
|
||
|
|
tasks.named('maintenanceExtensionJar'),
|
||
|
|
tasks.named('whitelistExtensionJar'),
|
||
|
|
tasks.named('announcementsExtensionJar')
|
||
|
|
)
|
||
|
|
|
||
|
|
from(extensionOutputDir)
|
||
|
|
include('*.jar')
|
||
|
|
into(layout.projectDirectory.dir('run/plugins/MinePanel/extensions'))
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.named('assemble') {
|
||
|
|
dependsOn(tasks.named('shadowJar'))
|
||
|
|
dependsOn(tasks.named('reportsExtensionJar'))
|
||
|
|
dependsOn(tasks.named('playerManagementExtensionJar'))
|
||
|
|
dependsOn(tasks.named('luckPermsExtensionJar'))
|
||
|
|
dependsOn(tasks.named('playerStatsExtensionJar'))
|
||
|
|
dependsOn(tasks.named('ticketsExtensionJar'))
|
||
|
|
dependsOn(tasks.named('worldBackupsExtensionJar'))
|
||
|
|
dependsOn(tasks.named('airstrikeExtensionJar'))
|
||
|
|
dependsOn(tasks.named('maintenanceExtensionJar'))
|
||
|
|
dependsOn(tasks.named('whitelistExtensionJar'))
|
||
|
|
dependsOn(tasks.named('announcementsExtensionJar'))
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks {
|
||
|
|
runServer {
|
||
|
|
minecraftVersion("1.21.11")
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
def targetJavaVersion = 21
|
||
|
|
java {
|
||
|
|
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
|
||
|
|
sourceCompatibility = javaVersion
|
||
|
|
targetCompatibility = javaVersion
|
||
|
|
if (JavaVersion.current() < javaVersion) {
|
||
|
|
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.withType(JavaCompile).configureEach {
|
||
|
|
options.encoding = 'UTF-8'
|
||
|
|
|
||
|
|
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
|
||
|
|
options.release.set(targetJavaVersion)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
processResources {
|
||
|
|
def props = [version: version]
|
||
|
|
inputs.properties props
|
||
|
|
filteringCharset 'UTF-8'
|
||
|
|
filesMatching('plugin.yml') {
|
||
|
|
expand props
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.register('copyPlugin', Copy) {
|
||
|
|
dependsOn build
|
||
|
|
from("$buildDir/libs")
|
||
|
|
include('*.jar')
|
||
|
|
into("F:/MinePanel/folia/plugins")
|
||
|
|
}
|
||
|
|
|
||
|
|
build.finalizedBy(copyPlugin)
|