Ejemplo n.º 1
0
        private void BuildGlobal(GUIElementData stepData)
        {
            RunExecutableArguments args = new RunExecutableArguments(StaticPaths.WrathEdPath)
            {
                Args = $"\"{StaticPaths.ConvertNameToGlobalXmlPath(BuildHelper.BuildTarget)}\" /dr:\"{StaticPaths.ConvertNameToXmlDataPath(BuildHelper.BuildTarget)}\" /iod:\"{StaticPaths.BuiltIntermediatePath}\" /od:\"{StaticPaths.ConvertNameToBuiltOutputDataPath(this["game"], BuildHelper.BuildTarget)}\" /ls:{!(bool)_currentGuiData["linked"]} /gui:false /pc:true /vf:true /ss:true /tl:9 /el:0"
            };

            BuildHelper.RunStep(StepType.RunExecutable, args);
        }
Ejemplo n.º 2
0
        private void BuildStaticLow(GUIElementData stepData)
        {
            RunExecutableArguments args = new RunExecutableArguments(StaticPaths.WrathEdPath)
            {
                // TODO:
                Args = $"\"{StaticPaths.ConvertNameToStaticXmlPath(BuildHelper.BuildTarget)}\" /dr:\"{StaticPaths.ConvertNameToXmlDataPath(BuildHelper.BuildTarget)}\" /iod:\"{StaticPaths.BuiltIntermediatePath}\" /od:\"{StaticPaths.ConvertNameToBuiltOutputDataPath(this["game"], BuildHelper.BuildTarget)}\" /ls:{!(bool)_currentGuiData["linked"]} /gui:false /pc:true /vf:false /ss:true /tl:9 /el:0 /bcn:LowLOD /bps:\"{StaticPaths.BuiltPath}\\static.manifest\" /art:\".\\Art\" /data:\".;.\\Mods\""
            };

            BuildHelper.RunStep(StepType.RunExecutable, args);
        }
