/// <param name="soba">Used SobaScript engine.</param> /// <param name="evm">E-MSBuild engine.</param> /// <param name="uvars">Varhead container.</param> public ComponentAbstract(ISobaScript soba, IEvMSBuild evm, IUVars uvars) : this() { this.soba = soba ?? throw new ArgumentNullException(nameof(soba)); this.emsbuild = evm ?? throw new ArgumentNullException(nameof(evm)); this.uvars = uvars ?? throw new ArgumentNullException(nameof(uvars)); }
public FileComponent(ISobaScript soba, IEncDetector detector, IExer exer) : base(soba) { EncDetector = detector; Exer = exer ?? throw new ArgumentNullException(nameof(exer)); _envPath = new Lazy <IEnumerable <string> >(() => GetEnvPath(EnvironmentVariableTarget.Process)); }
private Bootloader(IEnvironment env) { Env = env ?? throw new ArgumentNullException(nameof(env)); UVars = new UVars(); Soba = Configure( new Soba(MSBuild.MakeEvaluator(env, UVars), UVars) ); }
public TryComponent(ISobaScript soba) : base(soba) { _crule = new Lazy <Regex>(() => new Regex ( Rule, RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline | RegexOptions.Compiled )); }
private static ISobaScript RegisterCore(ISobaScript soba) { soba.Register(new TryComponent(soba)); soba.Register(new CommentComponent()); soba.Register(new BoxComponent(soba)); soba.Register(new ConditionComponent(soba)); soba.Register(new UserVariableComponent(soba)); soba.Register(new EvMSBuildComponent(soba)); return(soba); }
public ConditionComponent(ISobaScript soba) : base(soba) { expression = new ConditionalExpression(this, soba, emsbuild); _crule = new Lazy <Regex>(() => new Regex ( Rule, RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled )); }
/// <param name="env">Used environment</param> /// <param name="script">Used SBE-Scripts</param> /// <param name="msbuild">Used MSBuild</param> public Command(IEnvironment env, ISobaScript script, IEvMSBuild msbuild) { Env = env; SBEScript = script; MSBuild = msbuild; actions[ModeType.Operation] = new ActionOperation(this); actions[ModeType.Interpreter] = new ActionInterpreter(this); actions[ModeType.Script] = new ActionScript(this); actions[ModeType.File] = new ActionFile(this); actions[ModeType.Targets] = new ActionTargets(this); actions[ModeType.CSharp] = new ActionCSharp(this); }
public ToolContext(IEnvironment env) { Log.Trace("Initialization of the clean context for testing."); var soba = new Soba(MSBuild.MakeEvaluator(env, uvars), uvars); Bootloader._.Configure(soba); cloader = soba; inspector = new Inspector(soba); script = soba; msbuild = soba.EvMSBuild; }
public static ISobaScript Reset(ISobaScript soba, bool unsetUVars) { if (soba == null) { throw new ArgumentNullException(nameof(soba)); } soba.Unregister(); if (unsetUVars) { soba.UVars.UnsetAll(); } return(soba); }
public static ISobaScript Configure(ISobaScript soba, IEnvironment env) { if (soba == null) { throw new ArgumentNullException(nameof(soba)); } IEncDetector detector = new EncDetector(); var fc = new FileComponent(soba, detector, new Exer(Settings.WPath, detector)); var zc = new SevenZipComponent(soba, new SzArchiver(), Settings.WPath); var nc = new NuGetComponent(soba, Settings.WPath); Settings._.WorkPathUpdated += (object sender, DataArgs <string> e) => { fc.Exer.BasePath = e.Data; zc.BasePath = e.Data; nc.BasePath = e.Data; }; //NOTE: custom order makes sense for vsSBE soba.Register(new TryComponent(soba)); soba.Register(new CommentComponent()); soba.Register(new BoxComponent(soba)); soba.Register(new ConditionComponent(soba)); soba.Register(new UserVariableComponent(soba)); soba.Register(new OwpComponent(soba, new OwpEnv(env))); soba.Register(new DteComponent(soba, new DteEnv(env))); soba.Register(new InternalComponent(soba, env, fc.Exer)); soba.Register(new EvMSBuildComponent(soba)); soba.Register(new BuildComponent(soba, new BuildEnv(env))); soba.Register(new FunctionComponent(soba)); soba.Register(fc); soba.Register(nc); soba.Register(zc); return(soba); }
public StubTryComponent(ISobaScript soba) { }
public InternalComponent(ISobaScript soba, IEnvironment env) : this(soba, env, null) { }
public InternalComponent(ISobaScript soba, IEnvironment env, IExer exer) : base(soba) { this.env = env ?? throw new ArgumentNullException(nameof(env)); Exer = exer; }
public ConditionalExpression(ConditionComponent cond, ISobaScript script, IEvMSBuild msbuild) : base(script, msbuild) { this.cond = cond; }
/// <param name="soba">Used SobaScript engine.</param> public ComponentAbstract(ISobaScript soba) : this(soba, soba?.EvMSBuild, soba?.UVars) { }
private string _NoSpaces(string raw, ISobaScript script) { return(script.Eval(raw).Replace("\r", "").Replace("\n", "").Replace(" ", "")); }
public FileComponent(ISobaScript soba, IExer exer) : this(soba, null, exer) { }
public FunctionComponent(ISobaScript soba) : base(soba) { }
/// <param name="soba">Used SobaScript engine.</param> /// <param name="evmaker">Custom maker of the E-MSBuild engine.</param> /// <param name="uvars">Varhead container.</param> public ComponentAbstract(ISobaScript soba, IEvMSBuildMaker evmaker, IUVars uvars) : this(soba, evmaker?.MakeEvaluator(uvars), uvars) { }
public StubUserVariableComponent(ISobaScript soba) { }
public StubBoxComponent(ISobaScript soba) { }
public StubCommentComponent(ISobaScript soba) { }
public FileComponent(ISobaScript soba, string basePath) : this(soba, null, basePath) { }
public OwpComponent(ISobaScript soba, IOwpEnv env) : base(soba) { this.env = env ?? throw new ArgumentNullException(nameof(env)); }
public FileComponent(ISobaScript soba, IEncDetector detector, string basePath) : this(soba, detector, new Exer(basePath)) { }
public ExpressionAbstract(ISobaScript soba, IEvMSBuild emsbuild) { this.soba = soba; this.emsbuild = emsbuild; }
public BuildComponent(ISobaScript soba, IBuildEnv env) : base(soba) { this.env = env; }
public StubEvMSBuildComponent(ISobaScript soba) { }
public StubConditionComponent(ISobaScript soba) { }
protected FileIOAbstract(ISobaScript soba) : base(soba) { }