protected bool FindResourceBinaryFile(out string SourcePath, string ResourceFileName, bool AllowEngineFallback = true)
        {
            // look in project normal Build location
            SourcePath = Path.Combine(ProjectPath, "Build", Platform.ToString(), BuildResourceSubPath);
            bool bFileExists = File.Exists(Path.Combine(SourcePath, ResourceFileName));

            // look in Platform Extensions next
            if (!bFileExists)
            {
                SourcePath  = Path.Combine(ProjectPath, "Platforms", Platform.ToString(), "Build", BuildResourceSubPath);
                bFileExists = File.Exists(Path.Combine(SourcePath, ResourceFileName));
            }

            // look in Engine, if allowed
            if (!bFileExists && AllowEngineFallback)
            {
                SourcePath  = Path.Combine(UnrealBuildTool.EngineDirectory.FullName, "Build", Platform.ToString(), EngineResourceSubPath);
                bFileExists = File.Exists(Path.Combine(SourcePath, ResourceFileName));

                // look in Platform extensions too
                if (!bFileExists)
                {
                    SourcePath  = Path.Combine(UnrealBuildTool.EngineDirectory.FullName, "Platforms", Platform.ToString(), "Build", EngineResourceSubPath);
                    bFileExists = File.Exists(Path.Combine(SourcePath, ResourceFileName));
                }
            }

            return(bFileExists);
        }