Ejemplo n.º 3
0
        private void executeModBuildStep(int stepId)
        {
            string ModFix;

            switch (stepId)
            {
            case 1:
                BuildHelper.DisplayLine(String.Format("Step {0}: Clearing built mod",
                                                      stepId));
                RunExecutableArguments clearMod = new RunExecutableArguments(Cmd);
                clearMod.Arguments = String.Format("/C (@echo off) & (cd /D \"{0}\")"
                                                   + " & (for /R \"{1}\" %I in (\"*.*\") do ("
                                                   + "(if not \"%~xI\" == \".asset\" (del \"%I\" /F /Q))"
                                                   + "))",
                                                   SDKDirectory, BuiltModPath);
                BuildHelper.RunStep(StepType.RunExecutable, clearMod);
                break;

            case 2:
                BuildHelper.DisplayLine(String.Format("Step {0}: Clearing cache",
                                                      stepId));
                RunExecutableArguments clearCache = new RunExecutableArguments(Cmd);
                clearCache.Arguments = String.Format("/C (@echo off) & (cd /D \"{0}\")"
                                                     + " & (if exist \"{1}\\builtmods\" (rd \"{1}\\builtmods\" /S /Q))"
                                                     + " & (for /R \"{2}\" %I in (\"*.asset\") do (del \"%I\" /F /Q))"
                                                     + " & (if exist \"{1}\\stringhashes.xml\" (del \"{1}\\stringhashes.xml\" /F /Q))",
                                                     SDKDirectory, BuiltModsPath, BuiltModPath);
                BuildHelper.RunStep(StepType.RunExecutable, clearCache);
                break;

            case 3:
                BuildHelper.DisplayLine(String.Format("Step {0}: Building global data",
                                                      stepId));
                RunExecutableArguments argsGlobal = new RunExecutableArguments(Cmd);
                argsGlobal.Arguments = String.Format("/C (@echo off) & (cd /D \"{0}\")"
                                                     + " & (for /R \"{1}\\additionalmaps\" %I in (\"mapmetadata_*\") do ("
                                                     + "(del \"%I\" /F /Q)"
                                                     + " & (if exist \"%~dpnI\" ("
                                                     + "(cd /D \"%~dpnI\")"
                                                     + " & (for /R %J in (\"*.cdata\") do (del \"%J\" /F /Q))"
                                                     + " & (cd /D \"{0}\")"
                                                     + "))"
                                                     + "))"
                                                     + " & (for /R \"{3}\\additionalmaps\" %I in (\"mapmetadata_*.xml\") do ("
                                                     + "(\"{2}\" \"%I\" /od:\"{4}\" /iod:\"{4}\" /ls:true /pc:true /audio:\".\\mods\\{5}\\audio;.\\audio\" /art:\".\\mods\\{5}\\art;.\\art\" /data:\".;.\\mods;.\\mods\\{5}\\data;.\\cnc3xml\")"
                                                     + "))",
                                                     SDKDirectory, BuiltModDataPath, BinaryAssetBuilder, ModDataPath, BuiltModsPath, Mod);
                BuildHelper.RunStep(StepType.RunExecutable, argsGlobal);
                break;

            case 4:
                BuildHelper.DisplayLine(String.Format("Step {0}: Building static data",
                                                      stepId));
                RunExecutableArguments args = new RunExecutableArguments(Cmd);
                args.Arguments = String.Format("/C (@echo off) & (cd /D \"{0}\")"
                                               + " & (if exist \"{1}\\mod.bin\" (del \"{1}\\mod.bin\" /F /Q))"
                                               + " & (if exist \"{1}\\mod.imp\" (del \"{1}\\mod.imp\" /F /Q))"
                                               + " & (if exist \"{1}\\mod.manifest\" (del \"{1}\\mod.manifest\" /F /Q))"
                                               + " & (if exist \"{1}\\mod.relo\" (del \"{1}\\mod.relo\" /F /Q))"
                                               + " & (if exist \"{1}\\mod.version\" (del \"{1}\\mod.version\" /F /Q))"
                                               + " & (for /R \"{1}\\mod\" %I in (\"*.cdata\") do (del \"%I\" /F /Q))"
                                               + " & (for /R \"{1}\" %I in (\"mod_*\") do ("
                                               + "(del \"%I\" /F /Q)"
                                               + " & (if exist \"%~dpnI\" ("
                                               + "(cd /D \"%~dpnI\")"
                                               + " & (for /R %J in (\"*.cdata\") do (del \"%J\" /F /Q))"
                                               + " & (cd /D \"{0}\")"
                                               + "))"
                                               + "))"
                                               + " & (\"{2}\" \"{3}\" /od:\"{4}\" /iod:\"{4}\" /ls:true /pc:true /audio:\".\\mods\\{5}\\audio;.\\audio\" /art:\".\\mods\\{5}\\art;.\\art\" /data:\".;.\\mods;.\\mods\\{5}\\data;.\\cnc3xml\")"
                                               + " & (\"{6}\" \"{1}\\mod.manifest\")"
                                               + " & (copy \"{4}\\cnc3xml\\worldbuilder.manifest\" \"{1}\\worldbuilder.manifest\" /Y)"
                                               + " & (\"{7}\" -m \"{1}\\mod.manifest\" -s mod)"
                                               + " & (if exist \"{1}\\worldbuilder.manifest\" (del \"{1}\\worldbuilder.manifest\" /F /Q))"
                                               + " & (\"{8}\" \"{1}\\mod.manifest\")",
                                               SDKDirectory, BuiltModDataPath, BinaryAssetBuilder, ModXml, BuiltModsPath, Mod, HashFix, AssetResolver, LoDStreamBuilder);
                BuildHelper.RunStep(StepType.RunExecutable, args);
                break;

            case 5:
                BuildHelper.DisplayLine(String.Format("Step {0}: Copying additional files",
                                                      stepId));
                RunExecutableArguments argsCopyFiles = new RunExecutableArguments(Cmd);
                argsCopyFiles.Arguments = String.Format("/C (@echo off) & (cd /D \"{0}\")",
                                                        SDKDirectory);

                if (Directory.Exists(ModAdditionalFilesPath))
                {
                    CopyFolders(ModAdditionalFilesPath, BuiltModPath);
                }

                BuildHelper.RunStep(StepType.RunExecutable, argsCopyFiles);
                break;

            case 6:
                BuildHelper.DisplayLine(String.Format("Step {0}: Creating big and skudef file",
                                                      stepId));
                RunExecutableArguments argsBigSkudef = new RunExecutableArguments(Cmd);
                argsBigSkudef.Arguments = String.Format("/C (@echo off) & (cd /D \"{0}\")"
                                                        + " & (\"{1}\" -f \"{2}\" -x:*.asset -o:\"{3}\\{4}\")"
                                                        + " & (if exist \"{3}\\{5}\" (del \"{3}\\{5}\" /F /Q))"
                                                        + " & (cd /D \"{3}\")"
                                                        + " & (echo mod-game {6}>\"{5}\")"
                                                        + " & (echo add-big {4}>>\"{5}\")",
                                                        SDKDirectory, MakeBig, BuiltModPath, ModInstallPath, ModBig, ModSkudef, (string)currentGUIData["gameversion"]);
                BuildHelper.RunStep(StepType.RunExecutable, argsBigSkudef);
                break;

            default:
                // unknown build step, this is probably the end
                onStepSuccess(-1);
                break;
            }
        }