From e58781164e80a8136b1e851bcfc08b95bef562ac Mon Sep 17 00:00:00 2001 From: Minecrell Date: Fri, 29 Sep 2017 17:02:54 +0200 Subject: [PATCH] Add support for single author on Bukkit and set it by default --- README.md | 7 +++++-- .../kotlin/net/minecrell/pluginyml/bukkit/BukkitPlugin.kt | 2 +- .../minecrell/pluginyml/bukkit/BukkitPluginDescription.kt | 1 + .../kotlin/net/minecrell/pluginyml/bungee/BungeePlugin.kt | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 80a27f4..875ef35 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ name, version or description) and additional properties can be added using a sim | Plugin version | Project version | | Plugin description | Project description | | Plugin URL (Bukkit only) | `url` project property | +| Plugin author | `author` project property | ### Bukkit @@ -30,13 +31,14 @@ bukkit { // version = '1.0' // description = 'This is a test plugin' // website = 'https://example.com' + // author = 'Notch' // Plugin main class (required) main = 'com.example.testplugin.TestPlugin' // Other possible properties from plugin.yml (optional) load = 'STARTUP' // or 'POSTWORLD' - authors = ['Notch'] + authors = ['Notch', 'Notch2'] depend = ['WorldEdit'] softDepend = ['Essentials'] loadBefore = ['BrokenPlugin'] @@ -79,13 +81,14 @@ bukkit { // version = "1.0" // description = "This is a test plugin" // website = "https://example.com" + // author = "Notch" // Plugin main class (required) main = "com.example.testplugin.TestPlugin" // Other possible properties from plugin.yml (optional) load = BukkitPluginDescription.PluginLoadOrder.STARTUP // or POSTWORLD - authors = listOf("Notch") + authors = listOf("Notch", "Notch2") depend = listOf("WorldEdit") softDepend = listOf("Essentials") loadBefore = listOf("BrokenPlugin") diff --git a/src/main/kotlin/net/minecrell/pluginyml/bukkit/BukkitPlugin.kt b/src/main/kotlin/net/minecrell/pluginyml/bukkit/BukkitPlugin.kt index 2c3a866..4da6f62 100644 --- a/src/main/kotlin/net/minecrell/pluginyml/bukkit/BukkitPlugin.kt +++ b/src/main/kotlin/net/minecrell/pluginyml/bukkit/BukkitPlugin.kt @@ -36,7 +36,7 @@ class BukkitPlugin : PlatformPlugin("Bukkit", "plugin.y description.version = description.version ?: project.version.toString() description.description = description.description ?: project.description description.website = description.website ?: project.findProperty("url")?.toString() - // TODO: Authors + description.author = description.author ?: project.findProperty("author")?.toString() } override fun validate(description: BukkitPluginDescription) { diff --git a/src/main/kotlin/net/minecrell/pluginyml/bukkit/BukkitPluginDescription.kt b/src/main/kotlin/net/minecrell/pluginyml/bukkit/BukkitPluginDescription.kt index 4310ebe..2a1c76e 100644 --- a/src/main/kotlin/net/minecrell/pluginyml/bukkit/BukkitPluginDescription.kt +++ b/src/main/kotlin/net/minecrell/pluginyml/bukkit/BukkitPluginDescription.kt @@ -37,6 +37,7 @@ class BukkitPluginDescription(project: Project) : Serializable { var main: String? = null var description: String? = null var load: PluginLoadOrder? = null + var author: String? = null var authors: List? = null var website: String? = null var depend: List? = null diff --git a/src/main/kotlin/net/minecrell/pluginyml/bungee/BungeePlugin.kt b/src/main/kotlin/net/minecrell/pluginyml/bungee/BungeePlugin.kt index 1dea260..6f312d0 100644 --- a/src/main/kotlin/net/minecrell/pluginyml/bungee/BungeePlugin.kt +++ b/src/main/kotlin/net/minecrell/pluginyml/bungee/BungeePlugin.kt @@ -35,7 +35,7 @@ class BungeePlugin : PlatformPlugin("Bungee", "bungee.y description.name = description.name ?: project.name description.version = description.version ?: project.version.toString() description.description = description.description ?: project.description - // TODO: Author + description.author = description.author ?: project.findProperty("author")?.toString() } override fun validate(description: BungeePluginDescription) {