Exemple #1
0
        /// <summary>
        /// Adds a build product and its associated debug file to a receipt.
        /// </summary>
        /// <param name="OutputFile">Build product to add</param>
        /// <param name="DebugExtension">Extension for the matching debug file (may be null).</param>
        /// <param name="Receipt">Receipt to add to</param>
        static void AddBuildProductAndDebugFile(string OutputFile, BuildProductType OutputType, string DebugExtension, BuildReceipt Receipt)
        {
            Receipt.AddBuildProduct(OutputFile, OutputType);

            if (!String.IsNullOrEmpty(DebugExtension))
            {
                Receipt.AddBuildProduct(Path.ChangeExtension(OutputFile, DebugExtension), BuildProductType.SymbolFile);
            }
        }
 public override void AddFilesToReceipt(BuildReceipt Receipt, UEBuildBinary Binary)
 {
     // we need to include the generated .mem and .symbols file.
     if (Binary.Config.Type != UEBuildBinaryType.StaticLibrary)
     {
         Receipt.AddBuildProduct(Binary.Config.OutputFilePath + ".mem", BuildProductType.RequiredResource);
         Receipt.AddBuildProduct(Binary.Config.OutputFilePath + ".symbols", BuildProductType.RequiredResource);
     }
 }
Exemple #3
0
 public override void AddFilesToReceipt(BuildReceipt Receipt, UEBuildBinary Binary)
 {
     // we need to include the generated .mem and .symbols file.
     if(Binary.Config.Type != UEBuildBinaryType.StaticLibrary)
     {
         Receipt.AddBuildProduct(Binary.Config.OutputFilePath + ".mem", BuildProductType.RequiredResource);
         Receipt.AddBuildProduct(Binary.Config.OutputFilePath + ".symbols", BuildProductType.RequiredResource);
     }
 }
 public override void AddFilesToReceipt(BuildReceipt Receipt, UEBuildBinary Binary)
 {
     if (Binary.Config.Type == UEBuildBinaryType.DynamicLinkLibrary)
     {
         Receipt.AddBuildProduct(Path.Combine(Binary.Config.IntermediateDirectory, Path.GetFileNameWithoutExtension(Binary.Config.OutputFilePath) + ".lib"), BuildProductType.ImportLibrary);
     }
 }
Exemple #5
0
 public override void AddFilesToReceipt(BuildReceipt Receipt, UEBuildBinary Binary)
 {
     // the binary will have all of the .so's in the output files, we need to trim down to the shared apk (which is what needs to go into the manifest)
     if (Binary.Config.Type != UEBuildBinaryType.StaticLibrary)
     {
         foreach (string BinaryPath in Binary.Config.OutputFilePaths)
         {
             string ApkFile = Path.ChangeExtension(BinaryPath, ".apk");
             Receipt.AddBuildProduct(ApkFile, BuildProductType.Executable);
         }
     }
 }
