Skip to content

Commit 0424fd0

Browse files
committed
Feat: Remotely 2.3.0.
1 parent d11c33f commit 0424fd0

7 files changed

Lines changed: 69 additions & 91 deletions

File tree

RemotelyMod/build-logic/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ gradlePlugin {
2929

3030
dependencies {
3131
compileOnly("com.github.johnrengelman:shadow:8.1.1")
32-
compileOnly("com.hypherionmc.modutils:modpublisher:2.1.8")
32+
implementation("com.hypherionmc.modutils:modpublisher:2.1.8")
3333
implementation("net.neoforged:moddev-gradle:2.0.141")
3434
}

RemotelyMod/build-logic/src/main/kotlin/redxax/remotelymod/buildlogic/RemotelyModBuildLogic.kt

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -363,18 +363,12 @@ private fun Project.configureResources() {
363363
private fun Project.configurePublishingGuard() {
364364
val requestedTasks = gradle.startParameter.taskNames.map { it.lowercase() }
365365
val publishingRequested = requestedTasks.any {
366-
val taskName = it.lowercase()
367-
taskName.contains("publish") || taskName.contains("modrinth") || taskName.contains("curse") || taskName.contains("github") || taskName.contains("nightbloom")
366+
val taskName = it.substringAfterLast(":")
367+
taskName.startsWith("publish") || taskName.contains("modrinth") || taskName.contains("curse") || taskName.contains("github") || taskName.contains("nightbloom")
368368
}
369369
if (!publishingRequested) {
370370
return
371371
}
372-
val publishingAllowed = rootProject.findProperty("remotely.allowPublish")?.toString()?.toBooleanStrictOrNull()
373-
?: findProperty("remotely.allowPublish")?.toString()?.toBooleanStrictOrNull()
374-
?: false
375-
if (!publishingAllowed) {
376-
throw GradleException("Publishing is disabled. Re-run with -Premotely.allowPublish=true to enable publishing tasks.")
377-
}
378372
pluginManager.apply("com.hypherionmc.modutils.modpublisher")
379373
pluginManager.withPlugin("com.hypherionmc.modutils.modpublisher") {
380374
extensions.configure(ModPublisherGradleExtension::class.java, action<ModPublisherGradleExtension> { publisher ->
@@ -425,14 +419,12 @@ private fun Project.publishingProperties(): Properties {
425419
}
426420
}
427421

428-
private fun Project.publishingArtifact() = tasks.named(publishingArtifactTaskName(), AbstractArchiveTask::class.java)
429-
.flatMap { task -> task.archiveFile }
430-
431-
private fun Project.publishingArtifactTaskName(): String {
432-
return when {
433-
loader() == "fabric" && isDropVersion() -> "jar"
434-
loader() == "neoforge" -> "jar"
435-
else -> "remapJar"
422+
private fun Project.publishingArtifact() = rootProject.layout.buildDirectory.file("versions/Remotely-${modVersion()}+$name.jar").also { artifact ->
423+
gradle.taskGraph.whenReady {
424+
val file = artifact.get().asFile
425+
if (!file.isFile) {
426+
throw GradleException("Publishing artifact is missing: ${file.absolutePath}. Run buildAllVersions before publishing.")
427+
}
436428
}
437429
}
438430

@@ -512,6 +504,7 @@ private fun Project.configureNeoForgeModDev() {
512504
task.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
513505
task.into(layout.buildDirectory.dir("classes/java/main"))
514506
task.exclude("META-INF/MANIFEST.MF", "META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA")
507+
task.exclude("com/pty4j/**", "com/jediterm/**", "org/jetbrains/jediterm/**")
515508
})
516509

517510
extensions.configure(NeoForgeExtension::class.java, action<NeoForgeExtension> { extension ->
@@ -886,16 +879,37 @@ private fun shouldCoalesceNeoForgeClass(jar: File, name: String, outerPackages:
886879
return false
887880
}
888881
val classPackage = classPackage(name) ?: return false
882+
if (jar.name == "Remotely-App.jar") {
883+
return true
884+
}
889885
return classPackage in outerPackages
890886
}
891887

892888
private fun shouldDropNestedJarEntry(jar: File, name: String): Boolean {
889+
if (jar.name == "Rebase-1.0-SNAPSHOT.jar" && isRebaseEmbeddedTerminalLibrary(name)) {
890+
return true
891+
}
892+
if (jar.name == "jediterm-pty-2.69.jar" && isJeditermCorePackage(name)) {
893+
return true
894+
}
893895
if (jar.name == "ReScreen-1.0.jar" && isReScreenConflictingResource(name)) {
894896
return true
895897
}
896898
return jar.name == "Remotely-App.jar" && isRemotelyMonoAsset(name)
897899
}
898900

901+
private fun isRebaseEmbeddedTerminalLibrary(name: String): Boolean {
902+
return name.startsWith("com/pty4j/")
903+
|| name.startsWith("com/jediterm/")
904+
|| name.startsWith("org/jetbrains/jediterm/")
905+
}
906+
907+
private fun isJeditermCorePackage(name: String): Boolean {
908+
return name.startsWith("com/jediterm/terminal/")
909+
&& !name.startsWith("com/jediterm/terminal/debug/")
910+
&& !name.startsWith("com/jediterm/terminal/ui/")
911+
}
912+
899913
private fun isReScreenConflictingResource(name: String): Boolean {
900914
return name.startsWith("assets/minecraft/")
901915
|| name.startsWith("assets/twemoji/")

RemotelyMod/gradle.properties

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,31 @@
1-
### Mod Properties ###
2-
# The name used to produce your mod's JAR file, also appearing in Bloom processed files and the mod's metadata.
31
mod.name=Remotely
4-
# 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.
52
mod.id=remotely
6-
# The version of your mod, which is used in the mod's metadata and for version checks.
7-
mod.version=2.2.1
8-
# The Maven group ID for your mod, which is used in the mod's metadata and for dependency management.
93
mod.group=redxax.oxy.remotely
10-
######################
4+
remotely.publish.changelog=### Remotely Changes:\n\
5+
- Feat: Node Families Exposes Modes In Node Search.\n\
6+
- Fix: Various Stuff.\n\
7+
- Feat: Flow Editor UI/UX Improvements.\n\
8+
- Feat: Custom Plan Configuration.\n\
9+
- Fix: ESC Key Handling.\n\
10+
- Feat: ReProxy.\n\
11+
- Feat(RemotelyMod): Floating Windows, Some Fixes.\n\
12+
- Fix: Rewrite Gradle Structure Again.\n\
13+
### Rebase Changes:\n\
14+
- Fix: ESC Key Handling.\n\
15+
- Feat: ReProxy.\n\
16+
- Feat(RemotelyMod): Floating Windows, Some Fixes.\n\
17+
- Feat: Disable Animations Option.\n\
18+
- Feat(Relaunched): Import-Launcher, Java JRE Polishments, And More.\n\
19+
- Fix: Relaunched Minecraft Account Persistence.\n\
20+
### ReScreen Changes:\n\
21+
- Feat(RemotelyMod): Floating Windows, Some Fixes.\n\
22+
- Feat: Disable Animations Option.\n\
23+
- Fix: Edge-Cases Where Desktop Animations Break.
1124

12-
### DGT Configuration ###
13-
# Switches the mappings for all our versions to use MCP and mojmap.
1425
dgt.loom.mappings=official-like
15-
# Sets the DGT automatic Minecraft dependency list to revision 3. Update this to latest if you want to use the latest recommended versions of libraries.
1626
dgt.minecraft.revision=3
17-
#########################
1827

19-
#####################################################################################
20-
### DO NOT EDIT THE PROPERTIES BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ###
21-
#####################################################################################
22-
23-
### Gradle Configuration ###
24-
# Sets JVM arguments for Gradle to improve performance and stability.
25-
# Adjust memory settings as needed based on your system's capabilities.
26-
# If you're supporting the template's full version range, do not reduce these values any further, they're already quite low.
2728
org.gradle.jvmargs=-Xmx6144m -Dfile.encoding=UTF-8
28-
#org.gradle.workers.max=1
2929
org.gradle.configureondemand=true
30-
############################
3130

32-
### Loom Configuration ###
33-
# Allows us to use dependencies built with newer Loom by ignoring that it was built against a differing Loom version.
34-
# This is absolutely necessary because we use an older fork of Loom to enable Legacy Forge support.
35-
# As far as can be seen, there are absolutely no negative side effects to doing this. If you encounter any,
36-
# feel free to report them to the template's issue tracker and comment this line out to see if it resolves them.
37-
# You won't be able to use any dependencies built by newer Loom without this line, however.
3831
loom.ignoreDependencyLoomVersionValidation=true
39-
##########################

RemotelyMod/root.gradle.kts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,23 @@ fun registerBuildAggregate(name: String, descriptionText: String, loader: String
3333
}
3434

3535
fun registerPublishAggregate(name: String, descriptionText: String, taskName: String, loader: String? = null) {
36+
val projects = versionProjects(loader)
3637
tasks.register(name) {
3738
group = "publishing"
3839
description = descriptionText
39-
dependsOn(versionProjects(loader).mapNotNull { project ->
40-
project.tasks.findByName(taskName)?.let { project.tasks.named(taskName) }
41-
})
40+
dependsOn(projects.map { project -> "${project.path}:$taskName" })
4241
}
4342
}
4443

4544
registerBuildAggregate("buildAllVersions", "Builds every enabled RemotelyMod version.")
4645
registerBuildAggregate("buildAllFabric", "Builds every enabled Fabric RemotelyMod version.", "fabric")
4746
registerBuildAggregate("buildAllNeoForge", "Builds every enabled NeoForge RemotelyMod version.", "neoforge")
4847

49-
gradle.projectsEvaluated {
50-
registerPublishAggregate("publishAllVersions", "Publishes every enabled RemotelyMod version.", "publishMod")
51-
registerPublishAggregate("publishAllFabric", "Publishes every enabled Fabric RemotelyMod version.", "publishMod", "fabric")
52-
registerPublishAggregate("publishAllNeoForge", "Publishes every enabled NeoForge RemotelyMod version.", "publishMod", "neoforge")
53-
registerPublishAggregate("publishAllVersionsToModrinth", "Publishes every enabled RemotelyMod version to Modrinth.", "publishModrinth")
54-
registerPublishAggregate("publishAllVersionsToCurseForge", "Publishes every enabled RemotelyMod version to CurseForge.", "publishCurseforge")
55-
}
48+
registerPublishAggregate("publishAllVersions", "Publishes every enabled RemotelyMod version.", "publishMod")
49+
registerPublishAggregate("publishAllFabric", "Publishes every enabled Fabric RemotelyMod version.", "publishMod", "fabric")
50+
registerPublishAggregate("publishAllNeoForge", "Publishes every enabled NeoForge RemotelyMod version.", "publishMod", "neoforge")
51+
registerPublishAggregate("publishAllVersionsToModrinth", "Publishes every enabled RemotelyMod version to Modrinth.", "publishModrinth")
52+
registerPublishAggregate("publishAllVersionsToCurseForge", "Publishes every enabled RemotelyMod version to CurseForge.", "publishCurseforge")
5653

5754
preprocess {
5855
strictExtraMappings.set(true)

RemotelyMod/settings.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import groovy.lang.MissingPropertyException
2+
import java.util.Properties
23

34
pluginManagement {
45
includeBuild("build-logic")
@@ -36,8 +37,16 @@ plugins {
3637
}
3738

3839
val dropFabricProjectPattern = Regex("""^\d{2,}\.\d+(?:\.\d+)?(?:-(?:snapshot|pre|rc)-\d+)?-fabric$""")
40+
val remotelyAppProperties = Properties().apply {
41+
file("../gradle.properties").inputStream().use(::load)
42+
}
43+
val remotelyVersion = remotelyAppProperties.getProperty("remotely.version")
44+
?: throw MissingPropertyException("remotely.version has not been set.")
3945

4046
gradle.beforeProject {
47+
extensions.extraProperties["remotely.version"] = remotelyVersion
48+
extensions.extraProperties["mod.version"] = remotelyVersion
49+
4150
if (dropFabricProjectPattern.matches(name)) {
4251
extensions.extraProperties["fabric.loom.disableObfuscation"] = "true"
4352
extensions.extraProperties["dgt.loom.mappings.use"] = "false"

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
}
88

99
group = "redxax.oxy"
10-
version = "2.2.1"
10+
version = property("remotely.version").toString()
1111

1212
application {
1313
mainClass.set("redxax.oxy.remotely.RemotelyInit")

gradle.properties

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,6 @@
1-
### Mod Properties ###
2-
# The name used to produce your mod's JAR file, also appearing in Bloom processed files and the mod's metadata.
3-
mod.name=Remotely
4-
# 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.
5-
mod.id=remotely
6-
# The version of your mod, which is used in the mod's metadata and for version checks.
7-
mod.version=2.2.1
8-
# The Maven group ID for your mod, which is used in the mod's metadata and for dependency management.
9-
mod.group=redxax.oxy.remotely
10-
######################
1+
remotely.version=2.3.0
112

12-
### DGT Configuration ###
13-
# Switches the mappings for all our versions to use MCP and mojmap.
14-
dgt.loom.mappings=official-like
15-
# Sets the DGT automatic Minecraft dependency list to revision 3. Update this to latest if you want to use the latest recommended versions of libraries.
16-
dgt.minecraft.revision=3
17-
#########################
18-
19-
#####################################################################################
20-
### DO NOT EDIT THE PROPERTIES BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ###
21-
#####################################################################################
22-
23-
### Gradle Configuration ###
24-
# Sets JVM arguments for Gradle to improve performance and stability.
25-
# Adjust memory settings as needed based on your system's capabilities.
26-
# If you're supporting the template's full version range, do not reduce these values any further, they're already quite low.
273
org.gradle.jvmargs=-Xmx6144m -Dfile.encoding=UTF-8
284
org.gradle.parallel=true
295
org.gradle.workers.max=6
306
org.gradle.configureondemand=true
31-
############################
32-
33-
### Loom Configuration ###
34-
# Allows us to use dependencies built with newer Loom by ignoring that it was built against a differing Loom version.
35-
# This is absolutely necessary because we use an older fork of Loom to enable Legacy Forge support.
36-
# As far as can be seen, there are absolutely no negative side effects to doing this. If you encounter any,
37-
# feel free to report them to the template's issue tracker and comment this line out to see if it resolves them.
38-
# You won't be able to use any dependencies built by newer Loom without this line, however.
39-
loom.ignoreDependencyLoomVersionValidation=true
40-
##########################

0 commit comments

Comments
 (0)