Esempio n. 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="Rules">Rules for this module</param>
        public UEBuildModule(ModuleRules Rules)
        {
            this.Rules = Rules;

            ModuleApiDefine = Name.ToUpperInvariant() + "_API";

            PublicDefinitions         = HashSetFromOptionalEnumerableStringParameter(Rules.PublicDefinitions);
            PublicIncludePaths        = CreateDirectoryHashSet(Rules.PublicIncludePaths);
            PublicSystemIncludePaths  = CreateDirectoryHashSet(Rules.PublicSystemIncludePaths);
            PublicLibraryPaths        = CreateDirectoryHashSet(Rules.PublicLibraryPaths);
            PublicAdditionalLibraries = HashSetFromOptionalEnumerableStringParameter(Rules.PublicAdditionalLibraries);
            PublicFrameworks          = HashSetFromOptionalEnumerableStringParameter(Rules.PublicFrameworks);
            PublicWeakFrameworks      = HashSetFromOptionalEnumerableStringParameter(Rules.PublicWeakFrameworks);

            PublicAdditionalFrameworks = new HashSet <UEBuildFramework>();
            if (Rules.PublicAdditionalFrameworks != null)
            {
                foreach (ModuleRules.Framework FrameworkRules in Rules.PublicAdditionalFrameworks)
                {
                    UEBuildFramework Framework;
                    if (String.IsNullOrEmpty(FrameworkRules.ZipPath))
                    {
                        Framework = new UEBuildFramework(FrameworkRules.Name, FrameworkRules.CopyBundledAssets);
                    }
                    else
                    {
                        Framework = new UEBuildFramework(FrameworkRules.Name, FileReference.Combine(ModuleDirectory, FrameworkRules.ZipPath), DirectoryReference.Combine(UnrealBuildTool.EngineDirectory, "Intermediate", "UnzippedFrameworks", Name, Path.GetFileNameWithoutExtension(FrameworkRules.ZipPath)), FrameworkRules.CopyBundledAssets);
                    }
                    PublicAdditionalFrameworks.Add(Framework);
                }
            }

            PublicAdditionalBundleResources = Rules.AdditionalBundleResources == null ? new HashSet <UEBuildBundleResource>() : new HashSet <UEBuildBundleResource>(Rules.AdditionalBundleResources.Select(x => new UEBuildBundleResource(x)));
            PublicDelayLoadDLLs             = HashSetFromOptionalEnumerableStringParameter(Rules.PublicDelayLoadDLLs);
            if (Rules.bUsePrecompiled)
            {
                PrivateIncludePaths = new HashSet <DirectoryReference>();
            }
            else
            {
                PrivateIncludePaths = CreateDirectoryHashSet(Rules.PrivateIncludePaths);
            }
            IsRedistributableOverride = Rules.IsRedistributableOverride;

            WhitelistRestrictedFolders = new HashSet <DirectoryReference>(Rules.WhitelistRestrictedFolders.Select(x => DirectoryReference.Combine(ModuleDirectory, x)));
        }
Esempio n. 2
0
		string GetRemoteIntermediateFrameworkZipPath( UEBuildFramework Framework )
		{
			if ( Framework.OwningModule == null )
			{
				throw new BuildException( "GetRemoteIntermediateFrameworkZipPath: No owning module for framework {0}", Framework.FrameworkName );
			}

			string IntermediatePath = Framework.OwningModule.Target.ProjectDirectory + "/Intermediate/UnzippedFrameworks/" + Framework.OwningModule.Name;
			IntermediatePath =  Path.GetFullPath( ( IntermediatePath + Framework.FrameworkZipPath ).Replace( ".zip", "" ) );

			if ( BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac )
			{
				return ConvertPath( IntermediatePath );
			}

			return IntermediatePath;
		}
Esempio n. 3
0
		string GetRemoteFrameworkZipPath( UEBuildFramework Framework )
		{
			if ( BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac )
			{
				return ConvertPath( GetLocalFrameworkZipPath( Framework ) );
			}

			return GetLocalFrameworkZipPath( Framework );
		}
Esempio n. 4
0
		string GetLocalFrameworkZipPath( UEBuildFramework Framework )
		{
			if ( Framework.OwningModule == null )
			{
				throw new BuildException( "GetLocalFrameworkZipPath: No owning module for framework {0}", Framework.FrameworkName );
			}

			return Path.GetFullPath( Framework.OwningModule.ModuleDirectory + "/" + Framework.FrameworkZipPath );
		}
