mirror of
https://github.com/Crazy-Crew/CrazyAuctions.git
synced 2024-11-10 10:10:22 +01:00
fix build script
This commit is contained in:
parent
22250d5328
commit
c705274c18
@ -1,3 +1,65 @@
|
||||
plugins {
|
||||
alias(libs.plugins.minotaur)
|
||||
alias(libs.plugins.hangar)
|
||||
|
||||
`root-plugin`
|
||||
}
|
||||
|
||||
val buildNumber: String? = System.getenv("BUILD_NUMBER")
|
||||
|
||||
rootProject.version = if (buildNumber != null) "3.12-$buildNumber" else "3.12"
|
||||
|
||||
val isSnapshot = false
|
||||
|
||||
val content: String = rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8)
|
||||
|
||||
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"))
|
||||
|
||||
gameVersions.set(listOf(libs.versions.minecraft.get()))
|
||||
|
||||
loaders.add("paper")
|
||||
loaders.add("purpur")
|
||||
|
||||
autoAddDependsOn.set(false)
|
||||
detectLoaders.set(false)
|
||||
}
|
||||
|
||||
hangarPublish {
|
||||
publications.register("plugin") {
|
||||
apiKey.set(System.getenv("HANGAR_KEY"))
|
||||
|
||||
id.set(rootProject.name.lowercase())
|
||||
|
||||
version.set(rootProject.version as String)
|
||||
|
||||
channel.set(if (isSnapshot) "Snapshot" else "Release")
|
||||
|
||||
changelog.set(content)
|
||||
|
||||
platforms {
|
||||
paper {
|
||||
jar.set(rootProject.projectDir.resolve("jars/${rootProject.name}-${rootProject.version}.jar"))
|
||||
|
||||
platformVersions.set(listOf(libs.versions.minecraft.get()))
|
||||
|
||||
dependencies {
|
||||
hangar("PlaceholderAPI") {
|
||||
required = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -9,6 +9,4 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
implementation(libs.paperweight.userdev)
|
||||
implementation(libs.publishing.modrinth)
|
||||
implementation(libs.publishing.hangar)
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
plugins {
|
||||
id("root-plugin")
|
||||
}
|
||||
|
||||
val mcVersion = providers.gradleProperty("mcVersion").get()
|
||||
val fabricVersion = providers.gradleProperty("version").get()
|
||||
|
||||
project.version = if (System.getenv("BUILD_NUMBER") != null) "$fabricVersion-${System.getenv("BUILD_NUMBER")}" else fabricVersion
|
||||
|
||||
tasks {
|
||||
modrinth {
|
||||
loaders.addAll("fabric")
|
||||
}
|
||||
}
|
@ -15,13 +15,3 @@ repositories {
|
||||
|
||||
flatDir { dirs("libs") }
|
||||
}
|
||||
|
||||
val mcVersion = providers.gradleProperty("mcVersion").get()
|
||||
|
||||
project.version = if (System.getenv("BUILD_NUMBER") != null) "${rootProject.version}-${System.getenv("BUILD_NUMBER")}" else rootProject.version
|
||||
|
||||
tasks {
|
||||
modrinth {
|
||||
loaders.addAll("paper", "purpur")
|
||||
}
|
||||
}
|
@ -1,10 +1,4 @@
|
||||
import io.papermc.hangarpublishplugin.model.Platforms
|
||||
|
||||
plugins {
|
||||
id("io.papermc.hangar-publish-plugin")
|
||||
|
||||
id("com.modrinth.minotaur")
|
||||
|
||||
`java-library`
|
||||
|
||||
`maven-publish`
|
||||
@ -41,53 +35,4 @@ tasks {
|
||||
processResources {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
val directory = File("$rootDir/jars/${project.name.lowercase()}")
|
||||
val mcVersion = providers.gradleProperty("mcVersion").get()
|
||||
|
||||
val isBeta: Boolean = providers.gradleProperty("isBeta").get().toBoolean()
|
||||
val type = if (isBeta) "Beta" else "Release"
|
||||
|
||||
// Publish to hangar.papermc.io.
|
||||
hangarPublish {
|
||||
publications.register("plugin") {
|
||||
version.set("${project.version}")
|
||||
|
||||
id.set(rootProject.name)
|
||||
|
||||
channel.set(type)
|
||||
|
||||
changelog.set(rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8))
|
||||
|
||||
apiKey.set(System.getenv("hangar_key"))
|
||||
|
||||
platforms {
|
||||
register(Platforms.PAPER) {
|
||||
jar.set(file("$directory/${rootProject.name}-${project.version}.jar"))
|
||||
|
||||
platformVersions.set(listOf(mcVersion))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
modrinth {
|
||||
versionType.set(type.lowercase())
|
||||
|
||||
autoAddDependsOn.set(false)
|
||||
|
||||
token.set(System.getenv("modrinth_token"))
|
||||
|
||||
projectId.set(rootProject.name.lowercase())
|
||||
|
||||
changelog.set(rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8))
|
||||
|
||||
versionName.set("${rootProject.name} ${project.version}")
|
||||
|
||||
versionNumber.set("${project.version}")
|
||||
|
||||
uploadFile.set("$directory/${rootProject.name}-${project.version}.jar")
|
||||
|
||||
gameVersions.add(mcVersion)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user