-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07cf6ff
commit 5197b99
Showing
10 changed files
with
117 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,52 @@ | ||
plugins { | ||
alias(libs.plugins.minotaur) | ||
alias(libs.plugins.hangar) | ||
|
||
`java-plugin` | ||
`maven-publish` | ||
`java-library` | ||
} | ||
|
||
val buildNumber: String? = System.getenv("BUILD_NUMBER") | ||
|
||
rootProject.version = if (buildNumber != null) "${libs.versions.minecraft.get()}-$buildNumber" else "2.5.1" | ||
|
||
val isSnapshot = false | ||
|
||
val content: String = rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8) | ||
|
||
subprojects.filter { it.name != "api" }.forEach { | ||
it.project.version = rootProject.version | ||
} | ||
|
||
modrinth { | ||
token.set(System.getenv("MODRINTH_TOKEN")) | ||
|
||
projectId.set(rootProject.name.lowercase()) | ||
|
||
versionType.set(if (isSnapshot) "beta" else "release") | ||
|
||
versionName.set("${rootProject.name} ${rootProject.version}") | ||
versionNumber.set(rootProject.version as String) | ||
|
||
changelog.set(content) | ||
|
||
uploadFile.set(rootProject.projectDir.resolve("jars/${rootProject.name}-${rootProject.version}.jar")) | ||
subprojects { | ||
apply(plugin = "maven-publish") | ||
apply(plugin = "java-library") | ||
|
||
gameVersions.set(listOf(libs.versions.minecraft.get())) | ||
group = "com.badbones69.crazyenchantments" | ||
description = "Adds over 80 unique enchantments to your server and more!" | ||
|
||
loaders.addAll(listOf("purpur", "paper", "folia")) | ||
repositories { | ||
maven("https://repo.codemc.io/repository/maven-public") | ||
|
||
autoAddDependsOn.set(false) | ||
detectLoaders.set(false) | ||
} | ||
|
||
hangarPublish { | ||
publications.register("plugin") { | ||
apiKey.set(System.getenv("HANGAR_KEY")) | ||
maven("https://repo.crazycrew.us/libraries") | ||
maven("https://repo.crazycrew.us/releases") | ||
|
||
id.set(rootProject.name.lowercase()) | ||
maven("https://jitpack.io") | ||
|
||
version.set(rootProject.version as String) | ||
|
||
channel.set(if (isSnapshot) "Beta" else "Release") | ||
mavenCentral() | ||
} | ||
|
||
changelog.set(content) | ||
java { | ||
toolchain { | ||
languageVersion.set(JavaLanguageVersion.of(21)) | ||
} | ||
} | ||
|
||
platforms { | ||
paper { | ||
jar.set(rootProject.projectDir.resolve("jars/${rootProject.name}-${rootProject.version}.jar")) | ||
tasks { | ||
compileJava { | ||
options.encoding = Charsets.UTF_8.name() | ||
options.release.set(21) | ||
} | ||
|
||
platformVersions.set(listOf(libs.versions.minecraft.get())) | ||
javadoc { | ||
options.encoding = Charsets.UTF_8.name() | ||
} | ||
|
||
dependencies { | ||
hangar("PlaceholderAPI") { | ||
required = false | ||
} | ||
} | ||
} | ||
processResources { | ||
filteringCharset = Charsets.UTF_8.name() | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
plugins { | ||
alias(libs.plugins.minotaur) | ||
alias(libs.plugins.hangar) | ||
} | ||
|
||
val content: String = rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8) | ||
|
||
val isBeta = false | ||
val pluginName = rootProject.name | ||
val mcVersion = libs.versions.minecraft.get() | ||
|
||
tasks { | ||
modrinth { | ||
token.set(System.getenv("MODRINTH_TOKEN")) | ||
|
||
projectId.set(rootProject.name) | ||
|
||
versionType.set(if (isBeta) "beta" else "release") | ||
|
||
versionName.set("$pluginName ${rootProject.version}") | ||
versionNumber.set(rootProject.version as String) | ||
|
||
changelog.set(content) | ||
|
||
uploadFile.set(rootProject.projectDir.resolve("jars/$pluginName-${rootProject.version}.jar")) | ||
|
||
gameVersions.set(listOf(mcVersion)) | ||
|
||
loaders.addAll(listOf("purpur", "paper", "folia")) | ||
|
||
syncBodyFrom.set(rootProject.file("README.md").readText(Charsets.UTF_8)) | ||
|
||
autoAddDependsOn.set(false) | ||
detectLoaders.set(false) | ||
} | ||
|
||
hangarPublish { | ||
publications.register("plugin") { | ||
apiKey.set(System.getenv("HANGAR_KEY")) | ||
|
||
id.set(pluginName) | ||
|
||
version.set(rootProject.version as String) | ||
|
||
channel.set(if (isBeta) "Beta" else "Release") | ||
|
||
changelog.set(content) | ||
|
||
platforms { | ||
paper { | ||
jar.set(rootProject.projectDir.resolve("jars/$pluginName-${rootProject.version}.jar")) | ||
|
||
platformVersions.set(listOf(mcVersion)) | ||
|
||
dependencies { | ||
hangar("PlaceholderAPI") { | ||
required = false | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
rootProject.name = "CrazyEnchantments" | ||
|
||
include("paper") | ||
include("publish" ,"paper") |