Skip to content

Commit

Permalink
Make build files more convenient
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Jul 28, 2024
1 parent 4e4ae48 commit 29411fb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 13 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ plugins {
id("xyz.jpenilla.resource-factory-bukkit-convention") version "1.1.1" // Generates plugin.yml based on the Gradle config
}

group = "net.slqmy.template_paper_plugin"
fun underscoreCase(string: String): String {
return string.lowercase().replace(' ', '_')
}

fun pascalCase(string: String): String {
return string.replace(" ", "")
}

val author = "Slqmy"

group = "net." + author.lowercase() + "." + underscoreCase(rootProject.name)
version = "1.0.0-SNAPSHOT"
description = "Test plugin for paperweight-userdev"

Expand Down Expand Up @@ -61,8 +71,8 @@ tasks {
// Configure plugin.yml generation
// - name, version, and description are inherited from the Gradle project.
bukkitPluginYaml {
main = "net.slqmy.template_paper_plugin.TemplatePaperPlugin"
main = project.group.toString() + "." + pascalCase(rootProject.name)
load = BukkitPluginYaml.PluginLoadOrder.STARTUP
authors.add("Slqmy")
authors.add(author)
apiVersion = paperApiVersion
}
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}

rootProject.name = "Template Paper Plugin"

0 comments on commit 29411fb

Please sign in to comment.