Exemple #1
0
        public virtual string GetParamOrConfigString(string StringKey, string EmptyStringWarningMessage = "", string DefaultValue = "", bool bCheckForEmpty = true)
        {
#if UNITY_EDITOR
            if (bIsDrawingInspector && EmptyStringWarningMessage != "")
            {
                LogError("Don't call this from within a DrawJobInspectorAndGetEnabledParams implementation!  This isn't accessing the right job config value since it hasn't been saved to disk yet.");
            }
#endif // UNITY_EDITOR

            string StringValue = DefaultValue;

            if (IgorJobConfig.IsStringParamSet(StringKey))
            {
                StringValue = IgorJobConfig.GetStringParam(StringKey);
            }
            else
            {
                StringValue = IgorConfig.GetModuleString(this, StringKey);
            }

            if (StringValue == DefaultValue && bCheckForEmpty && EmptyStringWarningMessage != "")
            {
                LogWarning(EmptyStringWarningMessage);
            }

            if (StringValue == "")
            {
                StringValue = DefaultValue;
            }

            return(StringValue);
        }
Exemple #2
0
        public static void CheckForNamedJobFlag()
        {
            if (IgorJobConfig.IsStringParamSet(NamedJobFlag))
            {
                string JobToStart = IgorJobConfig.GetStringParam(NamedJobFlag);

                foreach (IgorPersistentJobConfig Job in IgorConfig.GetInstance().JobConfigs)
                {
                    if (Job.JobName == JobToStart)
                    {
                        IgorJobConfig ConfigInst = IgorJobConfig.GetConfig();

                        ConfigInst.Persistent = Job;

                        ConfigInst.Save(IgorJobConfig.IgorJobConfigPath);

                        IgorDebug.CoreLog("Starting named job " + JobToStart + ".");

                        return;
                    }
                }

                IgorDebug.CoreLogError("Couldn't find named job " + JobToStart + "!");
            }
        }
 public override void ProcessArgs(IIgorStepHandler StepHandler)
 {
     if (IgorJobConfig.IsStringParamSet(PlayerSettingFilesToOverrideFlag) && IgorJobConfig.IsStringParamSet(PlayerSettingsPathFlag))
     {
         IgorCore.SetModuleActiveForJob(this);
         StepHandler.RegisterJobStep(OverridePlayerSettingsStep, this, OverridePlayerSettings);
     }
 }
 public override void ProcessArgs(IIgorStepHandler StepHandler)
 {
     if (IgorJobConfig.IsStringParamSet(SetScriptingDefinesFlag) || StepHandler.IsModuleNeededByOtherModules(this))
     {
         IgorCore.SetModuleActiveForJob(this);
         StepHandler.RegisterJobStep(SetScriptingDefinesStep, this, SetScriptingDefines);
     }
 }
Exemple #5
0
        public virtual bool RunTest(string TestName)
        {
            MonsterDebug.Log("Attempting to run test " + TestName + " on a standalone copy of the game.");

            Environment.SetEnvironmentVariable(MonsterTestCore.MonsterStarterTestNameEnvVariable, TestName);

            string AppPath = "";

            if (IgorJobConfig.IsStringParamSet(MonsterTestCore.ExplicitAppPathFlag))
            {
                AppPath = IgorJobConfig.GetStringParam(MonsterTestCore.ExplicitAppPathFlag);
            }
            else
            {
                foreach (string CurrentProduct in IgorCore.GetModuleProducts())
                {
                    if (CurrentProduct.Contains(".app"))
                    {
                        AppPath = CurrentProduct.Substring(0, CurrentProduct.IndexOf(".app") + 4);
                    }
                    else if (CurrentProduct.EndsWith(".exe"))
                    {
                        AppPath = CurrentProduct;
                    }
                }
            }

            if (AppPath.EndsWith(".app"))
            {
                AppPath = Path.Combine(AppPath, Path.Combine("Contents", Path.Combine("MacOS", AppPath.Substring(AppPath.LastIndexOf('/') + 1, AppPath.Length - AppPath.LastIndexOf('/') - 5))));

                IgorRuntimeUtils.SetFileExecutable(AppPath);
            }

            string AppOutput = "";
            string AppError  = "";

            int RunAppRC = IgorRuntimeUtils.RunProcessCrossPlatform(AppPath, AppPath, "", Path.GetFullPath("."), ref AppOutput, ref AppError);

            if (RunAppRC != 0)
            {
                MonsterDebug.LogError("Failed to run test.  App retruned RC " + RunAppRC + "!\n\nOutput:\n" + AppOutput + "\n\nError:\n" + AppError);

                return(true);
            }

            MonsterDebug.Log("Test ran successfully!\n\nOutput:\n" + AppOutput + "\n\nError:\n" + AppError);

            return(true);
        }
Exemple #6
0
        public override void ProcessArgs(IIgorStepHandler StepHandler)
        {
            IgorCore.SetModuleActiveForJob(this);

            if (IgorJobConfig.IsBoolParamSet(IgorBuildCommon.BuildFlag))
            {
                if (IgorJobConfig.IsStringParamSet(IgorBuildCommon.BuildOptionsFlag))
                {
                    int OutResult = 0;
                    if (Int32.TryParse(IgorJobConfig.GetStringParam(IgorBuildCommon.BuildOptionsFlag).Trim('"'), out OutResult))
                    {
                        SetBuildOptionsBitfield = OutResult;
                    }
                }
            }
        }