feat!: rename project from mcl/mcl-launcher to rmcl
Renames Cargo package, binary, internal path identifiers, java shim, user-agent, log filename, desktop shortcut Exec lines, and CLI program name. Wires src/migrate.rs into main() so existing users have their on-disk data (~/.config/mcl/, ~/.local/share/mcl/, ~/.cache/mcl/) moved to the new locations on first launch. BREAKING CHANGE: binary is now named rmcl. Old paths are auto-migrated.
This commit is contained in:
1 parent
2b3aa4df32
commit
ae2524f2ce
16 files changed
+96
-91
No files matched your search
@@ -14,7 +14,7 @@ pub fn desktop_path(name: &str) -> Option<PathBuf> {
|
||||
{
|
||||
dirs_next::data_dir().map(|d| {
|
||||
d.join("applications")
|
||||
.join(format!("mcl-{sanitized}.desktop"))
|
||||
.join(format!("rmcl-{sanitized}.desktop"))
|
||||
})
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ pub fn desktop_path(name: &str) -> Option<PathBuf> {
|
||||
}
|
||||
|
||||
pub fn icon_path() -> Option<PathBuf> {
|
||||
dirs_next::data_dir().map(|d| d.join("mcl").join("icon.svg"))
|
||||
dirs_next::data_dir().map(|d| d.join("rmcl").join("icon.svg"))
|
||||
}
|
||||
|
||||
// lazily writes the bundled svg icon to disk the first time a shortcut needs it
|
||||
@@ -145,7 +145,7 @@ fn build_linux_desktop(name: &str, icon: Option<&Path>) -> String {
|
||||
out.push_str("Type=Application\n");
|
||||
out.push_str(&format!("Name=Minecraft - {name}\n"));
|
||||
out.push_str(&format!("Comment=Launch {name} Minecraft instance\n"));
|
||||
out.push_str(&format!("Exec=mcl instance launch \"{name}\"\n"));
|
||||
out.push_str(&format!("Exec=rmcl instance launch \"{name}\"\n"));
|
||||
if let Some(icon) = icon {
|
||||
out.push_str(&format!("Icon={}\n", icon.display()));
|
||||
}
|
||||
@@ -159,7 +159,7 @@ fn build_windows_shortcut(name: &str) -> String {
|
||||
let mut out = String::new();
|
||||
out.push_str("@echo off\r\n");
|
||||
out.push_str(&format!("title Minecraft - {name}\r\n"));
|
||||
out.push_str(&format!("mcl instance launch \"{name}\"\r\n"));
|
||||
out.push_str(&format!("rmcl instance launch \"{name}\"\r\n"));
|
||||
out.push_str("pause\r\n");
|
||||
out
|
||||
}
|
||||
@@ -169,7 +169,7 @@ fn build_macos_command(name: &str) -> String {
|
||||
let mut out = String::new();
|
||||
out.push_str("#!/bin/bash\n");
|
||||
out.push_str(&format!("# Launch Minecraft instance: {name}\n"));
|
||||
out.push_str(&format!("mcl instance launch \"{name}\"\n"));
|
||||
out.push_str(&format!("rmcl instance launch \"{name}\"\n"));
|
||||
out
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ mod tests {
|
||||
fn build_content_linux() {
|
||||
let content = build_content("TestPack", None);
|
||||
assert!(content.contains("Name=Minecraft - TestPack"));
|
||||
assert!(content.contains("Exec=mcl instance launch \"TestPack\""));
|
||||
assert!(content.contains("Exec=rmcl instance launch \"TestPack\""));
|
||||
assert!(content.contains("Terminal=true"));
|
||||
assert!(content.contains("Categories=Game;"));
|
||||
}
|
||||
|
||||
@@ -83,17 +83,17 @@ pub async fn apply(
|
||||
|
||||
Some(LwjglifyPatches {
|
||||
jvm_args,
|
||||
main_class: "MclShim".to_string(),
|
||||
main_class: "RmclShim".to_string(),
|
||||
extra_args: vec!["com.gtnewhorizons.retrofuturabootstrap.Main".to_string()],
|
||||
})
|
||||
}
|
||||
|
||||
const SHIM_JAR: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/mcl-shim.jar"));
|
||||
const SHIM_JAR: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/rmcl-shim.jar"));
|
||||
|
||||
fn deploy_shim(minecraft_dir: &Path) -> PathBuf {
|
||||
let dest = minecraft_dir.join(".mcl-shim.jar");
|
||||
let dest = minecraft_dir.join(".rmcl-shim.jar");
|
||||
if let Err(e) = std::fs::write(&dest, SHIM_JAR) {
|
||||
tracing::warn!("Failed to write mcl-shim.jar: {e}");
|
||||
tracing::warn!("Failed to write rmcl-shim.jar: {e}");
|
||||
}
|
||||
dest
|
||||
}
|
||||
@@ -237,7 +237,7 @@ fn add_lwjgl3(lib_dir: &Path, classpath: &mut Vec<PathBuf>) {
|
||||
// recursion on java 24+. the config is written to .minecraft/ and
|
||||
// pointed to via -Dlog4j.configurationFile.
|
||||
fn write_log4j_config(minecraft_dir: &Path, jvm_args: &mut Vec<String>) {
|
||||
let config_path = minecraft_dir.join(".mcl-log4j2.xml");
|
||||
let config_path = minecraft_dir.join(".rmcl-log4j2.xml");
|
||||
let config = r#"<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="WARN">
|
||||
<Appenders>
|
||||
|
||||
@@ -148,8 +148,8 @@ mod tests {
|
||||
async fn test_vanilla_install_noop() {
|
||||
let client = HttpClient::new();
|
||||
let installer = VanillaInstaller;
|
||||
let tmp = std::env::temp_dir().join("mcl_test_vanilla_install");
|
||||
let meta = std::env::temp_dir().join("mcl_test_meta");
|
||||
let tmp = std::env::temp_dir().join("rmcl_test_vanilla_install");
|
||||
let meta = std::env::temp_dir().join("rmcl_test_meta");
|
||||
installer
|
||||
.install(&client, "1.20.1", "vanilla", &tmp, &meta)
|
||||
.await
|
||||
|
||||
@@ -319,8 +319,8 @@ mod tests {
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn test_manager() -> (InstanceManager, PathBuf) {
|
||||
let tmp = std::env::temp_dir().join(format!("mcl_test_{}", uuid_like()));
|
||||
let meta = std::env::temp_dir().join(format!("mcl_meta_test_{}", uuid_like()));
|
||||
let tmp = std::env::temp_dir().join(format!("rmcl_test_{}", uuid_like()));
|
||||
let meta = std::env::temp_dir().join(format!("rmcl_meta_test_{}", uuid_like()));
|
||||
std::fs::create_dir_all(&tmp).ok();
|
||||
std::fs::create_dir_all(&meta).ok();
|
||||
(InstanceManager::new(tmp.clone(), meta), tmp)
|
||||
|
||||
Reference in new issue
Block a user