Skip to content

Commit 0aba6aa

Browse files
committed
Release: Remotely 2.0.0-beta.2
1 parent a6f5c9f commit 0aba6aa

14 files changed

Lines changed: 90 additions & 18 deletions

File tree

RemotelyMod/build.gradle.kts

Lines changed: 78 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1+
import dev.deftu.gradle.utils.ModLoader
12
import dev.deftu.gradle.utils.version.MinecraftVersions
23
import dev.deftu.gradle.utils.includeOrShade
4+
import org.gradle.jvm.tasks.Jar
5+
import java.util.Properties
36

47
plugins {
58
java
69
kotlin("jvm")
7-
id("dev.deftu.gradle.multiversion") // Applies preprocessing for multiple versions of Minecraft and/or multiple mod loaders.
8-
id("dev.deftu.gradle.tools") // Applies several configurations to things such as the Java version, project name/version, etc.
9-
id("dev.deftu.gradle.tools.resources") // Applies resource processing so that we can replace tokens, such as our mod name/version, in our resources.
10-
id("dev.deftu.gradle.tools.bloom") // Applies the Bloom plugin, which allows us to replace tokens in our source files, such as being able to use `@MOD_VERSION` in our source files.
11-
id("dev.deftu.gradle.tools.shadow") // Applies the Shadow plugin, which allows us to shade our dependencies into our mod JAR. This is NOT recommended for Fabric mods, but we have an *additional* configuration for those!
12-
id("dev.deftu.gradle.tools.minecraft.loom") // Applies the Loom plugin, which automagically configures Essential's Architectury Loom plugin for you.
13-
id("dev.deftu.gradle.tools.minecraft.releases-v2") // Applies the Minecraft auto-releasing plugin, which allows you to automatically release your mod to CurseForge and Modrinth.
10+
id("dev.deftu.gradle.multiversion")
11+
id("dev.deftu.gradle.tools")
12+
id("dev.deftu.gradle.tools.resources")
13+
id("dev.deftu.gradle.tools.bloom")
14+
id("dev.deftu.gradle.tools.shadow")
15+
id("dev.deftu.gradle.tools.minecraft.loom")
16+
id("com.hypherionmc.modutils.modpublisher") version "2.1.8"
1417
}
1518

