private static void PerformPostBuild(
            BuildReleaseType releaseType,
            BuildPlatform platform,
            BuildArchitecture architecture,
            BuildDistribution distribution,
            DateTime buildTime, ref BuildOptions options, string configKey, string buildPath)
        {
            BuildAction[] buildActions = BuildSettings.postBuildActions.buildActions;
            if (buildActions != null)
            {
                for (int i = 0; i < buildActions.Length; i++)
                {
                    BuildAction action = buildActions[i];

                    // Check if execute method has been overriden.
                    MethodInfo m = action.GetType().GetMethod("PerBuildExecute");
                    if (m.GetBaseDefinition().DeclaringType != m.DeclaringType && action.actionType == BuildAction.ActionType.PerPlatform)
                    {
                        // Check build filter and execute if true.
                        if (action.filter == null || action.filter.Evaluate(releaseType, platform, architecture, distribution, configKey) && action.actionEnabled)
                        {
                            BuildNotificationList.instance.AddNotification(new BuildNotification(
                                                                               BuildNotification.Category.Notification,
                                                                               string.Format("Performing Post-Build Action ({0}/{1}).", i + 1, buildActions.Length), string.Format("{0}: {1}", action.actionName, configKey),
                                                                               true, null));

                            action.PerBuildExecute(releaseType, platform, architecture, distribution, buildTime, ref options, configKey, buildPath);
                        }
                        else
                        {
                            BuildNotificationList.instance.AddNotification(new BuildNotification(
                                                                               BuildNotification.Category.Notification,
                                                                               string.Format("Skipping Post-Build Action ({0}/{1}).", i + 1, buildActions.Length), string.Format("{0}: {1}", action.actionName, configKey),
                                                                               true, null));
                        }
                    }
                }
            }
        }
Exemple #2
0
        private static void PerformPostBuild()
        {
            // Run post-build actions.
            BuildAction[] buildActions = BuildSettings.postBuildActions.buildActions;
            if (buildActions != null)
            {
                for (int i = 0; i < buildActions.Length; i++)
                {
                    BuildAction action = buildActions[i];

                    // Check if execute method has been overriden.
                    MethodInfo m = action.GetType().GetMethod("Execute");
                    if (m.GetBaseDefinition().DeclaringType != m.DeclaringType &&
                        action.actionType == BuildAction.ActionType.SingleRun)
                    {
                        if (action.actionEnabled)
                        {
                            BuildNotificationList.instance.AddNotification(new BuildNotification(
                                                                               BuildNotification.Category.Notification,
                                                                               string.Format("Performing Post-Build Action ({0}/{1}).", i + 1, buildActions.Length),
                                                                               action.actionName,
                                                                               true, null));

                            action.Execute();
                        }
                        else
                        {
                            BuildNotificationList.instance.AddNotification(new BuildNotification(
                                                                               BuildNotification.Category.Notification,
                                                                               string.Format("Skipping Post-Build Action ({0}/{1}).", i + 1, buildActions.Length),
                                                                               action.actionName,
                                                                               true, null));
                        }
                    }
                }
            }
        }