Пример #1
0
        /// <summary>
        /// Execution by user.
        /// </summary>
        public void execAction()
        {
            if (SBEItem == null)
            {
                Log.Info("No actions to execution. Add new, then try again.");
                return;
            }
            Actions.ICommand cmd = new Actions.Command(Bootloader.Env,
                                                       new Script(Bootloader),
                                                       new MSBuild.Parser(Bootloader.Env, Bootloader.UVariable));

            ISolutionEvent    evt  = SBEItem;
            SolutionEventType type = SBE.type;

            Log.Info("Action: execute action '{0}':'{1}' manually :: emulate '{2}' event", evt.Name, evt.Caption, type);

            cmd.Env.BuildType = BuildType.Common; //TODO: IBuild.updateBuildType
            try {
                bool res = cmd.exec(evt, type);
                Log.Info("Action: '{0}':'{1}' completed as - '{2}'", evt.Name, evt.Caption, res.ToString());
            }
            catch (Exception ex) {
                Log.Error("Action: '{0}':'{1}' is failed. Error: '{2}'", evt.Name, evt.Caption, ex.Message);
            }
        }
Пример #2
0
        /// <summary>
        /// Execution by user.
        /// </summary>
        public void execAction()
        {
            if (SBEItem == null)
            {
                Log.Info("No actions to execution. Add new, then try again.");
                return;
            }
            Actions.ICommand cmd = new Actions.Command
                                   (
                Loader.Env,
                Loader.Soba,
                Loader.Soba.EvMSBuild
                                   );

            ISolutionEvent    evt  = SBEItem;
            SolutionEventType type = SBE.type;

            Log.Info($"Execute an action '{evt.Name}' manually. Emulate '{type}' event. {evt.Caption}");

            cmd.Env.BuildType = BuildType.Common; //TODO: IBuild.updateBuildType
            try {
                bool res = cmd.exec(evt, type);
                Log.Info($"Completed an action '{evt.Name}': {res}");
            }
            catch (Exception ex) {
                Log.Error($"Failed an action '{evt.Name}': {ex.Message}");
                Log.Debug(ex.StackTrace);
            }
        }
Пример #3
0
        protected string mActionRun(SolutionEventType type, ISolutionEvent evt, IPM pm)
        {
            if (!pm.FinalEmptyIs(LevelType.Method, "run"))
            {
                throw new IncorrectNodeException(pm);
            }
            ILevel level = pm.FirstLevel;

            BuildType buildType;

            if (level.Args == null || level.Args.Count < 1)
            {
                buildType = BuildType.Common;
            }
            else if (level.Is(ArgumentType.EnumOrConst))
            {
                buildType = (BuildType)Enum.Parse(typeof(BuildType), (string)level.Args[0].data);
            }
            else
            {
                throw new PMLevelException(level, "run([enum context])");
            }

            ICommand cmd = new Actions.Command(env, soba, emsbuild);

            Log.Info($"Execute action by user-script: '{evt.Name}'(context: {buildType}) /as '{type}' event");

            cmd.Env.BuildType = buildType;
            return(Value.From(cmd.exec(evt, type)));
        }
Пример #4
0
        /// <summary>
        /// Execution by user.
        /// </summary>
        public void execAction()
        {
            if(SBEItem == null) {
                Log.Info("No actions to execution. Add new, then try again.");
                return;
            }
            Actions.ICommand cmd = new Actions.Command(Bootloader.Env,
                                                        new Script(Bootloader),
                                                        new MSBuild.Parser(Bootloader.Env, Bootloader.UVariable));

            ISolutionEvent evt      = SBEItem;
            SolutionEventType type  = SBE.type;
            Log.Info("Action: execute action '{0}':'{1}' manually :: emulate '{2}' event", evt.Name, evt.Caption, type);

            try {
                bool res = cmd.exec(evt, type);
                Log.Info("Action: '{0}':'{1}' completed as - '{2}'", evt.Name, evt.Caption, res.ToString());
            }
            catch(Exception ex) {
                Log.Error("Action: '{0}':'{1}' is failed. Error: '{2}'", evt.Name, evt.Caption, ex.Message);
            }
        }