Skip to content

Commit

Permalink
chore(bump): improve gradle project
Browse files Browse the repository at this point in the history
  • Loading branch information
hugeblank committed Sep 18, 2024
1 parent b397387 commit 8836148
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 65 deletions.
17 changes: 5 additions & 12 deletions allium/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ val alliumVersion: String by project
val alliumReleaseCandidate: String by project
val alliumBaseName: String by project

// Common Dependencies
val cobalt: String by project
val tinyParser: String by project

val enhancedReflections: String by project

// Following by example, using semantic versioning null
var v = alliumVersion
Expand All @@ -20,6 +22,8 @@ base {
}

dependencies {
modImplementation(include("org.squiddev", "Cobalt", cobalt))
modImplementation(include("me.basiqueevangelist","enhanced-reflection", enhancedReflections))
modImplementation(include("net.fabricmc", "tiny-mappings-parser", tinyParser))
}

Expand All @@ -40,15 +44,4 @@ publishing {
version = version
}
}

repositories {
maven {
name = "hugeblankRepo"
url = uri("https://maven.hugeblank.dev/releases")
credentials(PasswordCredentials::class)
authentication {
create<BasicAuthentication>("basic")
}
}
}
}
22 changes: 10 additions & 12 deletions bouquet/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
val mavenGroup: String by project

// Common Dependencies
val cobalt: String by project
val tinyParser: String by project
val enhancedReflections: String by project

val bouquetVersion: String by project
val bouquetReleaseCandidate: String by project
val bouquetBaseName: String by project
Expand Down Expand Up @@ -27,7 +32,11 @@ loom {
}

dependencies {
modImplementation(include("io.netty", "netty-codec-http", nettyHttp))
modImplementation("org.squiddev", "Cobalt", cobalt)
modImplementation("me.basiqueevangelist","enhanced-reflection", enhancedReflections)
modImplementation("net.fabricmc", "tiny-mappings-parser", tinyParser)

implementation(include("io.netty", "netty-codec-http", nettyHttp))
modImplementation("eu.pb4", "placeholder-api", placeholderApi)
implementation(project(path = ":allium", configuration = "namedElements"))
}
Expand All @@ -48,15 +57,4 @@ publishing {
version = version
}
}

repositories {
maven {
name = "hugeblankRepo"
url = uri("https://maven.hugeblank.dev/releases")
credentials(PasswordCredentials::class)
authentication {
create<BasicAuthentication>("basic")
}
}
}
}
62 changes: 37 additions & 25 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import java.util.Locale
import java.util.*

plugins {
id("fabric-loom") version "1.7-SNAPSHOT"
id("maven-publish")
id("fabric-loom") version "1.7-SNAPSHOT"
}
// Common Mod Properties
val mavenGroup: String by project
Expand All @@ -21,9 +21,14 @@ val enhancedReflections: String by project
val nettyHttp: String by project
val placeholderApi: String by project

allprojects {
apply(plugin = "fabric-loom")
dependencies {
minecraft("com.mojang", "minecraft", minecraftVersion)
mappings("net.fabricmc", "yarn", yarnMappings, null, "v2")
}

subprojects {
apply(plugin = "maven-publish")
apply(plugin = "fabric-loom")

repositories {
maven("https://maven.hugeblank.dev/releases") {
Expand Down Expand Up @@ -52,10 +57,6 @@ allprojects {
minecraft("com.mojang", "minecraft", minecraftVersion)
mappings("net.fabricmc", "yarn", yarnMappings, null, "v2")
modImplementation("net.fabricmc", "fabric-loader", loaderVersion)

modImplementation("org.squiddev", "Cobalt", cobalt)
modImplementation("me.basiqueevangelist","enhanced-reflection", enhancedReflections)
modImplementation("net.fabricmc", "tiny-mappings-parser", tinyParser)
}

tasks {
Expand All @@ -74,42 +75,53 @@ allprojects {
}

loom {
val moduleName = project.name.replaceFirstChar {
if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString()
}
runs {
named("client") {
configName = "${
project.name.replaceFirstChar {
if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString()
}
} Client"
configName = "$moduleName Client"
ideConfigGenerated(true)
runDir("../run")
programArgs("-username", "GradleDev")
}
named("server") {
configName = "$moduleName Server"
ideConfigGenerated(true)
runDir("../run")
}
}
}
}
}

dependencies {
implementation("net.fabricmc", "tiny-mappings-parser", tinyParser)
implementation("io.netty", "netty-codec-http", nettyHttp)
implementation("eu.pb4", "placeholder-api", placeholderApi)
publishing {
repositories {
maven {
name = "hugeblankRepo"
url = uri("https://maven.hugeblank.dev/releases")
credentials(PasswordCredentials::class)
authentication {
create<BasicAuthentication>("basic")
}
}
}
}
}

evaluationDependsOnChildren()

tasks {
register<GradleBuild>("buildAll") {
group = "build"
tasks = subprojects.map { ":${it.name}:build" }
}

loom {
runs {
named("client") {
ideConfigGenerated(false)
}
named("server") {
ideConfigGenerated(false)
}
}
}

register<GradleBuild>("buildMoonflower") {
group = "build"
tasks = subprojects.map { ":${it.name}:build" }
}
}
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ org.gradle.parallel=true
mavenGroup=dev.hugeblank

# Allium Properties
alliumVersion=0.1.0
alliumVersion=0.2.0
alliumReleaseCandidate=0
alliumBaseName=allium

Expand All @@ -20,6 +20,7 @@ bouquetBaseName=bouquet
minecraftVersion=1.21.1
yarnMappings=1.21.1+build.3
loaderVersion=0.16.2
loomVersion=1.7-SNAPSHOT

# Common Dependencies
cobalt=0.7.0
Expand Down
15 changes: 0 additions & 15 deletions settings.gradle

This file was deleted.

12 changes: 12 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pluginManagement {
repositories {
maven("https://maven.fabricmc.net/")
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = "月華"

include("allium")
include("bouquet")

0 comments on commit 8836148

Please sign in to comment.