|
1 | 1 | use crate::logging::ask_value; |
2 | 2 | use crate::mod_file::{PlatformName, ToGeodeString}; |
3 | | -use crate::util::mod_file::DependencyImportance; |
| 3 | +use crate::util::mod_file::{DependencyImportance, GDVersion}; |
4 | 4 | use crate::{done, fail, fatal, index, info, warn, NiceUnwrap}; |
5 | 5 | use crate::{ |
6 | 6 | file::read_dir_recursive, |
@@ -270,6 +270,39 @@ pub fn check_dependencies( |
270 | 270 |
|
271 | 271 | let mod_info = parse_mod_info(&input); |
272 | 272 |
|
| 273 | + let platform = platform.unwrap_or_else(|| { |
| 274 | + PlatformName::current().nice_unwrap("Unknown platform, please specify one with --platform") |
| 275 | + }); |
| 276 | + |
| 277 | + // Check if platform is supported |
| 278 | + match mod_info.gd { |
| 279 | + GDVersion::Simple(_) => {} |
| 280 | + GDVersion::Detailed(gd) => { |
| 281 | + match platform { |
| 282 | + PlatformName::Windows => { |
| 283 | + if gd.win.is_none() { |
| 284 | + fatal!("Geometry Dash version not specified for Windows, please specify one in mod.json"); |
| 285 | + } |
| 286 | + } |
| 287 | + PlatformName::MacOS | PlatformName::MacArm | PlatformName::MacIntel => { |
| 288 | + if gd.mac.is_none() { |
| 289 | + fatal!("Geometry Dash version not specified for macOS, please specify one in mod.json"); |
| 290 | + } |
| 291 | + } |
| 292 | + PlatformName::Android | PlatformName::Android32 | PlatformName::Android64 => { |
| 293 | + if gd.android.is_none() { |
| 294 | + fatal!("Geometry Dash version not specified for Android, please specify one in mod.json"); |
| 295 | + } |
| 296 | + } |
| 297 | + PlatformName::IOS => { |
| 298 | + if gd.ios.is_none() { |
| 299 | + fatal!("Geometry Dash version not specified for iOS, please specify one in mod.json"); |
| 300 | + } |
| 301 | + } |
| 302 | + } |
| 303 | + } |
| 304 | + } |
| 305 | + |
273 | 306 | // If no dependencies, skippy wippy |
274 | 307 | if mod_info.dependencies.is_empty() { |
275 | 308 | return; |
@@ -300,10 +333,6 @@ pub fn check_dependencies( |
300 | 333 | let dep_dir = output.join("geode-deps"); |
301 | 334 | fs::create_dir_all(&dep_dir).nice_unwrap("Unable to create dependency directory"); |
302 | 335 |
|
303 | | - let platform = platform.unwrap_or_else(|| { |
304 | | - PlatformName::current().nice_unwrap("Unknown platform, please specify one with --platform") |
305 | | - }); |
306 | | - |
307 | 336 | // check all dependencies |
308 | 337 | for dep in &mod_info.dependencies { |
309 | 338 | let mut platforms = dep.platforms.clone(); |
|
0 commit comments