Exemple #1
0
        /// <summary>
        /// Determine if a plugin is enabled for a given project
        /// </summary>
        /// <param name="Project">The project to check</param>
        /// <param name="Plugin">Information about the plugin</param>
        /// <param name="Platform">The target platform</param>
        /// <param name="TargetType"></param>
        /// <param name="bBuildDeveloperTools"></param>
        /// <param name="bBuildEditor"></param>
        /// <param name="bBuildRequiresCookedData"></param>
        /// <returns>True if the plugin should be enabled for this project</returns>
        public static bool IsPluginDescriptorRequiredForProject(PluginInfo Plugin, ProjectDescriptor Project, UnrealTargetPlatform Platform, TargetType TargetType, bool bBuildDeveloperTools, bool bBuildEditor, bool bBuildRequiresCookedData)
        {
            // Check if it's referenced by name from the project descriptor. If it is, we'll need the plugin to be included with the project regardless of whether it has
            // any platform-specific modules or content, just so the runtime can make the call.
            if (Project != null && Project.Plugins != null)
            {
                foreach (PluginReferenceDescriptor PluginReference in Project.Plugins)
                {
                    if (String.Compare(PluginReference.Name, Plugin.Name, true) == 0)
                    {
                        return(PluginReference.IsEnabledForPlatform(Platform) && PluginReference.IsEnabledForTarget(TargetType));
                    }
                }
            }

            // If the plugin contains content, it should be included for all platforms
            if (Plugin.Descriptor.bCanContainContent)
            {
                return(true);
            }

            // Check if the plugin has any modules for the given target
            foreach (ModuleDescriptor Module in Plugin.Descriptor.Modules)
            {
                if (Module.IsCompiledInConfiguration(Platform, TargetType, bBuildDeveloperTools, bBuildEditor, bBuildRequiresCookedData))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #2
0
        /// <summary>
        /// Determine if a plugin is enabled for a given project
        /// </summary>
        /// <param name="Project">The project to check</param>
        /// <param name="Plugin">Information about the plugin</param>
        /// <param name="Platform">The target platform</param>
        /// <param name="Target"></param>
        /// <returns>True if the plugin should be enabled for this project</returns>
        public static bool IsPluginEnabledForProject(PluginInfo Plugin, ProjectDescriptor Project, UnrealTargetPlatform Platform, TargetType Target)
        {
            bool bEnabled = Plugin.EnabledByDefault;

            if (Project != null && Project.Plugins != null)
            {
                foreach (PluginReferenceDescriptor PluginReference in Project.Plugins)
                {
                    if (String.Compare(PluginReference.Name, Plugin.Name, true) == 0 && !PluginReference.bOptional)
                    {
                        bEnabled = PluginReference.IsEnabledForPlatform(Platform) && PluginReference.IsEnabledForTarget(Target);
                    }
                }
            }
            return(bEnabled);
        }
Exemple #3
0
        /// <summary>
        /// Determine if a plugin is enabled for a given project
        /// </summary>
        /// <param name="Project">The project to check</param>
        /// <param name="Plugin">Information about the plugin</param>
        /// <param name="Platform">The target platform</param>
        /// <returns>True if the plugin should be enabled for this project</returns>
        public static bool IsPluginEnabledForProject(PluginInfo Plugin, ProjectDescriptor Project, UnrealTargetPlatform Platform, TargetRules.TargetType Target)
        {
            bool bEnabled = Plugin.Descriptor.bEnabledByDefault || Plugin.LoadedFrom == PluginLoadedFrom.GameProject;

            if (Project != null && Project.Plugins != null)
            {
                foreach (PluginReferenceDescriptor PluginReference in Project.Plugins)
                {
                    if (String.Compare(PluginReference.Name, Plugin.Name, true) == 0)
                    {
                        bEnabled = PluginReference.IsEnabledForPlatform(Platform) && PluginReference.IsEnabledForTarget(Target);
                    }
                }
            }
            return(bEnabled);
        }
Exemple #4
0
        /// <summary>
        /// Determine if a plugin is enabled for a given project
        /// </summary>
        /// <param name="Project">The project to check</param>
        /// <param name="PluginName">Name of the plugin to check</param>
        /// <param name="Platform">The target platform</param>
        /// <param name="Target"></param>
        /// <returns>True if the plugin should be enabled for this project</returns>
        public static bool IsPluginEnabledForProject(string PluginName, ProjectDescriptor Project, UnrealTargetPlatform Platform, TargetType Target)
        {
            bool bEnabled = false;

            if (Project != null && Project.Plugins != null)
            {
                foreach (PluginReferenceDescriptor PluginReference in Project.Plugins)
                {
                    if (String.Compare(PluginReference.Name, PluginName, true) == 0)
                    {
                        // start with whether it's enabled by default
                        bEnabled = PluginReference.bEnabled;
                        bEnabled = PluginReference.IsEnabledForPlatform(Platform) && PluginReference.IsEnabledForTarget(Target);
                        break;
                    }
                }
            }
            return(bEnabled);
        }
Exemple #5
0
        /// <summary>
        /// Determine if a plugin is enabled for a given project
        /// </summary>
        /// <param name="Project">The project to check. May be null.</param>
        /// <param name="Plugin">Information about the plugin</param>
        /// <param name="Platform">The target platform</param>
        /// <param name="Configuration">The target configuration</param>
        /// <param name="TargetType">The type of target being built</param>
        /// <returns>True if the plugin should be enabled for this project</returns>
        public static bool IsPluginEnabledForTarget(PluginInfo Plugin, ProjectDescriptor Project, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, TargetType TargetType)
        {
            if (!Plugin.Descriptor.SupportsTargetPlatform(Platform))
            {
                return(false);
            }

            bool bAllowEnginePluginsEnabledByDefault = (Project == null ? true : !Project.DisableEnginePluginsByDefault);
            bool bEnabled = Plugin.IsEnabledByDefault(bAllowEnginePluginsEnabledByDefault);

            if (Project != null && Project.Plugins != null)
            {
                foreach (PluginReferenceDescriptor PluginReference in Project.Plugins)
                {
                    if (String.Compare(PluginReference.Name, Plugin.Name, true) == 0 && !PluginReference.bOptional)
                    {
                        bEnabled = PluginReference.IsEnabledForPlatform(Platform) && PluginReference.IsEnabledForTargetConfiguration(Configuration) && PluginReference.IsEnabledForTarget(TargetType);
                    }
                }
            }
            return(bEnabled);
        }
        /// <summary>
        /// Determine if a plugin is enabled for a given project
        /// </summary>
        /// <param name="Project">The project to check</param>
        /// <param name="PluginName">Name of the plugin to check</param>
        /// <param name="Platform">The target platform</param>
        /// <param name="TargetConfiguration">The target configuration</param>
        /// <param name="Target"></param>
        /// <returns>True if the plugin should be enabled for this project</returns>
        public static bool IsPluginEnabledForProject(string PluginName, ProjectDescriptor Project, UnrealTargetPlatform Platform, UnrealTargetConfiguration TargetConfiguration, TargetType Target)
        {
            bool bEnabled = false;

            if (Project != null && Project.Plugins != null)
            {
                foreach (PluginReferenceDescriptor PluginReference in Project.Plugins)
                {
                    if (String.Compare(PluginReference.Name, PluginName, true) == 0)
                    {
                        bEnabled = PluginReference.bEnabled && PluginReference.IsEnabledForPlatform(Platform) && PluginReference.IsEnabledForTargetConfiguration(TargetConfiguration) && PluginReference.IsEnabledForTarget(Target);
                        break;
                    }
                }
            }
            return(bEnabled);
        }