Esempio n. 5
0
 /** Adds a public additional framework */
 public virtual void AddPublicAdditionalFramework(UEBuildFramework Framework, bool bCheckForDuplicates = true)
 {
     if (bCheckForDuplicates == true)
     {
         if ( PublicAdditionalFrameworks.Contains( Framework ) )
         {
             return;
         }
     }
     PublicAdditionalFrameworks.Add( Framework );
 }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="Rules">Rules for this module</param>
        public UEBuildModule(ModuleRules Rules)
        {
            this.Rules = Rules;

            ModuleApiDefine    = Name.ToUpperInvariant() + "_API";
            ModuleVTableDefine = Name.ToUpperInvariant() + "_VTABLE";

            PublicDefinitions         = HashSetFromOptionalEnumerableStringParameter(Rules.PublicDefinitions);
            PublicIncludePaths        = CreateDirectoryHashSet(Rules.PublicIncludePaths);
            PublicSystemIncludePaths  = CreateDirectoryHashSet(Rules.PublicSystemIncludePaths);
            PublicLibraryPaths        = CreateDirectoryHashSet(Rules.PublicLibraryPaths);
            PublicAdditionalLibraries = HashSetFromOptionalEnumerableStringParameter(Rules.PublicAdditionalLibraries);
            PublicFrameworks          = HashSetFromOptionalEnumerableStringParameter(Rules.PublicFrameworks);
            PublicWeakFrameworks      = HashSetFromOptionalEnumerableStringParameter(Rules.PublicWeakFrameworks);

            PublicAdditionalFrameworks = new HashSet <UEBuildFramework>();
            if (Rules.PublicAdditionalFrameworks != null)
            {
                foreach (ModuleRules.Framework FrameworkRules in Rules.PublicAdditionalFrameworks)
                {
                    UEBuildFramework Framework;
                    if (String.IsNullOrEmpty(FrameworkRules.ZipPath))
                    {
                        Framework = new UEBuildFramework(FrameworkRules.Name, FrameworkRules.CopyBundledAssets);
                    }
                    else
                    {
                        Framework = new UEBuildFramework(FrameworkRules.Name, FileReference.Combine(ModuleDirectory, FrameworkRules.ZipPath), DirectoryReference.Combine(UnrealBuildTool.EngineDirectory, "Intermediate", "UnzippedFrameworks", FrameworkRules.Name, Path.GetFileNameWithoutExtension(FrameworkRules.ZipPath)), FrameworkRules.CopyBundledAssets);
                    }
                    PublicAdditionalFrameworks.Add(Framework);
                }
            }

            PublicAdditionalBundleResources = Rules.AdditionalBundleResources == null ? new HashSet <UEBuildBundleResource>() : new HashSet <UEBuildBundleResource>(Rules.AdditionalBundleResources.Select(x => new UEBuildBundleResource(x)));
            PublicDelayLoadDLLs             = HashSetFromOptionalEnumerableStringParameter(Rules.PublicDelayLoadDLLs);
            if (Rules.bUsePrecompiled)
            {
                PrivateIncludePaths = new HashSet <DirectoryReference>();
            }
            else
            {
                PrivateIncludePaths = CreateDirectoryHashSet(Rules.PrivateIncludePaths);
            }
            IsRedistributableOverride = Rules.IsRedistributableOverride;

            WhitelistRestrictedFolders = new HashSet <DirectoryReference>(Rules.WhitelistRestrictedFolders.Select(x => DirectoryReference.Combine(ModuleDirectory, x)));

            // merge the main directory and any others set in the Rules
            List <DirectoryReference> MergedDirectories = new List <DirectoryReference> {
                ModuleDirectory
            };

            DirectoryReference[] ExtraModuleDirectories = Rules.GetModuleDirectoriesForAllSubClasses();
            if (ExtraModuleDirectories != null)
            {
                MergedDirectories.AddRange(ExtraModuleDirectories);
            }

            // cache the results (it will always at least have the ModuleDirectory)
            ModuleDirectories = MergedDirectories.ToArray();
        }
