Gradle.................

This commit is contained in:
Logan Gorence 2021-12-21 08:58:44 +00:00
parent 7259de6c17
commit aed37ae013
No known key found for this signature in database
GPG Key ID: 9743CEF10935949A
11 changed files with 85 additions and 47 deletions

View File

@ -1,46 +1,51 @@
plugins {
kotlin("jvm") version "1.6.10"
id("com.github.johnrengelman.shadow") version "7.1.1"
java
id("org.jetbrains.kotlin.jvm") version "1.6.10" apply false
id("com.github.johnrengelman.shadow") version "7.1.1" apply false
}
group = "io.gorence"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven {
name = "papermc-repo"
url = uri("https://papermc.io/repo/repository/maven-public/")
}
maven {
name = "sonatype"
url = uri("https://oss.sonatype.org/content/groups/public/")
allprojects {
repositories {
mavenCentral()
maven {
name = "papermc-repo"
url = uri("https://papermc.io/repo/repository/maven-public/")
}
maven {
name = "sonatype"
url = uri("https://oss.sonatype.org/content/groups/public/")
}
}
}
dependencies {
// Kotlin dependencies
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
subprojects {
plugins.apply("org.jetbrains.kotlin.jvm")
plugins.apply("com.github.johnrengelman.shadow")
// Database layer
implementation("org.jetbrains.xodus:xodus-openAPI:1.3.232")
group = "io.gorence"
version = "1.0-SNAPSHOT"
// Paper API
compileOnly("io.papermc.paper:paper-api:1.18.1-R0.1-SNAPSHOT")
}
dependencies {
// Kotlin dependencies
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
java {
val javaVersion = JavaVersion.toVersion(17)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
// Paper API
compileOnly("io.papermc.paper:paper-api:1.18.1-R0.1-SNAPSHOT")
}
tasks.processResources {
val props = mapOf("version" to version)
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("plugin.yml") {
expand(props)
java {
val javaVersion = JavaVersion.toVersion(17)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
tasks.processResources {
val props = mapOf("version" to version)
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("plugin.yml") {
expand(props)
}
}
}

View File

@ -0,0 +1,3 @@
dependencies {
implementation("net.dv8tion:JDA:5.0.0-alpha.2")
}

View File

@ -0,0 +1,9 @@
package cloud.kubelet.foundation.bifrost
import org.bukkit.plugin.java.JavaPlugin
class FoundationBifrostPlugin : JavaPlugin() {
override fun onEnable() {
slF4JLogger.info("Enabling!")
}
}

View File

@ -0,0 +1,15 @@
name: Foundation-Bifrost
version: '${version}'
main: cloud.kubelet.foundation.bifrost.FoundationBifrostPlugin
api-version: 1.18
prefix: Foundation-Bifrost
load: STARTUP
depend:
- Foundation
authors:
- kubelet
commands:
fbackup:
description: Foundation Backup
usage: /fbackup
permission: foundation.backup

View File

@ -0,0 +1,2 @@
dependencies {
}

View File

@ -1,6 +1,6 @@
package cloud.kubelet.foundation
package cloud.kubelet.foundation.core
import cloud.kubelet.foundation.command.BackupCommand
import cloud.kubelet.foundation.core.command.BackupCommand
import io.papermc.paper.event.player.ChatEvent
import net.kyori.adventure.text.Component
import org.bukkit.command.CommandExecutor
@ -8,7 +8,7 @@ import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.plugin.java.JavaPlugin
class Foundation : JavaPlugin(), Listener {
class FoundationCorePlugin : JavaPlugin(), Listener {
override fun onEnable() {
val dataPath = dataFolder.toPath()
val backupPath = dataPath.resolve(BACKUPS_DIRECTORY)

View File

@ -1,4 +1,4 @@
package cloud.kubelet.foundation
package cloud.kubelet.foundation.core
import net.kyori.adventure.text.format.TextColor

View File

@ -1,4 +1,4 @@
package cloud.kubelet.foundation
package cloud.kubelet.foundation.core
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.TextColor

View File

@ -1,7 +1,7 @@
package cloud.kubelet.foundation.command
package cloud.kubelet.foundation.core.command
import cloud.kubelet.foundation.Foundation
import cloud.kubelet.foundation.Util
import cloud.kubelet.foundation.core.FoundationCorePlugin
import cloud.kubelet.foundation.core.Util
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.TextColor
import org.bukkit.Server
@ -20,14 +20,13 @@ import java.util.zip.ZipEntry
import java.util.zip.ZipOutputStream
class BackupCommand(
private val plugin: Foundation,
private val plugin: FoundationCorePlugin,
private val backupPath: Path
) : CommandExecutor {
override fun onCommand(
sender: CommandSender, command: Command,
label: String, args: Array<String>
sender: CommandSender, command: Command, label: String, args: Array<String>
): Boolean {
if (!Foundation.BACKUP_ENABLED) {
if (!FoundationCorePlugin.BACKUP_ENABLED) {
sender.sendMessage(
Component
.text("Backup is not enabled.")

View File

@ -1,6 +1,6 @@
name: Foundation
version: '${version}'
main: cloud.kubelet.foundation.Foundation
main: cloud.kubelet.foundation.core.FoundationCorePlugin
api-version: 1.18
prefix: Foundation
load: STARTUP

View File

@ -1 +1,6 @@
rootProject.name = "foundation"
include(
":foundation-core",
":foundation-bifrost",
)