Exemple #6
0
        /// <summary>
        /// Overrides base class to add module runtime dependencies to the build receipt.
        /// </summary>
        /// <param name="ToolChain">The platform toolchain</param>
        public override BuildReceipt MakeReceipt(IUEToolChain ToolChain)
        {
            BuildReceipt Receipt = base.MakeReceipt(ToolChain);

            // Set the IsPrecompiled flag on all the build products if we're not actually building this binary
            if (!Config.bAllowCompilation)
            {
                foreach (BuildProduct BuildProduct in Receipt.BuildProducts)
                {
                    BuildProduct.IsPrecompiled = true;
                }
            }

            // Add the compiled resource file if we're building a static library containing the launch module on Windows
            if (Config.Type == UEBuildBinaryType.StaticLibrary && ModuleNames.Contains("Launch") && (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64))
            {
                string ResourceFilePath = Path.Combine(Config.IntermediateDirectory, "Launch", "PCLaunch.rc.res");
                Receipt.AddBuildProduct(ResourceFilePath, BuildProductType.StaticLibrary);
            }

            // Add runtime dependencies for all the modules in this binary, and build up a list of all the referenced modules
            Dictionary <string, UEBuildModule> ReferencedModules = new Dictionary <string, UEBuildModule>();
            List <UEBuildModule> OrderedModules = new List <UEBuildModule>();

            foreach (string ModuleName in ModuleNames)
            {
                UEBuildModule Module = Target.GetModuleByName(ModuleName);
                foreach (RuntimeDependency RuntimeDependency in Module.RuntimeDependencies)
                {
                    Receipt.RuntimeDependencies.Add(new RuntimeDependency(RuntimeDependency));
                }
                Module.GetAllDependencyModules(ReferencedModules, OrderedModules, true, false, true);
            }

            // Add runtime dependencies for all the referenced external modules. These may be introduce dependencies for the binary without actually being listed for inclusion in it.
            foreach (UEBuildModule OrderedModule in OrderedModules)
            {
                UEBuildExternalModule ExternalModule = OrderedModule as UEBuildExternalModule;
                if (ExternalModule != null)
                {
                    foreach (RuntimeDependency RuntimeDependency in ExternalModule.RuntimeDependencies)
                    {
                        Receipt.RuntimeDependencies.Add(new RuntimeDependency(RuntimeDependency));
                    }
                }
            }
            return(Receipt);
        }
        public override void AddFilesToReceipt(BuildReceipt Receipt, UEBuildBinary Binary)
		{
			if (Binary.Target.GlobalLinkEnvironment.Config.bIsBuildingConsoleApplication)
			{
				return;
			}

			if (BundleContentsDirectory == "" && Binary.Config.Type == UEBuildBinaryType.Executable)
			{
				BundleContentsDirectory = Path.GetDirectoryName(Path.GetDirectoryName(Binary.Config.OutputFilePath)) + "/";
			}

			// We need to know what third party dylibs would be copied to the bundle
			if(Binary.Config.Type != UEBuildBinaryType.StaticLibrary)
			{
				var Modules = Binary.GetAllDependencyModules(bIncludeDynamicallyLoaded: false, bForceCircular: false);
				var BinaryLinkEnvironment = Binary.Target.GlobalLinkEnvironment.DeepCopy();
				var BinaryDependencies = new List<UEBuildBinary>();
				var LinkEnvironmentVisitedModules = new Dictionary<UEBuildModule, bool>();
				foreach (var Module in Modules)
				{
					Module.SetupPrivateLinkEnvironment(Binary, BinaryLinkEnvironment, BinaryDependencies, LinkEnvironmentVisitedModules);
				}

				foreach (string AdditionalLibrary in BinaryLinkEnvironment.Config.AdditionalLibraries)
				{
					string LibName = Path.GetFileName(AdditionalLibrary);
					if (LibName.StartsWith("lib"))
					{
						if (Path.GetExtension(AdditionalLibrary) == ".dylib" && !String.IsNullOrEmpty(BundleContentsDirectory))
						{
							string Entry = BundleContentsDirectory + "MacOS/" + LibName;
							Receipt.AddBuildProduct(Entry, BuildProductType.DynamicLibrary);
						}
					}
				}

				foreach (UEBuildBundleResource Resource in BinaryLinkEnvironment.Config.AdditionalBundleResources)
				{
					if (Directory.Exists(Resource.ResourcePath))
					{
						foreach (string ResourceFile in Directory.GetFiles(Resource.ResourcePath, "*", SearchOption.AllDirectories))
						{
							Receipt.AddBuildProduct(Path.Combine(BundleContentsDirectory, Resource.BundleContentsSubdir, ResourceFile.Substring(Path.GetDirectoryName(Resource.ResourcePath).Length + 1)), BuildProductType.RequiredResource);
						}
					}
					else
					{
						Receipt.AddBuildProduct(Path.Combine(BundleContentsDirectory, Resource.BundleContentsSubdir, Path.GetFileName(Resource.ResourcePath)), BuildProductType.RequiredResource);
					}
				}
			}

			if (Binary.Config.Type == UEBuildBinaryType.Executable)
			{
				// And we also need all the resources
				Receipt.AddBuildProduct(BundleContentsDirectory + "Info.plist", BuildProductType.RequiredResource);
				Receipt.AddBuildProduct(BundleContentsDirectory + "PkgInfo", BuildProductType.RequiredResource);
				Receipt.AddBuildProduct(BundleContentsDirectory + "Resources/UE4.icns", BuildProductType.RequiredResource);

				if (Binary.Target.AppName.StartsWith("UE4Editor"))
				{
					Receipt.AddBuildProduct(BundleContentsDirectory + "Resources/UProject.icns", BuildProductType.RequiredResource);
				}
			}
		}
Exemple #8
0
		public override void AddFilesToReceipt(BuildReceipt Receipt, UEBuildBinary Binary)
		{
			if (BuildConfiguration.bCreateStubIPA && Binary.Config.Type != UEBuildBinaryType.StaticLibrary)
			{
				string StubFile = Path.Combine (Path.GetDirectoryName (Binary.Config.OutputFilePath), Path.GetFileNameWithoutExtension (Binary.Config.OutputFilePath) + ".stub");
				Receipt.AddBuildProduct(StubFile, BuildProductType.Executable);
			}
		}
Exemple #9
0
        /// <summary>
        /// Adds a build product and its associated debug file to a receipt.
        /// </summary>
        /// <param name="OutputFile">Build product to add</param>
        /// <param name="DebugExtension">Extension for the matching debug file (may be null).</param>
        /// <param name="Receipt">Receipt to add to</param>
        static void AddBuildProductAndDebugFile(string OutputFile, BuildProductType OutputType, string DebugExtension, BuildReceipt Receipt)
        {
            Receipt.AddBuildProduct(OutputFile, OutputType);

            if(!String.IsNullOrEmpty(DebugExtension))
            {
                Receipt.AddBuildProduct(Path.ChangeExtension(OutputFile, DebugExtension), BuildProductType.SymbolFile);
            }
        }
		public override void AddFilesToReceipt(BuildReceipt Receipt, UEBuildBinary Binary)
		{
			// the binary will have all of the .so's in the output files, we need to trim down to the shared apk (which is what needs to go into the manifest)
			if (Binary.Config.Type != UEBuildBinaryType.StaticLibrary)
			{
				foreach (string BinaryPath in Binary.Config.OutputFilePaths)
				{
					string ApkFile = Path.ChangeExtension(BinaryPath, ".apk");
					Receipt.AddBuildProduct(ApkFile, BuildProductType.Executable);
				}
			}
		}
