예제 #1
0
        internal bool ShouldExecute(IExecuteContext executeContext, CommandResultEntry[] previousResultCollection, ObjectId commandHash, out CommandResultEntry matchingResult)
        {
            IndexFileCommand.MountDatabase(executeContext.GetOutputObjectsGroups());
            try
            {
                matchingResult = FindMatchingResult(executeContext, previousResultCollection);
            }
            finally
            {
                IndexFileCommand.UnmountDatabase();
            }

            if (matchingResult == null || Command.ShouldForceExecution())
            {
                // Ensure we ignore existing results if the execution is forced
                matchingResult = null;
                return(true);
            }

            return(false);
        }
예제 #2
0
        /// <summary>
        /// Associate the given <see cref="ResultStatus" /> object as the result of the current step and execute the <see cref="StepProcessed"/> event.
        /// </summary>
        /// <param name="executeContext">The execute context.</param>
        /// <param name="status">The result status.</param>
        internal void RegisterResult(IExecuteContext executeContext, ResultStatus status)
        {
            Status = status;

            //executeContext.Logger.Debug("Step timer for {0}: callbacks: {1}ms, total: {2}ms", this, CallbackWatch.ElapsedMilliseconds, MicroThreadWatch.ElapsedMilliseconds);

            if (StepProcessed != null)
            {
                try
                {
                    IndexFileCommand.MountDatabase(executeContext.GetOutputObjectsGroups());
                    StepProcessed(this, new BuildStepEventArgs(this, executeContext.Logger));
                }
                catch (Exception ex)
                {
                    executeContext.Logger.Error("Exception in command " + this + ": " + ex);
                }
                finally
                {
                    IndexFileCommand.UnmountDatabase();
                }
            }
        }
예제 #3
0
파일: BuildStep.cs 프로젝트: cg123/xenko
        /// <summary>
        /// Associate the given <see cref="ResultStatus" /> object as the result of the current step and execute the <see cref="StepProcessed"/> event.
        /// </summary>
        /// <param name="executeContext">The execute context.</param>
        /// <param name="status">The result status.</param>
        internal void RegisterResult(IExecuteContext executeContext, ResultStatus status)
        {
            Status = status;

            //executeContext.Logger.Debug("Step timer for {0}: callbacks: {1}ms, total: {2}ms", this, CallbackWatch.ElapsedMilliseconds, MicroThreadWatch.ElapsedMilliseconds);

            if (StepProcessed != null)
            {
                try
                {
                    IndexFileCommand.MountDatabase(executeContext.GetOutputObjectsGroups());
                    StepProcessed(this, new BuildStepEventArgs(this, executeContext.Logger));
                }
                catch (Exception ex)
                {
                    executeContext.Logger.Error("Exception in command " + this + ": " + ex);
                }
                finally
                {
                    IndexFileCommand.UnmountDatabase();                    
                }
            }
        }
예제 #4
0
        internal bool ShouldExecute(IExecuteContext executeContext, CommandResultEntry[] previousResultCollection, ObjectId commandHash, out CommandResultEntry matchingResult)
        {
            IndexFileCommand.MountDatabase(executeContext.GetOutputObjectsGroups());
            try
            {
                matchingResult = FindMatchingResult(executeContext, previousResultCollection);
            }
            finally
            {
                IndexFileCommand.UnmountDatabase();
            }

            if (matchingResult == null || Command.ShouldForceExecution())
            {
                // Ensure we ignore existing results if the execution is forced
                matchingResult = null;
                return true;
            }

            return false;
        }
예제 #5
0
        internal bool ShouldExecute(IExecuteContext executeContext, CommandResultEntry[] previousResultCollection, ObjectId commandHash, out CommandResultEntry matchingResult)
        {
            IEnumerable <IDictionary <ObjectUrl, OutputObject> > outputObjectsGroups = executeContext.GetOutputObjectsGroups();

            MicrothreadLocalDatabases.MountDatabase(outputObjectsGroups);
            try
            {
                matchingResult = FindMatchingResult(executeContext, previousResultCollection);
            }
            finally
            {
                MicrothreadLocalDatabases.UnmountDatabase();
            }

            if (matchingResult == null || Command.ShouldForceExecution())
            {
                // Ensure we ignore existing results if the execution is forced
                matchingResult = null;
                return(true);
            }

            return(false);
        }
예제 #6
0
 internal static void MountDatabases(IExecuteContext executeContext)
 {
     MountDatabases(CreateTransaction(executeContext.GetOutputObjectsGroups()));
 }