Beispiel #1
0
 /// <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));
 }
Beispiel #2
0
 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)
                );
        }
Beispiel #4
0
 public TryComponent(ISobaScript soba)
     : base(soba)
 {
     _crule = new Lazy <Regex>(() => new Regex
                               (
                                   Rule,
                                   RegexOptions.IgnorePatternWhitespace |
                                   RegexOptions.Singleline |
                                   RegexOptions.Compiled
                               ));
 }
Beispiel #5
0
        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);
        }
Beispiel #6
0
        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);
        }
Beispiel #8
0
            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);
        }
Beispiel #11
0
 public StubTryComponent(ISobaScript soba)
 {
 }
Beispiel #12
0
 public InternalComponent(ISobaScript soba, IEnvironment env)
     : this(soba, env, null)
 {
 }
Beispiel #13
0
 public InternalComponent(ISobaScript soba, IEnvironment env, IExer exer)
     : base(soba)
 {
     this.env = env ?? throw new ArgumentNullException(nameof(env));
     Exer     = exer;
 }
Beispiel #14
0
 public ConditionalExpression(ConditionComponent cond, ISobaScript script, IEvMSBuild msbuild)
     : base(script, msbuild)
 {
     this.cond = cond;
 }
Beispiel #15
0
 /// <param name="soba">Used SobaScript engine.</param>
 public ComponentAbstract(ISobaScript soba)
     : this(soba, soba?.EvMSBuild, soba?.UVars)
 {
 }
Beispiel #16
0
 private string _NoSpaces(string raw, ISobaScript script)
 {
     return(script.Eval(raw).Replace("\r", "").Replace("\n", "").Replace(" ", ""));
 }
Beispiel #17
0
 public FileComponent(ISobaScript soba, IExer exer)
     : this(soba, null, exer)
 {
 }
Beispiel #18
0
 public FunctionComponent(ISobaScript soba)
     : base(soba)
 {
 }
Beispiel #19
0
 /// <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)
 {
 }
Beispiel #21
0
 public StubBoxComponent(ISobaScript soba)
 {
 }
 public StubCommentComponent(ISobaScript soba)
 {
 }
Beispiel #23
0
 public FileComponent(ISobaScript soba, string basePath)
     : this(soba, null, basePath)
 {
 }
Beispiel #24
0
 public OwpComponent(ISobaScript soba, IOwpEnv env)
     : base(soba)
 {
     this.env = env ?? throw new ArgumentNullException(nameof(env));
 }
Beispiel #25
0
 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;
 }
Beispiel #27
0
 public BuildComponent(ISobaScript soba, IBuildEnv env)
     : base(soba)
 {
     this.env = env;
 }
Beispiel #28
0
 public StubEvMSBuildComponent(ISobaScript soba)
 {
 }
Beispiel #29
0
 public StubConditionComponent(ISobaScript soba)
 {
 }
Beispiel #30
0
 protected FileIOAbstract(ISobaScript soba)
     : base(soba)
 {
 }