[rdct] IJPL-204792 pass additional RemDev properties via VMOptions

Do not create a new 'temp.remote-dev.properties' file every time IDE is started.

GitOrigin-RevId: 7ab936b592661a642e40fe3ad985d709157c514e
This commit is contained in:
Aleksey Pivovarov
2025-09-22 11:25:48 +00:00
committed by intellij-monorepo-bot
parent 57597e2a39
commit 9b6977158b
+8 -29
View File
@@ -38,6 +38,13 @@ impl LaunchConfiguration for RemoteDevLaunchConfiguration {
vm_options.push("-Djava.net.preferIPv4Stack=true".to_string())
}
let remote_dev_properties = self.get_remote_dev_properties()?;
for p in remote_dev_properties {
let key = p.key.as_str();
let value = p.value.as_str();
vm_options.push(format!("-D{key}={value}"));
}
if let Some(command) = self.get_args().get(0) {
match command.as_str() {
"remoteDevStatus" | "cwmHostStatus" => {
@@ -58,10 +65,7 @@ impl LaunchConfiguration for RemoteDevLaunchConfiguration {
}
fn get_custom_properties_file(&self) -> Result<PathBuf> {
let remote_dev_properties_file = self.write_merged_properties_file()
.context("Failed to write remote dev IDE properties file")?;
Ok(remote_dev_properties_file)
bail!("Custom remote dev properties are not needed");
}
fn get_class_path(&self) -> Result<Vec<String>> {
@@ -250,31 +254,6 @@ impl RemoteDevLaunchConfiguration {
Ok(result)
}
fn write_merged_properties_file(&self) -> Result<PathBuf> {
let pid = std::process::id();
let filename = format!("pid.{pid}.temp.remote-dev.properties");
let path = get_ide_temp_directory(&self.default)?.join(filename);
if let Some(dir) = path.parent() {
fs::create_dir_all(dir)
.with_context(|| format!("Failed to create to parent folder for IDE properties file at path {dir:?}"))?
}
let file = File::create(&path)?;
let mut writer = BufWriter::new(file);
let remote_dev_properties = self.get_remote_dev_properties()?;
for p in remote_dev_properties {
let key = p.key.as_str();
let value = p.value.as_str();
writeln!(&mut writer, "{key}={value}")?;
}
writer.flush()?;
Ok(path)
}
}
fn get_ide_temp_directory(default: &DefaultLaunchConfiguration) -> Result<PathBuf> {