private void BuildGameImpl(IEnumerable <Type> typesToInclude, IEnumerable <string> additionalOptions) { _steps = GetFinalSteps(typesToInclude, additionalOptions); var registry = new OptionsRegistry(); registry.Collect(_steps); var cmdOptions = registry.ProcessOptions(additionalOptions); var envOptions = registry.ProcessEnvironment(); var optionsStr = string.Join("\n", cmdOptions.Concat(envOptions).Select(t => $" '{t.Item1}' = '{t.Item2}'")); Debug.Log($"Running build with options:\n{optionsStr}"); DumpBuildParameters(); foreach (var a in _steps.OfType <IRunPreBuild>()) { a.OnPreBuild(this); } foreach (var a in _steps.OfType <IRunPostBuild>().Reverse()) { a.OnPostBuild(this); } }
public IEnumerable <object> ParseMultipleMethodTest(object[] valuesToTest) { var r = new OptionsRegistry(); var s = new OptionsBag(); r.Collect(new[] { s }); r.ProcessOptions(new[] { $"-mlt_values_step={string.Join( ",", valuesToTest )}" }); return(s.MultipleValues); }
public void ParseFloatProp() { var r = new OptionsRegistry(); var s = new OptionsBag(); r.Collect(new[] { s }); r.ProcessOptions(new[] { "-flt=1.5" }); Assert.That(s.FloatProp, Is.EqualTo(1.5f)); }
public void ParseIntMethod() { var r = new OptionsRegistry(); var s = new OptionsBag(); r.Collect(new[] { s }); r.ProcessOptions(new[] { "-intm=123" }); Assert.That(s.IntProp, Is.EqualTo(123)); }
public void ParseStringMethod() { var r = new OptionsRegistry(); var s = new OptionsBag(); r.Collect(new[] { s }); r.ProcessOptions(new[] { "-strm=value" }); Assert.That(s.StringProp, Is.EqualTo("value")); }
public void ParseEnumMethod() { var r = new OptionsRegistry(); var s = new OptionsBag(); r.Collect(new[] { s }); r.ProcessOptions(new[] { "-enmm=webgl" }); Assert.That(s.EnumProp, Is.EqualTo(BuildTarget.WebGL)); }
public void ParseBoolMethod() { var r = new OptionsRegistry(); var s = new OptionsBag(); r.Collect(new[] { s }); r.ProcessOptions(new[] { "-bolm=true" }); Assert.That(s.BoolProp, Is.EqualTo(true)); }
public void CollectPrivateOpts() { var r = new OptionsRegistry(); var s = new OptionsBag2(); r.Collect(new[] { s }); var names = r.AvailableOptions.Select(o => o.Name); Assert.That(names, Contains.Item("private_prop")); Assert.That(names, Contains.Item("private_mthd")); }
public void ParseEnvVariableOptionValueCurlyBraces() { var r = new OptionsRegistry(); var s = new OptionsBag(); r.Collect(new[] { s }); Environment.SetEnvironmentVariable("STR_VALUE", "value"); r.ProcessOptions(new[] { "-str=${STR_VALUE}" }); Assert.That(s.StringProp, Is.EqualTo("value")); }
public void CollectPublicOpts() { var r = new OptionsRegistry(); var s = new OptionsBag2(); r.Collect(new[] { s }); var names = r.Select(o => o.Item1); Assert.That(names, Contains.Item("public_prop")); Assert.That(names, Contains.Item("public_mthd")); }
public void ParseEnvVariableOption() { var r = new OptionsRegistry(); var s = new OptionsBag(); r.Collect(new[] { s }); Environment.SetEnvironmentVariable("str", "value"); r.ProcessEnvironment(); Assert.That(s.StringProp, Is.EqualTo("value")); }
private Exception ValidateCommandLine() { var tmpOptions = new OptionsRegistry(); tmpOptions.Collect(_steps); try { tmpOptions.ProcessOptions(_selectedOptions.Select(o => $"-{o.Name}={o.Value}")); return(null); } catch (Exception e) { return(e); } }
private void OnEnable() { titleContent = new GUIContent("CLI.Build Inspector"); minSize = new Vector2(700, 500); _steps = Builder.BuildStepsList(); try { var options = new OptionsRegistry(); options.Collect(_steps); _optionsList = options.AvailableOptions.OrderBy(option => option.Name).ToList(); } catch (Exception e) { _collectException = e; Debug.LogException(e); } }