Esempio n. 2
0
 /// <summary>
 /// Returns the standard path to the build receipt for a given target
 /// </summary>
 /// <param name="DirectoryName">Base directory for the target being built; either the project directory or engine directory.</param>
 /// <param name="TargetName">The target being built</param>
 /// <param name="Configuration">The target configuration</param>
 /// <param name="Platform">The target platform</param>
 /// <returns>Path to the receipt for this target</returns>
 public static string GetDefaultPath(string BaseDir, string TargetName, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, string BuildArchitecture)
 {
     if (String.IsNullOrEmpty(BuildArchitecture) && Configuration == UnrealTargetConfiguration.Development)
     {
         return(Path.Combine(BaseDir, "Binaries", Platform.ToString(), String.Format("{0}.target", TargetName)));
     }
     else
     {
         return(Path.Combine(BaseDir, "Binaries", Platform.ToString(), String.Format("{0}-{1}-{2}{3}.target", TargetName, Platform.ToString(), Configuration.ToString(), BuildArchitecture)));
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Finds a list of folder names to include when building for this platform
        /// </summary>
        virtual public string[] GetIncludedFolderNames()
        {
            if (CachedIncludedFolderNames == null)
            {
                List <string> Names = new List <string>();

                Names.Add(Platform.ToString());
                foreach (UnrealPlatformGroup Group in UEBuildPlatform.GetPlatformGroups(Platform))
                {
                    Names.Add(Group.ToString());
                }

                CachedIncludedFolderNames = Names.ToArray();
            }
            return(CachedIncludedFolderNames);
        }
Esempio n. 4
0
        /// <summary>
        /// Finds a list of folder names to include when building for this platform
        /// </summary>
        public ReadOnlyHashSet <string> GetIncludedFolderNames()
        {
            if (CachedIncludedFolderNames == null)
            {
                HashSet <string> Names = new HashSet <string>(DirectoryReference.Comparer);

                Names.Add(Platform.ToString());
                foreach (UnrealPlatformGroup Group in UEBuildPlatform.GetPlatformGroups(Platform))
                {
                    Names.Add(Group.ToString());
                }

                CachedIncludedFolderNames = new ReadOnlyHashSet <string>(Names, DirectoryReference.Comparer);
            }
            return(CachedIncludedFolderNames);
        }
        // static creation functions for ini files
        public static ConfigCacheIni CreateConfigCacheIni(UnrealTargetPlatform Platform, string BaseIniName, DirectoryReference ProjectDirectory, DirectoryReference EngineDirectory = null)
        {
            if (EngineDirectory == null)
            {
                EngineDirectory = UnrealBuildTool.EngineDirectory;
            }

            string BaseIniCacheKey = BaseIniName + "_" + Platform.ToString();

            // cache base ini for use as the seed for the rest
            if (!BaseIniCache.ContainsKey(BaseIniCacheKey))
            {
                BaseIniCache.Add(BaseIniCacheKey, new ConfigCacheIni(Platform, BaseIniName, null, EngineDirectory, EngineOnly: true));
            }

            // build the new ini and cache it for later re-use
            ConfigCacheIni BaseCache = BaseIniCache[BaseIniCacheKey];
            string         Key       = GetIniPlatformName(Platform) + BaseIniName + EngineDirectory.FullName + (ProjectDirectory != null ? ProjectDirectory.FullName : "");

            if (!IniCache.ContainsKey(Key))
            {
                IniCache.Add(Key, new ConfigCacheIni(Platform, BaseIniName, ProjectDirectory, EngineDirectory, BaseCache: BaseCache));
            }
            return(IniCache[Key]);
        }
Esempio n. 6
0
        /// <summary>
        /// Write the receipt to disk.
        /// </summary>
        /// <param name="Location">Output filename</param>
        /// <param name="EngineDir">Engine directory for expanded paths</param>
        public void Write(FileReference Location, DirectoryReference EngineDir)
        {
            using (JsonWriter Writer = new JsonWriter(Location.FullName))
            {
                Writer.WriteObjectStart();
                Writer.WriteValue("TargetName", TargetName);
                Writer.WriteValue("Platform", Platform.ToString());
                Writer.WriteValue("Configuration", Configuration.ToString());
                Writer.WriteValue("TargetType", TargetType.ToString());

                if (ProjectFile != null)
                {
                    Writer.WriteValue("Project", ProjectFile.MakeRelativeTo(Location.Directory).Replace(Path.DirectorySeparatorChar, '/'));
                }

                if (Launch != null)
                {
                    Writer.WriteValue("Launch", InsertPathVariables(Launch, EngineDir, ProjectDir));
                }

                Writer.WriteObjectStart("Version");
                Version.WriteProperties(Writer);
                Writer.WriteObjectEnd();

                Writer.WriteArrayStart("BuildProducts");
                foreach (BuildProduct BuildProduct in BuildProducts)
                {
                    Writer.WriteObjectStart();
                    Writer.WriteValue("Path", InsertPathVariables(BuildProduct.Path, EngineDir, ProjectDir));
                    Writer.WriteValue("Type", BuildProduct.Type.ToString());
                    Writer.WriteObjectEnd();
                }
                Writer.WriteArrayEnd();

                Writer.WriteArrayStart("RuntimeDependencies");
                foreach (RuntimeDependency RuntimeDependency in RuntimeDependencies)
                {
                    Writer.WriteObjectStart();
                    Writer.WriteValue("Path", InsertPathVariables(RuntimeDependency.Path, EngineDir, ProjectDir));
                    Writer.WriteValue("Type", RuntimeDependency.Type.ToString());
                    Writer.WriteObjectEnd();
                }
                Writer.WriteArrayEnd();

                if (AdditionalProperties.Count > 0)
                {
                    Writer.WriteArrayStart("AdditionalProperties");
                    foreach (ReceiptProperty AdditionalProperty in AdditionalProperties)
                    {
                        Writer.WriteObjectStart();
                        Writer.WriteValue("Name", AdditionalProperty.Name);
                        Writer.WriteValue("Value", AdditionalProperty.Value);
                        Writer.WriteObjectEnd();
                    }
                    Writer.WriteArrayEnd();
                }

                Writer.WriteObjectEnd();
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Finds a list of folder names to exclude when building for this platform
        /// </summary>
        public FileSystemName[] GetIncludedFolderNames()
        {
            if (CachedIncludedFolderNames == null)
            {
                List <FileSystemName> Names = new List <FileSystemName>();

                Names.Add(new FileSystemName(Platform.ToString()));
                foreach (UnrealPlatformGroup Group in UEBuildPlatform.GetPlatformGroups(Platform))
                {
                    Names.Add(new FileSystemName(Group.ToString()));
                }

                CachedIncludedFolderNames = Names.ToArray();
            }
            return(CachedIncludedFolderNames);
        }
 ///
 ///	VisualStudio project generation functions
 ///
 /// <summary>
 /// Return the VisualStudio platform name for this build platform
 /// </summary>
 /// <param name="InPlatform">  The UnrealTargetPlatform being built</param>
 /// <param name="InConfiguration"> The UnrealTargetConfiguration being built</param>
 /// <returns>string    The name of the platform that VisualStudio recognizes</returns>
 public override string GetVisualStudioPlatformName(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration)
 {
     if (InPlatform == UnrealTargetPlatform.HoloLens)
     {
         return("arm64");
     }
     return(InPlatform.ToString());
 }
Esempio n. 9
0
        /// <summary>
        /// Return the VisualStudio platform name for this build platform
        /// </summary>
        /// <param name="InPlatform">  The UnrealTargetPlatform being built</param>
        /// <param name="InConfiguration"> The UnrealTargetConfiguration being built</param>
        /// <returns>string    The name of the platform that VisualStudio recognizes</returns>
        public override string GetVisualStudioPlatformName(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration)
        {
            if (InPlatform == UnrealTargetPlatform.Android)
            {
                return("Tegra-Android");
            }

            return(InPlatform.ToString());
        }
Esempio n. 10
0
        /// <summary>
        /// Gets UnrealHeaderTool.exe path. Does not care if UnrealheaderTool was build as a monolithic exe or not.
        /// </summary>
        static string GetHeaderToolPath()
        {
            UnrealTargetPlatform Platform = BuildHostPlatform.Current.Platform;
            string ExeExtension           = UEBuildPlatform.GetBuildPlatform(Platform).GetBinaryExtension(UEBuildBinaryType.Executable);
            string HeaderToolExeName      = "UnrealHeaderTool";
            string HeaderToolPath         = Path.Combine("..", "Binaries", Platform.ToString(), HeaderToolExeName + ExeExtension);

            return(HeaderToolPath);
        }
Esempio n. 11
0
 /// <summary>
 /// Write a TargetInfo to an archive on disk
 /// </summary>
 /// <param name="Writer">Archive to write to</param>
 public void Write(BinaryArchiveWriter Writer)
 {
     Writer.WriteString(Name);
     Writer.WriteString(Platform.ToString());
     Writer.WriteString(Configuration.ToString());
     Writer.WriteString(Architecture);
     Writer.WriteFileReference(ProjectFile);
     Writer.WriteArray(Arguments.GetRawArray(), Item => Writer.WriteString(Item));
 }
Esempio n. 12
0
        /// <summary>
        /// Gets the standard path for an manifest
        /// </summary>
        /// <param name="DirectoryName">The directory containing this manifest</param>
        /// <param name="AppName">The modular app name being built</param>
        /// <param name="Configuration">The target configuration</param>
        /// <param name="Platform">The target platform</param>
        /// <param name="BuildArchitecture">The architecture of the target platform</param>
        /// <returns>Filename for the app receipt</returns>
        public static string GetStandardFileName(string AppName, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, string BuildArchitecture, bool bIsGameDirectory)
        {
            string BaseName = AppName;

            if (Configuration != UnrealTargetConfiguration.Development && !(Configuration == UnrealTargetConfiguration.DebugGame && !bIsGameDirectory))
            {
                BaseName += String.Format("-{0}-{1}", Platform.ToString(), Configuration.ToString());
            }
            return(String.Format("{0}{1}.modules", BaseName, BuildArchitecture));
        }
Esempio n. 13
0
		/// <summary>
		/// Returns the platform name to use as part of platform-specific config files
		/// </summary>
		public static string GetIniPlatformName(UnrealTargetPlatform TargetPlatform)
		{
			if (TargetPlatform == UnrealTargetPlatform.Win32 || TargetPlatform == UnrealTargetPlatform.Win64)
			{
				return "Windows";
			}
			else
			{
				return TargetPlatform == null ? "None" : TargetPlatform.ToString();
			}
		}
Esempio n. 14
0
        /// <summary>
        /// Write the receipt to disk.
        /// </summary>
        /// <param name="FileName">Output filename</param>
        public void Write(string FileName)
        {
            using (JsonWriter Writer = new JsonWriter(FileName))
            {
                Writer.WriteObjectStart();
                Writer.WriteValue("TargetName", TargetName);
                Writer.WriteValue("Platform", Platform.ToString());
                Writer.WriteValue("Configuration", Configuration.ToString());
                Writer.WriteValue("BuildId", BuildId);

                Writer.WriteObjectStart("Version");
                Version.Write(Writer);
                Writer.WriteObjectEnd();

                Writer.WriteArrayStart("BuildProducts");
                foreach (BuildProduct BuildProduct in BuildProducts)
                {
                    Writer.WriteObjectStart();
                    Writer.WriteValue("Path", BuildProduct.Path);
                    Writer.WriteValue("Type", BuildProduct.Type.ToString());
                    if (BuildProduct.IsPrecompiled)
                    {
                        Writer.WriteValue("IsPrecompiled", BuildProduct.IsPrecompiled);
                    }
                    Writer.WriteObjectEnd();
                }
                Writer.WriteArrayEnd();

                Writer.WriteArrayStart("RuntimeDependencies");
                foreach (RuntimeDependency RuntimeDependency in RuntimeDependencies)
                {
                    Writer.WriteObjectStart();
                    Writer.WriteValue("Path", RuntimeDependency.Path);
                    Writer.WriteValue("Type", RuntimeDependency.Type.ToString());
                    Writer.WriteObjectEnd();
                }
                Writer.WriteArrayEnd();

                if (AdditionalProperties.Count > 0)
                {
                    Writer.WriteArrayStart("AdditionalProperties");
                    foreach (ReceiptProperty AdditionalProperty in AdditionalProperties)
                    {
                        Writer.WriteObjectStart();
                        Writer.WriteValue("Name", AdditionalProperty.Name);
                        Writer.WriteValue("Value", AdditionalProperty.Value);
                        Writer.WriteObjectEnd();
                    }
                    Writer.WriteArrayEnd();
                }

                Writer.WriteObjectEnd();
            }
        }
Esempio n. 15
0
        /// <summary>
        /// Returns the standard path to the build receipt for a given target
        /// </summary>
        /// <param name="BaseDir">Base directory for the target being built; either the project directory or engine directory.</param>
        /// <param name="TargetName">The target being built</param>
        /// <param name="Platform">The target platform</param>
        /// <param name="Configuration">The target configuration</param>
        /// <param name="BuildArchitecture">The architecture being built</param>
        /// <returns>Path to the receipt for this target</returns>
        public static FileReference GetDefaultPath(DirectoryReference BaseDir, string TargetName, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, string BuildArchitecture)
        {
            // Get the architecture suffix. Platforms have the option of overriding whether to include this string in filenames.
            string ArchitectureSuffix = "";

            if (!String.IsNullOrEmpty(BuildArchitecture) && UEBuildPlatform.GetBuildPlatform(Platform).RequiresArchitectureSuffix())
            {
                ArchitectureSuffix = BuildArchitecture;
            }

            // Build the output filename
            if (String.IsNullOrEmpty(ArchitectureSuffix) && Configuration == UnrealTargetConfiguration.Development)
            {
                return(FileReference.Combine(BaseDir, "Binaries", Platform.ToString(), String.Format("{0}.target", TargetName)));
            }
            else
            {
                return(FileReference.Combine(BaseDir, "Binaries", Platform.ToString(), String.Format("{0}-{1}-{2}{3}.target", TargetName, Platform.ToString(), Configuration.ToString(), ArchitectureSuffix)));
            }
        }
Esempio n. 16
0
        /// <summary>
        /// Return any custom paths for VisualStudio this platform requires
        /// This include ReferencePath, LibraryPath, LibraryWPath, IncludePath and ExecutablePath.
        /// </summary>
        /// <param name="InPlatform">The UnrealTargetPlatform being built</param>
        /// <param name="InConfiguration">The configuration being built</param>
        /// <param name="TargetType">The type of target (game or program)</param>
        /// <param name="TargetRulesPath">Path to the target.cs file</param>
        /// <param name="ProjectFilePath">Path to the project file</param>
        /// <param name="NMakeOutputPath"></param>
        /// <param name="InProjectFileFormat">Format for the generated project files</param>
        /// <param name="ProjectFileBuilder">The project file content</param>
        /// <returns>The custom path lines for the project file; Empty string if it doesn't require one</returns>
        public override void GetVisualStudioPathsEntries(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration, TargetType TargetType, FileReference TargetRulesPath, FileReference ProjectFilePath, FileReference NMakeOutputPath, VCProjectFileFormat InProjectFileFormat, StringBuilder ProjectFileBuilder)
        {
            base.GetVisualStudioPathsEntries(InPlatform, InConfiguration, TargetType, TargetRulesPath, ProjectFilePath, NMakeOutputPath, InProjectFileFormat, ProjectFileBuilder);

            if (IsVSLuminSupportInstalled(InProjectFileFormat) && TargetType == TargetType.Game && InPlatform == UnrealTargetPlatform.Lumin)
            {
                // When generating for a blueprint only project, use the blueprint only project's path to generate the visual studio path entries
                bool bGetEntriesForBlueprintOnlyProject = BPOnlyProjectPath != null;

                string MLSDK = Utils.CleanDirectorySeparators(Environment.GetEnvironmentVariable("MLSDK"), '\\');

                string GameName = bGetEntriesForBlueprintOnlyProject ? BPOnlyProjectPath.GetFileNameWithoutExtension() : TargetRulesPath.GetFileNameWithoutExtension();
                GameName = Path.GetFileNameWithoutExtension(GameName);

                string PackagePath = bGetEntriesForBlueprintOnlyProject ? BPOnlyProjectPath.Directory.FullName + "\\Binaries\\Lumin" : Utils.MakePathRelativeTo(NMakeOutputPath.Directory.FullName, ProjectFilePath.Directory.FullName);
                string PackageFile = PackagePath;
                string PackageName = GameName;
                if (InConfiguration != UnrealTargetConfiguration.Development)
                {
                    PackageName = GameName + "-" + InPlatform.ToString() + "-" + InConfiguration.ToString();
                }
                PackageFile = Path.Combine(PackageFile, PackageName + ".mpk");

                // Can't use $(NMakeOutput) directly since that is defined after <ELFFile> tag and thus ends up being translated as an empty string.
                string ELFFile = bGetEntriesForBlueprintOnlyProject ? PackagePath : Utils.MakePathRelativeTo(NMakeOutputPath.Directory.FullName, ProjectFilePath.Directory.FullName);
                // Provide path to stripped executable so all symbols are resolved from the external sym file instead.
                ELFFile = Path.Combine(ELFFile, "..\\..\\Intermediate\\Lumin\\Mabu\\Binaries", NMakeOutputPath.GetFileName());
                string DebuggerFlavor = "MLDebugger";

                string SymFile = Utils.MakePathRelativeTo(NMakeOutputPath.Directory.FullName, ProjectFilePath.Directory.FullName);
                SymFile = Path.Combine(SymFile, "..\\..\\Intermediate\\Lumin\\Mabu\\Binaries", Path.ChangeExtension(NMakeOutputPath.GetFileName(), ".sym"));

                // following are defaults for debugger options
                string Attach               = "false";
                string EnableAutoStop       = "true";
                string AutoStopAtFunction   = "main";
                string EnablePrettyPrinting = "true";
                string MLDownloadOnStart    = "true";

                string CustomPathEntriesTemplate = "<MLSDK>{0}</MLSDK>" + ProjectFileGenerator.NewLine +
                                                   "<PackageFile>{1}</PackageFile>" + ProjectFileGenerator.NewLine +
                                                   "<ELFFile>{2}</ELFFile>" + ProjectFileGenerator.NewLine +
                                                   "<DebuggerFlavor>{3}</DebuggerFlavor>" + ProjectFileGenerator.NewLine +
                                                   "<Attach>{4}</Attach>" + ProjectFileGenerator.NewLine +
                                                   "<EnableAutoStop>{5}</EnableAutoStop>" + ProjectFileGenerator.NewLine +
                                                   "<AutoStopAtFunction>{6}</AutoStopAtFunction>" + ProjectFileGenerator.NewLine +
                                                   "<EnablePrettyPrinting>{7}</EnablePrettyPrinting>" + ProjectFileGenerator.NewLine +
                                                   "<MLDownloadOnStart>{8}</MLDownloadOnStart>" + ProjectFileGenerator.NewLine;
                // No need to provide SymFile path. The file is automatically picked up when it resides in the same folder and has the same name as the ElfFile
                // "<SymFile>{9}</SymFile>" + ProjectFileGenerator.NewLine;
                ProjectFileBuilder.Append(ProjectFileGenerator.NewLine + string.Format(CustomPathEntriesTemplate, MLSDK, PackageFile, ELFFile, DebuggerFlavor, Attach, EnableAutoStop, AutoStopAtFunction, EnablePrettyPrinting, MLDownloadOnStart));
            }
        }
Esempio n. 17
0
 /**
  *	Register the given platforms UEBuildDeploy instance
  *
  *	@param	InPlatform			The UnrealTargetPlatform to register with
  *	@param	InBuildDeploy		The UEBuildDeploy instance to use for the InPlatform
  */
 public static void RegisterBuildDeploy(UnrealTargetPlatform InPlatform, IUEBuildDeploy InBuildDeploy)
 {
     if (BuildDeployDictionary.ContainsKey(InPlatform) == true)
     {
         Log.TraceWarning("RegisterBuildDeply Warning: Registering build deploy {0} for {1} when it is already set to {2}",
                          InBuildDeploy.ToString(), InPlatform.ToString(), BuildDeployDictionary[InPlatform].ToString());
         BuildDeployDictionary[InPlatform] = InBuildDeploy;
     }
     else
     {
         BuildDeployDictionary.Add(InPlatform, InBuildDeploy);
     }
 }
        /// <summary>
        /// Gets the standard path for an manifest
        /// </summary>
        /// <param name="AppName">The modular app name being built</param>
        /// <param name="Configuration">The target configuration</param>
        /// <param name="Platform">The target platform</param>
        /// <param name="BuildArchitecture">The architecture of the target platform</param>
        /// <param name="bIsGameDirectory"></param>
        /// <returns>Filename for the app receipt</returns>
        public static string GetStandardFileName(string AppName, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, string BuildArchitecture, bool bIsGameDirectory)
        {
            string BaseName = AppName;

            if (Configuration != UnrealTargetConfiguration.Development && !(Configuration == UnrealTargetConfiguration.DebugGame && !bIsGameDirectory))
            {
                BaseName += String.Format("-{0}-{1}", Platform.ToString(), Configuration.ToString());
            }
            if (!String.IsNullOrEmpty(BuildArchitecture) && UEBuildPlatform.GetBuildPlatform(Platform).RequiresArchitectureSuffix())
            {
                BaseName += BuildArchitecture;
            }
            return(String.Format("{0}.modules", BaseName));
        }
Esempio n. 19
0
 /// <summary>
 /// Returns the platform name to use as part of platform-specific config files
 /// </summary>
 public static string GetIniPlatformName(UnrealTargetPlatform TargetPlatform)
 {
     if (TargetPlatform == UnrealTargetPlatform.Win32 || TargetPlatform == UnrealTargetPlatform.Win64)
     {
         return("Windows");
     }
     else if (TargetPlatform == UnrealTargetPlatform.HoloLens)
     {
         return("HoloLens");
     }
     else
     {
         return(TargetPlatform == null ? "None" : TargetPlatform.ToString());
     }
 }
        /// <summary>
        /// Return any custom paths for VisualStudio this platform requires
        /// This include ReferencePath, LibraryPath, LibraryWPath, IncludePath and ExecutablePath.
        /// </summary>
        /// <param name="InPlatform">The UnrealTargetPlatform being built</param>
        /// <param name="InConfiguration">The configuration being built</param>
        /// <param name="TargetType">The type of target (game or program)</param>
        /// <param name="TargetRulesPath">Path to the target.cs file</param>
        /// <param name="ProjectFilePath">Path to the project file</param>
        /// <param name="NMakeOutputPath"></param>
        /// <param name="InProjectFileFormat">Format for the generated project files</param>
        /// <param name="ProjectFileBuilder">The project file content</param>
        /// <returns>The custom path lines for the project file; Empty string if it doesn't require one</returns>
        public override void GetVisualStudioPathsEntries(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration, TargetType TargetType, FileReference TargetRulesPath, FileReference ProjectFilePath, FileReference NMakeOutputPath, VCProjectFileFormat InProjectFileFormat, StringBuilder ProjectFileBuilder)
        {
            base.GetVisualStudioPathsEntries(InPlatform, InConfiguration, TargetType, TargetRulesPath, ProjectFilePath, NMakeOutputPath, InProjectFileFormat, ProjectFileBuilder);

            if (IsVSLuminSupportInstalled(InProjectFileFormat) && TargetType == TargetType.Game && InPlatform == UnrealTargetPlatform.Lumin)
            {
                string MLSDK = Utils.CleanDirectorySeparators(Environment.GetEnvironmentVariable("MLSDK"), '\\');

                // TODO: Check if MPK name can be other than the project name.
                string GameName = TargetRulesPath.GetFileNameWithoutExtension();
                GameName = Path.GetFileNameWithoutExtension(GameName);

                string PackageFile = Utils.MakePathRelativeTo(NMakeOutputPath.Directory.FullName, ProjectFilePath.Directory.FullName);
                string PackageName = GameName;
                if (InConfiguration != UnrealTargetConfiguration.Development)
                {
                    PackageName = GameName + "-" + InPlatform.ToString() + "-" + InConfiguration.ToString();
                }
                PackageFile = Path.Combine(PackageFile, PackageName + ".mpk");

                // TODO: Fix NMakeOutput to have the the correct architecture name and then set ELFFile to $(NMakeOutput)
                string ELFFile = Utils.MakePathRelativeTo(NMakeOutputPath.Directory.FullName, ProjectFilePath.Directory.FullName);
                ELFFile = Path.Combine(ELFFile, "..\\..\\Intermediate\\Lumin\\Mabu\\Packaged\\bin\\" + GameName);
                string DebuggerFlavor = "MLDebugger";

                string SymFile = Utils.MakePathRelativeTo(NMakeOutputPath.Directory.FullName, ProjectFilePath.Directory.FullName);
                SymFile = Path.Combine(SymFile, "..\\..\\Intermediate\\Lumin\\Mabu\\Binaries", Path.ChangeExtension(NMakeOutputPath.GetFileName(), ".sym"));

                // following are defaults for debugger options
                string Attach               = "false";
                string EnableAutoStop       = "true";
                string AutoStopAtFunction   = "main";
                string EnablePrettyPrinting = "true";
                string MLDownloadOnStart    = "true";

                string CustomPathEntriesTemplate = "<MLSDK>{0}</MLSDK>" + ProjectFileGenerator.NewLine +
                                                   "<PackageFile>{1}</PackageFile>" + ProjectFileGenerator.NewLine +
                                                   "<ELFFile>{2}</ELFFile>" + ProjectFileGenerator.NewLine +
                                                   "<DebuggerFlavor>{3}</DebuggerFlavor>" + ProjectFileGenerator.NewLine +
                                                   "<Attach>{4}</Attach>" + ProjectFileGenerator.NewLine +
                                                   "<EnableAutoStop>{5}</EnableAutoStop>" + ProjectFileGenerator.NewLine +
                                                   "<AutoStopAtFunction>{6}</AutoStopAtFunction>" + ProjectFileGenerator.NewLine +
                                                   "<EnablePrettyPrinting>{7}</EnablePrettyPrinting>" + ProjectFileGenerator.NewLine +
                                                   "<MLDownloadOnStart>{8}</MLDownloadOnStart>" + ProjectFileGenerator.NewLine +
                                                   "<SymFile>{9}</SymFile>" + ProjectFileGenerator.NewLine;
                ProjectFileBuilder.Append(ProjectFileGenerator.NewLine + string.Format(CustomPathEntriesTemplate, MLSDK, PackageFile, ELFFile, DebuggerFlavor, Attach, EnableAutoStop, AutoStopAtFunction, EnablePrettyPrinting, MLDownloadOnStart, SymFile));
            }
        }
Esempio n. 21
0
        /// <summary>
        /// Return the VisualStudio platform name for this build platform
        /// </summary>
        /// <param name="InPlatform">  The UnrealTargetPlatform being built</param>
        /// <param name="InConfiguration"> The UnrealTargetConfiguration being built</param>
        /// <returns>string    The name of the platform that VisualStudio recognizes</returns>
        public override string GetVisualStudioPlatformName(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration)
        {
            string PlatformName = InPlatform.ToString();

            if (InPlatform == UnrealTargetPlatform.Android)
            {
                if (IsVSAndroidSupportInstalled())
                {
                    PlatformName = "ARM";
                }
                else
                {
                    PlatformName = "Tegra-Android";
                }
            }

            return(PlatformName);
        }
        /**
         *	Register the given platforms UEPlatformProjectGenerator instance
         *
         *	@param	InPlatform			The UnrealTargetPlatform to register with
         *	@param	InProjectGenerator	The UEPlatformProjectGenerator instance to use for the InPlatform
         */
        public static void RegisterPlatformProjectGenerator(UnrealTargetPlatform InPlatform, UEPlatformProjectGenerator InProjectGenerator)
        {
            // Make sure the build platform is legal
            var BuildPlatform = UEBuildPlatform.GetBuildPlatform(InPlatform, true);

            if (BuildPlatform != null)
            {
                if (ProjectGeneratorDictionary.ContainsKey(InPlatform) == true)
                {
                    Log.TraceInformation("RegisterPlatformProjectGenerator Warning: Registering project generator {0} for {1} when it is already set to {2}",
                                         InProjectGenerator.ToString(), InPlatform.ToString(), ProjectGeneratorDictionary[InPlatform].ToString());
                    ProjectGeneratorDictionary[InPlatform] = InProjectGenerator;
                }
                else
                {
                    ProjectGeneratorDictionary.Add(InPlatform, InProjectGenerator);
                }
            }
            else
            {
                Log.TraceVerbose("Skipping project file generator registration for {0} due to no valid BuildPlatform.", InPlatform.ToString());
            }
        }
Esempio n. 23
0
        /// <summary>
        /// Get the default path for a target's version file.
        /// </summary>
        /// <param name="OutputDirectory">The output directory for the executable. For MacOS, this is the directory containing the app bundle.</param>
        /// <param name="TargetName">Name of the target being built</param>
        /// <param name="Platform">Platform the target is being built for</param>
        /// <param name="Configuration">The configuration being built</param>
        /// <param name="Architecture">Architecture of the target being built</param>
        /// <returns>Path to the target's version file</returns>
        public static FileReference GetFileNameForTarget(DirectoryReference OutputDirectory, string TargetName, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, string Architecture)
        {
            // Get the architecture suffix. Platforms have the option of overriding whether to include this string in filenames.
            string ArchitectureSuffix = "";

            if (UEBuildPlatform.GetBuildPlatform(Platform).RequiresArchitectureSuffix())
            {
                ArchitectureSuffix = Architecture;
            }

            // Build the output filename
            if (String.IsNullOrEmpty(ArchitectureSuffix) && Configuration == UnrealTargetConfiguration.Development)
            {
                return(FileReference.Combine(OutputDirectory, String.Format("{0}.version", TargetName)));
            }
            else
            {
                return(FileReference.Combine(OutputDirectory, String.Format("{0}-{1}-{2}{3}.version", TargetName, Platform.ToString(), Configuration.ToString(), ArchitectureSuffix)));
            }
        }
Esempio n. 24
0
        /**
         *	Retrieve the CPPTargetPlatform for the given UnrealTargetPlatform
         *
         *	@param	InUnrealTargetPlatform		The UnrealTargetPlatform being build
         *
         *	@return	CPPTargetPlatform			The CPPTargetPlatform to compile for
         */
        public override CPPTargetPlatform GetCPPTargetPlatform(UnrealTargetPlatform InUnrealTargetPlatform)
        {
            switch (InUnrealTargetPlatform)
            {
            case UnrealTargetPlatform.WinRT:
                return(CPPTargetPlatform.WinRT);

            case UnrealTargetPlatform.WinRT_ARM:
                return(CPPTargetPlatform.WinRT_ARM);
            }
            throw new BuildException("WinRTPlatform::GetCPPTargetPlatform: Invalid request for {0}", InUnrealTargetPlatform.ToString());
        }
Esempio n. 25
0
 /**
  *	Retrieve the CPPTargetPlatform for the given UnrealTargetPlatform
  *
  *	@param	InUnrealTargetPlatform		The UnrealTargetPlatform being build
  *
  *	@return	CPPTargetPlatform			The CPPTargetPlatform to compile for
  */
 public override CPPTargetPlatform GetCPPTargetPlatform(UnrealTargetPlatform InUnrealTargetPlatform)
 {
     switch (InUnrealTargetPlatform)
     {
     case UnrealTargetPlatform.Linux:
         return(CPPTargetPlatform.Linux);
     }
     throw new BuildException("LinuxPlatform::GetCPPTargetPlatform: Invalid request for {0}", InUnrealTargetPlatform.ToString());
 }
 /**
  *	Retrieve the UEPlatformProjectGenerator instance for the given TargetPlatform
  *
  *	@param	InPlatform					The UnrealTargetPlatform being built
  *	@param	bInAllowFailure				If true, do not throw an exception and return null
  *
  *	@return	UEPlatformProjectGenerator	The instance of the project generator
  */
 public static UEPlatformProjectGenerator GetPlatformProjectGenerator(UnrealTargetPlatform InPlatform, bool bInAllowFailure = false)
 {
     if (ProjectGeneratorDictionary.ContainsKey(InPlatform) == true)
     {
         return(ProjectGeneratorDictionary[InPlatform]);
     }
     if (bInAllowFailure == true)
     {
         return(null);
     }
     throw new BuildException("GetPlatformProjectGenerator: No PlatformProjectGenerator found for {0}", InPlatform.ToString());
 }
 /**
  *	Return the VisualStudio platform name for this build platform
  *
  *	@param	InPlatform			The UnrealTargetPlatform being built
  *	@param	InConfiguration		The UnrealTargetConfiguration being built
  *
  *	@return	string				The name of the platform that VisualStudio recognizes
  */
 public virtual string GetVisualStudioPlatformName(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration)
 {
     // By default, return the platform string
     return(InPlatform.ToString());
 }
 public static DirectoryReference GetUBTMakefileDirectory(FileReference ProjectFile, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, string TargetName)
 {
     // If there's only one target, just save the UBTMakefile in the target's build intermediate directory
     // under a folder for that target (and platform/config combo.)
     if (ProjectFile != null)
     {
         return(DirectoryReference.Combine(ProjectFile.Directory, "Intermediate", "Build", Platform.ToString(), TargetName, Configuration.ToString()));
     }
     else
     {
         return(DirectoryReference.Combine(UnrealBuildTool.EngineDirectory, "Intermediate", "Build", Platform.ToString(), TargetName, Configuration.ToString()));
     }
 }
Esempio n. 29
0
 /// <summary>
 /// Retrieve the IUEBuildPlatform instance for the given TargetPlatform
 /// </summary>
 /// <param name="InPlatform">  The UnrealTargetPlatform being built</param>
 /// <param name="bInAllowFailure"> If true, do not throw an exception and return null</param>
 /// <returns>UEBuildPlatform  The instance of the build platform</returns>
 public static UEBuildPlatform GetBuildPlatform(UnrealTargetPlatform InPlatform, bool bInAllowFailure = false)
 {
     if (BuildPlatformDictionary.ContainsKey(InPlatform) == true)
     {
         return(BuildPlatformDictionary[InPlatform]);
     }
     if (bInAllowFailure == true)
     {
         return(null);
     }
     throw new BuildException("GetBuildPlatform: No BuildPlatform found for {0}", InPlatform.ToString());
 }
Esempio n. 30
0
 /// <summary>
 /// Returns the name that should be returned in the output when doing -validateplatforms
 /// </summary>
 public virtual string GetPlatformValidationName()
 {
     return(Platform.ToString());
 }