1619
toolkitMultiversion {
@@ -36,10 +39,12 @@ toolkitLoomHelper {
3639

3740
repositories {
3841
mavenCentral()
42+
gradlePluginPortal()
3943
maven("https://maven.neoforged.net/releases/")
4044
maven("https://maven.terraformersmc.com/")
4145
maven("https://maven.nucleoid.xyz/")
4246
maven("https://packages.jetbrains.team/maven/p/ij/intellij-dependencies")
47+
maven("https://maven.firstdark.dev/releases")
4348

4449
flatDir {
4550
dirs(rootProject.file("libs"))
@@ -121,4 +126,70 @@ tasks {
121126
relocate("dev.deftu.omnicore", "${modData.group}.dependencies.omnicore")
122127
}
123128
}
129+
130+
configureEach {
131+
val taskName = name.lowercase()
132+
if (taskName.contains("publish") && (taskName.contains("modrinth") || taskName.contains("curse") || taskName.contains("github"))) {
133+
mustRunAfter(project.tasks.named("build"))
134+
}
135+
}
136+
}
137+
138+
139+
publisher {
140+
141+
apiKeys {
142+
val properties = Properties().apply {
143+
val envFile = rootProject.file("env.properties")
144+
if (envFile.exists()) {
145+
envFile.inputStream().use { fis ->
146+
load(fis)
147+
}
148+
}
149+
}
150+
151+
val modrinthToken = properties.getProperty("MODRINTH_TOKEN", System.getenv("MODRINTH_TOKEN"))
152+
val curseToken = properties.getProperty("CURSEFORGE_TOKEN", System.getenv("CURSEFORGE_TOKEN"))
153+
154+
fun configurePublishing(token: String?, serviceName: String, config: (String) -> Unit) {
155+
if (token != null) {
156+
config(token)
157+
if (token.isNotBlank()) {
158+
println("$serviceName publishing enabled.")
159+
} else {
160+
println("$serviceName publishing disabled. No API key found (blank).")
161+
}
162+
} else {
163+
println("$serviceName publishing disabled. No API key found (null)")
164+
}
165+
}
166+
167+
configurePublishing(modrinthToken, "Modrinth") { modrinth(it) }
168+
configurePublishing(curseToken, "CurseForge") { curseforge(it) }
169+
170+
curseID.set("1224352")
171+
modrinthID.set("remotely")
172+
173+
projectVersion.set(modData.version)
174+
175+
displayName.set("Remotely ${modData.version} (${if (mcData.isFabric) "Fabric" else "NeoForge"} ${mcData.version})")
176+
177+
gameVersions.set(listOf(mcData.version.toString()))
178+
179+
val currentLoader = when {
180+
mcData.isFabric -> "fabric"
181+
mcData.isNeoForge -> "neoforge"
182+
else -> "forge"
183+
}
184+
loaders.set(listOf(currentLoader))
185+
186+
versionType.set("beta")
187+
188+
val targetTask = tasks.named<Jar>("remapJar")
189+
190+
artifact.set(targetTask.flatMap { it.archiveFile })
191+
192+
changelog.set("First Beta Release of Remotely 2.0.0!")
193+
disableEmptyJarCheck.set(true)
194+
}
124195
}

RemotelyMod/gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mod.name=Remotely
44
# Your mod's ID, which is used in the mod's metadata and for identifying the mod in the game. Must be unique from other mods.
55
mod.id=remotely
66
# The version of your mod, which is used in the mod's metadata and for version checks.
7-
mod.version=2.0.0a
7+
mod.version=2.0.0-beta.1
88
# The Maven group ID for your mod, which is used in the mod's metadata and for dependency management.
99
mod.group=redxax.oxy.remotely
1010
######################
@@ -25,6 +25,7 @@ dgt.minecraft.revision=3
2525
# Adjust memory settings as needed based on your system's capabilities.
2626
# If you're supporting the template's full version range, do not reduce these values any further, they're already quite low.
2727
org.gradle.jvmargs=-Xmx6144m -Dfile.encoding=UTF-8
28+
#org.gradle.workers.max=1
2829
org.gradle.configureondemand=true
2930
############################
3031

RemotelyMod/libs/ReScreen-1.0.jar

0 Bytes
Binary file not shown.
10 Bytes
Binary file not shown.

RemotelyMod/libs/Remotely-App.jar

437 Bytes
Binary file not shown.

RemotelyMod/settings.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pluginManagement {
99
maven("https://maven.minecraftforge.net")
1010
maven("https://repo.essential.gg/repository/maven-public")
1111
maven("https://jitpack.io/")
12+
maven("https://maven.firstdark.dev/releases/")
1213

1314
// Snapshots
1415
maven("https://maven.deftu.dev/snapshots")
@@ -23,6 +24,7 @@ pluginManagement {
2324
plugins {
2425
kotlin("jvm") version("2.2.10")
2526
id("dev.deftu.gradle.multiversion-root") version("2.69.0")
27+
id("com.hypherionmc.modutils.modpublisher") version "2.1.8"
2628
}
2729
}
2830

RemotelyMod/src/main/resources/META-INF/mods.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ license="Custom License"
77
modId="${mod_id}"
88
version="${mod_version}"
99
displayName="${mod_name}"
10-
authors="RedxAx, DumbFridge"
10+
authors="RedxAx"
1111
description="${mod_description}"
12-
logoFile="assets/remotely/Reemotely.png"
12+
logoFile="assets/Remotely.png"
1313

1414
[[dependencies.${mod_id}]]
1515
modId="forge"

RemotelyMod/src/main/resources/META-INF/neoforge.mods.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ config = "mixins.${mod_id}.json"
1010
modId="${mod_id}"
1111
version="${mod_version}"
1212
displayName="${mod_name}"
13-
authors="RedxAx, DumbFridge"
13+
authors="RedxAx"
1414
description="${mod_description}"
15-
logoFile="assets/remotely/Reemotely.png"
15+
logoFile="assets/Remotely.png"
1616

1717
[[dependencies.${mod_id}]]
1818
modId="neoforge"

RemotelyMod/src/main/resources/fabric.mod.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
"name": "${mod_name}",
66
"description": "${mod_description}",
77
"authors": [
8-
"RedxAx",
9-
"DumbFridge"
8+
"RedxAx"
109
],
1110
"contact": {
1211
"issues": "https://github.com/RedxAx/Remotely/issues",
1312
"sources": "https://github.com/RedxAx/Remotely"
1413
},
1514
"license": "Custom License",
16-
"icon": "assets/remotely/Reemotely.png",
15+
"icon": "assets/Remotely.png",
1716
"environment": "*",
1817
"entrypoints": {
1918
"main": [

RemotelyMod/src/main/resources/mcmod.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"version": "${mod_version}",
66
"mcversion": "${mc_version}",
77
"description": "${mod_description}",
8-
"authorList": ["RedxAx", "DumbFridge"],
8+
"authorList": ["RedxAx"],
99
"dependencies": ["textile", "omnicore"]
1010
}
1111
]

0 commit comments

Comments
 (0)