Skip to content

Commit

Permalink
chore: Update gradle script (#748)
Browse files Browse the repository at this point in the history
* chore: update buildscript

* update .gitignore

* chore: simplify publishing task
  • Loading branch information
ryderbelserion authored Jul 6, 2024
1 parent 65bad8a commit c1bcc84
Show file tree
Hide file tree
Showing 128 changed files with 220 additions and 1,023 deletions.
17 changes: 2 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,10 @@ build
buildSrc/.gradle
buildSrc/build

core/.gradle
core/build

api/.gradle
api/build

paper/.gradle
paper/build

paper/run/

!paper/run/config/paper-global.yml
!paper/run/config/paper-world-defaults.yml
!paper/run/bukkit.yml
!paper/run/eula.txt
!paper/run/ops.json
!paper/run/server.properties
!paper/run/spigot.yml
!run/eula.txt
run

jars
39 changes: 0 additions & 39 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ tasks {
this.username = System.getenv("gradle_username")
this.password = System.getenv("gradle_password")
}

//isAllowInsecureProtocol = true
}
}

Expand All @@ -47,43 +45,6 @@ tasks {

artifact(sourcesJar)
artifact(javadocJar)

versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}

usage("java-runtime") {
fromResolutionResult()
}
}

pom {
name.set("CrazyCrates API")
description.set("The official API of CrazyCrates")
url.set("https://modrinth.com/plugin/crazycrates")

licenses {
licenses {
name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
}
}

developers {
developer {
id.set("ryderbelserion")
name.set("Ryder Belserion")
email.set("[email protected]")
}
}

scm {
connection.set("scm:git:git://github.com/Crazy-Crew/CrazyCrates")
developerConnection.set("scm:git:ssh://github.com/Crazy-Crew/CrazyCrates")
url.set("https://github.com/Crazy-Crew/CrazyCrates")
}
}
}
}
}
Expand Down
75 changes: 72 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import com.ryderbelserion.feather.tools.latestCommitHash
import com.ryderbelserion.feather.tools.latestCommitMessage

plugins {
alias(libs.plugins.paperweight)
alias(libs.plugins.shadowJar)
alias(libs.plugins.runPaper)
alias(libs.plugins.minotaur)
alias(libs.plugins.hangar)

`java-plugin`
`paper-plugin`
}

val buildNumber: String? = System.getenv("BUILD_NUMBER")
Expand All @@ -21,8 +24,74 @@ val content: String = if (isSnapshot) {
rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8)
}

subprojects.filter { it.name != "api" }.forEach {
it.project.version = rootProject.version
repositories {
maven("https://repo.fancyplugins.de/releases")
}

dependencies {
paperweight.paperDevBundle(libs.versions.paper)

implementation(libs.triumph.cmds)

implementation(libs.vital.paper)

compileOnly(fileTree("$projectDir/libs/compile").include("*.jar"))

compileOnly(libs.decent.holograms)

compileOnly(libs.fancy.holograms)

api(project(":api"))
}

paperweight {
reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
}

tasks {
runServer {
jvmArgs("-Dnet.kyori.ansi.colorLevel=truecolor")

defaultCharacterEncoding = Charsets.UTF_8.name()

minecraftVersion(libs.versions.minecraft.get())
}

assemble {
dependsOn(shadowJar)

doLast {
copy {
from(shadowJar.get())
into(rootProject.projectDir.resolve("jars"))
}
}
}

shadowJar {
archiveBaseName.set(rootProject.name)
archiveClassifier.set("")

listOf(
"com.ryderbelserion",
"dev.triumphteam"
).forEach {
relocate(it, "libs.$it")
}
}

processResources {
inputs.properties("name" to rootProject.name)
inputs.properties("version" to project.version)
inputs.properties("group" to project.group)
inputs.properties("apiVersion" to libs.versions.minecraft.get())
inputs.properties("description" to project.properties["description"])
inputs.properties("website" to project.properties["website"])

filesMatching("paper-plugin.yml") {
expand(inputs.properties)
}
}
}

modrinth {
Expand Down
11 changes: 0 additions & 11 deletions core/build.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

File renamed without changes.
File renamed without changes.
Loading

0 comments on commit c1bcc84

Please sign in to comment.