(&self)
| 309 | } |
| 310 | |
| 311 | fn load_project_config(&self) -> Result<ProjectConfig, Box<dyn std::error::Error>> { |
| 312 | let config_path = Path::new("rust-native.toml"); |
| 313 | if config_path.exists() { |
| 314 | let content = fs::read_to_string(config_path)?; |
| 315 | Ok(toml::from_str(&content)?) |
| 316 | } else { |
| 317 | // Default config |
| 318 | Ok(ProjectConfig { |
| 319 | name: self.detect_project_name()?, |
| 320 | target_platforms: vec![Platform::Desktop], |
| 321 | build_command: None, |
| 322 | ios_config: IOSConfig::default(), |
| 323 | android_config: AndroidConfig::default(), |
| 324 | web_config: WebConfig::default(), |
| 325 | }) |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | fn detect_project_name(&self) -> Result<String, Box<dyn std::error::Error>> { |
| 330 | let cargo_toml = fs::read_to_string("Cargo.toml")?; |
no test coverage detected