Esempio n. 7
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="Rules">Rules for this module</param>
        /// <param name="IntermediateDirectory">Intermediate directory for this module</param>
        public UEBuildModule(ModuleRules Rules, DirectoryReference IntermediateDirectory)
        {
            this.Rules = Rules;
            this.IntermediateDirectory = IntermediateDirectory;

            ModuleApiDefine = Name.ToUpperInvariant() + "_API";

            PublicDefinitions         = HashSetFromOptionalEnumerableStringParameter(Rules.PublicDefinitions);
            PublicIncludePaths        = CreateDirectoryHashSet(Rules.PublicIncludePaths);
            PublicSystemIncludePaths  = CreateDirectoryHashSet(Rules.PublicSystemIncludePaths);
            PublicSystemLibraryPaths  = CreateDirectoryHashSet(Rules.PublicSystemLibraryPaths);
            PublicAdditionalLibraries = HashSetFromOptionalEnumerableStringParameter(Rules.PublicAdditionalLibraries);
            PublicSystemLibraries     = HashSetFromOptionalEnumerableStringParameter(Rules.PublicSystemLibraries);
            PublicFrameworks          = HashSetFromOptionalEnumerableStringParameter(Rules.PublicFrameworks);
            PublicWeakFrameworks      = HashSetFromOptionalEnumerableStringParameter(Rules.PublicWeakFrameworks);

            foreach (string LibraryName in PublicAdditionalLibraries)
            {
                // if the library path is fully qualified we just add it, this is the preferred method of adding a library
                if (File.Exists(LibraryName))
                {
                    continue;
                }

                // the library path does not seem to be resolvable as is, lets warn about it as dependency checking will not work for it
                Log.TraceWarning("Library '{0}' was not resolvable to a file when used in Module '{1}', assuming it is a filename and will search library paths for it. This is slow and dependency checking will not work for it. Please update reference to be fully qualified alternatively use PublicSystemLibraryPaths if you do intended to use this slow path to suppress this warning. ", LibraryName, Name);
            }

            PublicAdditionalFrameworks = new HashSet <UEBuildFramework>();
            if (Rules.PublicAdditionalFrameworks != null)
            {
                foreach (ModuleRules.Framework FrameworkRules in Rules.PublicAdditionalFrameworks)
                {
                    UEBuildFramework Framework;
                    if (String.IsNullOrEmpty(FrameworkRules.ZipPath))
                    {
                        Framework = new UEBuildFramework(FrameworkRules.Name, FrameworkRules.CopyBundledAssets);
                    }
                    else
                    {
                        Framework = new UEBuildFramework(FrameworkRules.Name, FileReference.Combine(ModuleDirectory, FrameworkRules.ZipPath), DirectoryReference.Combine(UnrealBuildTool.EngineDirectory, "Intermediate", "UnzippedFrameworks", FrameworkRules.Name, Path.GetFileNameWithoutExtension(FrameworkRules.ZipPath)), FrameworkRules.CopyBundledAssets);
                    }
                    PublicAdditionalFrameworks.Add(Framework);
                }
            }

            PublicAdditionalBundleResources = Rules.AdditionalBundleResources == null ? new HashSet <UEBuildBundleResource>() : new HashSet <UEBuildBundleResource>(Rules.AdditionalBundleResources.Select(x => new UEBuildBundleResource(x)));
            PublicDelayLoadDLLs             = HashSetFromOptionalEnumerableStringParameter(Rules.PublicDelayLoadDLLs);
            if (Rules.bUsePrecompiled)
            {
                PrivateIncludePaths = new HashSet <DirectoryReference>();
            }
            else
            {
                PrivateIncludePaths = CreateDirectoryHashSet(Rules.PrivateIncludePaths);
            }

            WhitelistRestrictedFolders = new HashSet <DirectoryReference>(Rules.WhitelistRestrictedFolders.Select(x => DirectoryReference.Combine(ModuleDirectory, x)));
            AliasRestrictedFolders     = new Dictionary <string, string>(Rules.AliasRestrictedFolders);

            // merge the main directory and any others set in the Rules
            List <DirectoryReference> MergedDirectories = new List <DirectoryReference> {
                ModuleDirectory
            };

            DirectoryReference[] ExtraModuleDirectories = Rules.GetModuleDirectoriesForAllSubClasses();
            if (ExtraModuleDirectories != null)
            {
                MergedDirectories.AddRange(ExtraModuleDirectories);
            }

            // cache the results (it will always at least have the ModuleDirectory)
            ModuleDirectories = MergedDirectories.ToArray();
        }