Exemple #11
0
        public override void AddFilesToReceipt(BuildReceipt Receipt, UEBuildBinary Binary)
		{
			// The cross-platform code adds .dSYMs for static libraries, which is just wrong, so
			// eliminate them here for now.
			string DebugExtension = UEBuildPlatform.GetBuildPlatform(Binary.Target.Platform).GetDebugInfoExtension(Binary.Config.Type);
			if(DebugExtension == ".dsym")
			{
				for (int i = 0; i < Receipt.BuildProducts.Count; i++)
				{
					if(Path.GetExtension(Receipt.BuildProducts[i].Path) == DebugExtension && Receipt.BuildProducts[i].Path.Contains(".app"))
					{
						Receipt.BuildProducts.RemoveAt(i--);
					}
				}

				for (int i = 0; i < Receipt.BuildProducts.Count; i++)
				{
					if((Receipt.BuildProducts[i].Type == BuildProductType.Executable || Receipt.BuildProducts[i].Type == BuildProductType.DynamicLibrary) && Receipt.BuildProducts[i].Path.Contains(".app"))
					{
						string BinaryPath = Receipt.BuildProducts[i].Path;
						while(BinaryPath.Contains(".app"))
						{
							BinaryPath = Path.GetDirectoryName(BinaryPath);
						}
						BinaryPath = Path.Combine(BinaryPath, Path.GetFileName(Receipt.BuildProducts[i].Path));
						Receipt.AddBuildProduct(Path.ChangeExtension(BinaryPath, DebugExtension), BuildProductType.SymbolFile);
					}
				}
			}

			if (Binary.Target.GlobalLinkEnvironment.Config.bIsBuildingConsoleApplication)
			{
				return;
			}

			if (BundleContentsDirectory == "" && Binary.Config.Type == UEBuildBinaryType.Executable)
			{
				BundleContentsDirectory = Path.GetDirectoryName(Path.GetDirectoryName(Binary.Config.OutputFilePath)) + "/";
			}

			// We need to know what third party dylibs would be copied to the bundle
			if(Binary.Config.Type != UEBuildBinaryType.StaticLibrary)
			{
				var Modules = Binary.GetAllDependencyModules(bIncludeDynamicallyLoaded: false, bForceCircular: false);
				var BinaryLinkEnvironment = Binary.Target.GlobalLinkEnvironment.DeepCopy();
				var BinaryDependencies = new List<UEBuildBinary>();
				var LinkEnvironmentVisitedModules = new Dictionary<UEBuildModule, bool>();
				foreach (var Module in Modules)
				{
					Module.SetupPrivateLinkEnvironment(Binary, BinaryLinkEnvironment, BinaryDependencies, LinkEnvironmentVisitedModules);
				}

				foreach (string AdditionalLibrary in BinaryLinkEnvironment.Config.AdditionalLibraries)
				{
					string LibName = Path.GetFileName(AdditionalLibrary);
					if (LibName.StartsWith("lib"))
					{
						if (Path.GetExtension(AdditionalLibrary) == ".dylib" && !String.IsNullOrEmpty(BundleContentsDirectory))
						{
							string Entry = BundleContentsDirectory + "MacOS/" + LibName;
							Receipt.AddBuildProduct(Entry, BuildProductType.DynamicLibrary);
						}
					}
				}

				foreach (UEBuildBundleResource Resource in BinaryLinkEnvironment.Config.AdditionalBundleResources)
				{
					if (Directory.Exists(Resource.ResourcePath))
					{
						foreach (string ResourceFile in Directory.GetFiles(Resource.ResourcePath, "*", SearchOption.AllDirectories))
						{
							Receipt.AddBuildProduct(Path.Combine(BundleContentsDirectory, Resource.BundleContentsSubdir, ResourceFile.Substring(Path.GetDirectoryName(Resource.ResourcePath).Length + 1)), BuildProductType.RequiredResource);
						}
					}
					else
					{
						Receipt.AddBuildProduct(Path.Combine(BundleContentsDirectory, Resource.BundleContentsSubdir, Path.GetFileName(Resource.ResourcePath)), BuildProductType.RequiredResource);
					}
				}
			}

			if (Binary.Config.Type == UEBuildBinaryType.Executable)
			{
				// And we also need all the resources
				Receipt.AddBuildProduct(BundleContentsDirectory + "Info.plist", BuildProductType.RequiredResource);
				Receipt.AddBuildProduct(BundleContentsDirectory + "PkgInfo", BuildProductType.RequiredResource);
				Receipt.AddBuildProduct(BundleContentsDirectory + "Resources/UE4.icns", BuildProductType.RequiredResource);

				if (Binary.Target.AppName.StartsWith("UE4Editor"))
				{
					Receipt.AddBuildProduct(BundleContentsDirectory + "Resources/UProject.icns", BuildProductType.RequiredResource);
				}
			}
		}