aboutsummaryrefslogtreecommitdiff
path: root/build.gradle.kts
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-06-03 14:56:10 +0200
committernea <nea@nea.moe>2023-06-03 14:56:10 +0200
commitb3237fe53d4ff838984d65954772cf77588644ae (patch)
treedcc6c6245a60a11e84a004b0d0123e7568e54a21 /build.gradle.kts
parent9477a32ad577fc242fd83059826706fcea8c6f31 (diff)
downloadfirmament-b3237fe53d4ff838984d65954772cf77588644ae.tar.gz
firmament-b3237fe53d4ff838984d65954772cf77588644ae.tar.bz2
firmament-b3237fe53d4ff838984d65954772cf77588644ae.zip
Add auto hotswap installer
Diffstat (limited to 'build.gradle.kts')
-rw-r--r--build.gradle.kts66
1 files changed, 44 insertions, 22 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index a5a28d3..276d26c 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -28,23 +28,6 @@ compileTestKotlin.kotlinOptions {
jvmTarget = "17"
}
-loom {
- clientOnlyMinecraftJar()
- accessWidenerPath.set(project.file("src/main/resources/firmament.accesswidener"))
- runs {
- removeIf { it.name != "client" }
- named("client") {
- property("devauth.enabled", "true")
- property("fabric.log.level", "info")
- property("firmament.debug", "true")
- /*
- vmArg("-XX:+AllowEnhancedClassRedefinition")
- vmArg("-XX:HotswapAgent=fatjar")
- */
- }
- }
-}
-
repositories {
maven("https://maven.terraformersmc.com/releases/")
maven("https://maven.shedaniel.me")
@@ -59,6 +42,17 @@ repositories {
includeGroup("com.unascribed")
}
}
+ ivy("https://github.com/HotswapProjects/HotswapAgent/releases/download") {
+ patternLayout {
+ artifact("[revision]/[artifact]-[revision].[ext]")
+ }
+ content {
+ includeGroup("virtual.github.hotswapagent")
+ }
+ metadataSources {
+ artifact()
+ }
+ }
maven("https://server.bbkr.space/artifactory/libs-release")
maven("https://repo.nea.moe/releases")
mavenLocal()
@@ -72,6 +66,10 @@ val transInclude by configurations.creating {
isTransitive = true
}
+val hotswap by configurations.creating {
+ isVisible = false
+}
+
val nonModImplentation by configurations.creating {
extendsFrom(shadowMe)
configurations.implementation.get().extendsFrom(this)
@@ -82,6 +80,9 @@ dependencies {
"minecraft"(libs.minecraft)
"mappings"("net.fabricmc:yarn:${libs.versions.yarn.get()}:v2")
+ // Hotswap Dependency
+ hotswap(libs.hotswap)
+
// Fabric dependencies
modImplementation(libs.fabric.loader)
modImplementation(libs.fabric.kotlin)
@@ -123,22 +124,46 @@ dependencies {
version = rootProject.property("mod_version").toString()
group = rootProject.property("maven_group").toString()
+loom {
+ clientOnlyMinecraftJar()
+ accessWidenerPath.set(project.file("src/main/resources/firmament.accesswidener"))
+ runs {
+ removeIf { it.name != "client" }
+ named("client") {
+ property("devauth.enabled", "true")
+ property("fabric.log.level", "info")
+ property("firmament.debug", "true")
+
+ vmArg("-ea")
+ vmArg("-XX:+AllowEnhancedClassRedefinition")
+ vmArg("-XX:HotswapAgent=external")
+ vmArg("-javaagent:${hotswap.resolve().single().absolutePath}")
+ }
+ }
+}
+
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(17)
}
+tasks.jar {
+ destinationDirectory.set(layout.buildDirectory.dir("badjars"))
+ archiveClassifier.set("slim")
+}
+
tasks.shadowJar {
configurations = listOf(shadowMe)
- archiveClassifier.set("dev-thicc")
+ archiveClassifier.set("")
relocate("io.github.moulberry.repo", "moe.nea.firmament.deps.repo")
}
tasks.remapJar {
+ destinationDirectory.set(layout.buildDirectory.dir("badjars"))
injectAccessWidener.set(true)
inputFile.set(tasks.shadowJar.flatMap { it.archiveFile })
dependsOn(tasks.shadowJar)
- archiveClassifier.set("thicc")
+ archiveClassifier.set("dev")
}
tasks.processResources {
@@ -151,9 +176,6 @@ tasks.processResources {
filesMatching("**/fabric.mod.json") {
expand(*replacements.toTypedArray())
}
- filesMatching("**/lang/*.json") {
- // flattenJson(this)
- }
from(tasks.scanLicenses)
}