Exemplo n.º 1
0
        /// <summary>
        /// Entry point to Errors/Warnings
        /// </summary>
        protected int sbeEW(ISolutionEventEW evt, Receiver.Output.EWType type)
        {
            Receiver.Output.IItemEW info = OWPItems._.getEW(new OWPIdent()
            {
                guid = GuidList.OWP_BUILD_STRING
            });

            // TODO: capture code####, message..
            if (!info.checkRule(type, evt.IsWhitelist, evt.Codes))
            {
                return(Codes.Success);
            }

            if (!isExecute(evt, current))
            {
                Log.Info("[{0}] ignored action '{1}' :: by execution order", type, evt.Caption);
                return(Codes.Success);
            }

            try {
                if (Cmd.exec(evt, (type == Receiver.Output.EWType.Warnings)? SolutionEventType.Warnings : SolutionEventType.Errors))
                {
                    Log.Info($"[{type}] finished '{evt.Name}': {evt.Caption}");
                }
                return(Codes.Success);
            }
            catch (Exception ex) {
                Log.Error("SBE '{0}' error: {1}", type, ex.Message);
            }
            return(Codes.Failed);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Entry point to Errors/Warnings
        /// </summary>
        protected int sbeEW(ISolutionEventEW evt, Receiver.Output.BuildItem.Type type)
        {
            Receiver.Output.BuildItem info = Receiver.Output.Item._.Build;

            // TODO: capture code####, message..
            if(!info.checkRule(type, evt.IsWhitelist, evt.Codes)) {
                return Codes.Success;
            }

            if(!isExecute(evt, current)) {
                Log.Info("[{0}] ignored action '{1}' :: by execution order", type, evt.Caption);
                return Codes.Success;
            }

            try {
                if(cmd.exec(evt, (type == Receiver.Output.BuildItem.Type.Warnings)? SolutionEventType.Warnings : SolutionEventType.Errors)) {
                    Log.Info("[{0}] finished SBE: {1}", type, evt.Caption);
                }
                return Codes.Success;
            }
            catch(Exception ex) {
                Log.Error("SBE '{0}' error: {1}", type, ex.Message);
            }
            return Codes.Failed;
        }