this repo has no description

install baserom before splitting assets

+22 -8
+18 -4
src/main/java/app/Environment.java
··· 46 46 import project.ProjectListing; 47 47 import project.ProjectManager; 48 48 import project.Manifest; 49 + import project.engine.BuildException; 50 + import project.engine.Engine; 49 51 import project.ui.ProjectSwitcherDialog; 50 52 import assets.AssetExtractor; 51 53 import assets.ExpectedAsset; ··· 528 530 } 529 531 530 532 Directories.setProjectDirectory(project.getPath()); 531 - Directories.setDumpDirectory(project.getEngine().getDumpDir().getAbsolutePath()); 533 + final Engine engine = project.getEngine(); 534 + Directories.setDumpDirectory(engine.getDumpDir().getAbsolutePath()); 535 + 536 + usBaseRom = engine.getBaseRom(); 537 + if (!usBaseRom.exists()) { 538 + promptForBaserom(); 539 + if (!usBaseRom.exists()) 540 + return false; 541 + } 542 + 543 + try { 544 + engine.splitAssets(); 545 + } catch (BuildException e) { 546 + Logger.logError("Failed to split assets: " + e.getMessage()); 547 + return false; 548 + } 532 549 533 550 // Asset stack (TODO: move to Project?) 534 551 assetDirectories = new ArrayList<>(); ··· 536 553 // ...dependencies... 537 554 assetDirectories.add(Directories.ENGINE_ASSETS_US.toFile()); 538 555 539 - usBaseRom = project.getEngine().getBaseRom(); 540 - if (!usBaseRom.exists()) 541 - promptForBaserom(); 542 556 if (!ensureDumpExtracted()) { 543 557 return false; 544 558 }
+4 -4
src/main/java/project/engine/Engine.java
··· 46 46 else 47 47 checkoutRef(); 48 48 } 49 - 50 - splitAssets(); // TODO: only call when necessary i.e. git HEAD changed 51 49 } 52 50 53 51 /** ··· 141 139 buildEnv.gitCheckout(directory, ref, BuildOutputListener.toLogger()); 142 140 } 143 141 144 - public BuildResult splitAssets() throws BuildException, IOException 142 + public void splitAssets() throws BuildException, IOException 145 143 { 146 144 Logger.log("Splitting assets from ROM...", Priority.MILESTONE); 147 - return buildEnv.configure(directory, BuildOutputListener.toLogger()); 145 + BuildResult result = buildEnv.configure(directory, BuildOutputListener.toLogger()); 146 + if (!result.isSuccess()) 147 + throw new BuildException("Failed to split assets: " + result.getErrorMessage()); 148 148 } 149 149 150 150 private static boolean isGitRepo(File dir)