当前位置: 首页>>代码示例>>C#>>正文


C# UEBuildTarget.GetTargetName方法代码示例

本文整理汇总了C#中UnrealBuildTool.UEBuildTarget.GetTargetName方法的典型用法代码示例。如果您正苦于以下问题:C# UEBuildTarget.GetTargetName方法的具体用法?C# UEBuildTarget.GetTargetName怎么用?C# UEBuildTarget.GetTargetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnrealBuildTool.UEBuildTarget的用法示例。


在下文中一共展示了UEBuildTarget.GetTargetName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UHTManifest

        public string TargetName; // Name of the target currently being compiled

        #endregion Fields

        #region Constructors

        public UHTManifest(UEBuildTarget Target, string InRootLocalPath, string InRootBuildPath, IEnumerable<UHTModuleInfo> ModuleInfo)
        {
            IsGameTarget  = TargetRules.IsGameType(Target.TargetType);
            RootLocalPath = InRootLocalPath;
            RootBuildPath = InRootBuildPath;
            TargetName    = Target.GetTargetName();

            Modules = ModuleInfo.Select(Info => new Module
            {
                Name                     = Info.ModuleName,
                ModuleType				 = Info.ModuleType,
                BaseDirectory            = Info.ModuleDirectory,
                IncludeBase              = Info.ModuleDirectory,
                OutputDirectory          = Path.GetDirectoryName( Info.GeneratedCPPFilenameBase ),
                ClassesHeaders           = Info.PublicUObjectClassesHeaders.Select((Header) => Header.AbsolutePath).ToList(),
                PublicHeaders            = Info.PublicUObjectHeaders       .Select((Header) => Header.AbsolutePath).ToList(),
                PrivateHeaders           = Info.PrivateUObjectHeaders      .Select((Header) => Header.AbsolutePath).ToList(),
                PCH                      = Info.PCH,
                GeneratedCPPFilenameBase = Info.GeneratedCPPFilenameBase,
                SaveExportedHeaders      = !UnrealBuildTool.IsEngineInstalled() || !Utils.IsFileUnderDirectory(Info.ModuleDirectory, BuildConfiguration.RelativeEnginePath),
                UHTGeneratedCodeVersion = Info.GeneratedCodeVersion,
            }).ToList();
        }
开发者ID:colwalder,项目名称:unrealengine,代码行数:29,代码来源:ExternalExecution.cs

示例2: GeneratePathForTarget

 /// <summary>
 /// Generates a full path to action history file for the specified target.
 /// </summary>
 public static string GeneratePathForTarget(UEBuildTarget Target)
 {
     string Folder = null;
     if (Target.ShouldCompileMonolithic() || Target.Rules.Type == TargetRules.TargetType.Program)
     {
         // Monolithic configs and programs have their Action History stored in their respective project folders
         // or under engine intermediate folder + program name folder
         string RootDirectory = UnrealBuildTool.GetUProjectPath();
         if (String.IsNullOrEmpty(RootDirectory))
         {
             RootDirectory = Path.GetFullPath(BuildConfiguration.RelativeEnginePath);
         }
         Folder = Path.Combine(RootDirectory, BuildConfiguration.PlatformIntermediateFolder, Target.GetTargetName());
     }
     else
     {
         // Shared action history (unless this is a rocket target)
         Folder = UnrealBuildTool.RunningRocket() ?
             Path.Combine(UnrealBuildTool.GetUProjectPath(), BuildConfiguration.BaseIntermediateFolder) :
             BuildConfiguration.BaseIntermediatePath;
     }
     return Path.Combine(Folder, "ActionHistory.bin").Replace("\\", "/");
 }
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:26,代码来源:ActionHistory.cs

示例3: UHTManifest

        public string TargetName; // Name of the target currently being compiled

        #endregion Fields

        #region Constructors

        public UHTManifest(UEBuildTarget Target, string InRootLocalPath, string InRootBuildPath, IEnumerable<UHTModuleInfo> ModuleInfo)
        {
            IsGameTarget  = TargetRules.IsGameType(Target.TargetType);
            RootLocalPath = InRootLocalPath;
            RootBuildPath = InRootBuildPath;
            TargetName    = Target.GetTargetName();

            Modules = ModuleInfo.Select(Info => new Module{
                Name                     = Info.ModuleName,
                ModuleType				 = Info.ModuleType,
                BaseDirectory            = Info.ModuleDirectory,
                IncludeBase              = Info.ModuleDirectory,
                OutputDirectory          = Path.GetDirectoryName( Info.GeneratedCPPFilenameBase ),
                ClassesHeaders           = Info.PublicUObjectClassesHeaders.Select((Header) => Header.AbsolutePath).ToList(),
                PublicHeaders            = Info.PublicUObjectHeaders       .Select((Header) => Header.AbsolutePath).ToList(),
                PrivateHeaders           = Info.PrivateUObjectHeaders      .Select((Header) => Header.AbsolutePath).ToList(),
                PCH                      = Info.PCH,
                GeneratedCPPFilenameBase = Info.GeneratedCPPFilenameBase,
                //@todo.Rocket: This assumes Engine/Source is a 'safe' folder name to check for
                SaveExportedHeaders = !UnrealBuildTool.RunningRocket() || !Info.ModuleDirectory.Contains("Engine\\Source\\")

            }).ToList();
        }
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:29,代码来源:ExternalExecution.cs

示例4: GetDependencyCachePathForTarget

		/// <summary>
		/// Gets the dependency cache path and filename for the specified target.
		/// </summary>
		/// <param name="Target">Current build target</param>
		/// <returns>Cache Path</returns>
		public static string GetDependencyCachePathForTarget(UEBuildTarget Target)
		{
			string PlatformIntermediatePath = BuildConfiguration.PlatformIntermediatePath;
			if (UnrealBuildTool.HasUProjectFile())
			{
				PlatformIntermediatePath = Path.Combine(UnrealBuildTool.GetUProjectPath(), BuildConfiguration.PlatformIntermediateFolder);
			}
			string CachePath = Path.Combine(PlatformIntermediatePath, Target.GetTargetName(), "DependencyCache.bin");
			return CachePath;
		}
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:15,代码来源:DependencyCache.cs

示例5: GatherAllOutdatedActions

        /**
         * Builds a dictionary containing the actions from AllActions that are outdated by calling
         * IsActionOutdated.
         */
        static void GatherAllOutdatedActions(UEBuildTarget Target, ActionHistory ActionHistory, ref Dictionary<Action,bool> OutdatedActions, Dictionary<UEBuildTarget, List<FileItem>> TargetToOutdatedPrerequisitesMap )
        {
            var CheckOutdatednessStartTime = DateTime.UtcNow;

            foreach (var Action in AllActions)
            {
                IsActionOutdated(Target, Action, ref OutdatedActions, ActionHistory, TargetToOutdatedPrerequisitesMap);
            }

            if( BuildConfiguration.bPrintPerformanceInfo )
            {
                var CheckOutdatednessTime = (DateTime.UtcNow - CheckOutdatednessStartTime).TotalSeconds;
                Log.TraceInformation( "Checking actions for " + Target.GetTargetName() + " took " + CheckOutdatednessTime + "s" );
            }
        }
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:19,代码来源:ActionGraph.cs

示例6: ExecuteHeaderToolIfNecessary

        /**
         * Builds and runs the header tool and touches the header directories.
         * Performs any early outs if headers need no changes, given the UObject modules, tool path, game name, and configuration
         */
        public static bool ExecuteHeaderToolIfNecessary( UEBuildTarget Target, CPPEnvironment GlobalCompileEnvironment, List<UHTModuleInfo> UObjectModules, string ModuleInfoFileName, ref ECompilationResult UHTResult )
        {
            if(ProgressWriter.bWriteMarkup)
            {
                Log.WriteLine(TraceEventType.Information, "@progress push 5%");
            }
            using (ProgressWriter Progress = new ProgressWriter("Generating code...", false))
            {
                // We never want to try to execute the header tool when we're already trying to build it!
                var bIsBuildingUHT = Target.GetTargetName().Equals( "UnrealHeaderTool", StringComparison.InvariantCultureIgnoreCase );

                var BuildPlatform = UEBuildPlatform.GetBuildPlatform(Target.Platform);
                var CppPlatform = BuildPlatform.GetCPPTargetPlatform(Target.Platform);
                var ToolChain = UEToolChain.GetPlatformToolChain(CppPlatform);
                var RootLocalPath  = Path.GetFullPath(ProjectFileGenerator.RootRelativePath);

                // check if UHT is out of date
                DateTime HeaderToolTimestamp = DateTime.MaxValue;
                bool bHaveHeaderTool = !bIsBuildingUHT && GetHeaderToolTimestamp(out HeaderToolTimestamp);

                // ensure the headers are up to date
                bool bUHTNeedsToRun = (UEBuildConfiguration.bForceHeaderGeneration == true || !bHaveHeaderTool || AreGeneratedCodeFilesOutOfDate(UObjectModules, HeaderToolTimestamp));
                if( bUHTNeedsToRun || UnrealBuildTool.IsGatheringBuild )
                {
                    // Since code files are definitely out of date, we'll now finish computing information about the UObject modules for UHT.  We
                    // want to save this work until we know that UHT actually needs to be run to speed up best-case iteration times.
                    if( UnrealBuildTool.IsGatheringBuild )		// In assembler-only mode, PCH info is loaded from our UBTMakefile!
                    {
                        foreach( var UHTModuleInfo in UObjectModules )
                        {
                            // Only cache the PCH name if we don't already have one.  When running in 'gather only' mode, this will have already been cached
                            if( string.IsNullOrEmpty( UHTModuleInfo.PCH ) )
                            {
                                UHTModuleInfo.PCH = "";

                                // We need to figure out which PCH header this module is including, so that UHT can inject an include statement for it into any .cpp files it is synthesizing
                                var DependencyModuleCPP = (UEBuildModuleCPP)Target.GetModuleByName( UHTModuleInfo.ModuleName );
                                var ModuleCompileEnvironment = DependencyModuleCPP.CreateModuleCompileEnvironment(GlobalCompileEnvironment);
                                DependencyModuleCPP.CachePCHUsageForModuleSourceFiles(ModuleCompileEnvironment);
                                if (DependencyModuleCPP.ProcessedDependencies.UniquePCHHeaderFile != null)
                                {
                                    UHTModuleInfo.PCH = DependencyModuleCPP.ProcessedDependencies.UniquePCHHeaderFile.AbsolutePath;
                                }
                            }
                        }
                    }
                }

                // @todo ubtmake: Optimization: Ideally we could avoid having to generate this data in the case where UHT doesn't even need to run!  Can't we use the existing copy?  (see below use of Manifest)
                UHTManifest Manifest = new UHTManifest(Target, RootLocalPath, ToolChain.ConvertPath(RootLocalPath + '\\'), UObjectModules);

                if( !bIsBuildingUHT && bUHTNeedsToRun )
                {
                    // Always build UnrealHeaderTool if header regeneration is required, unless we're running within a Rocket ecosystem or hot-reloading
                    if (UnrealBuildTool.RunningRocket() == false &&
                        UEBuildConfiguration.bDoNotBuildUHT == false &&
                        UEBuildConfiguration.bHotReloadFromIDE == false &&
                        !( bHaveHeaderTool && !UnrealBuildTool.IsGatheringBuild && UnrealBuildTool.IsAssemblingBuild ) )	// If running in "assembler only" mode, we assume UHT is already up to date for much faster iteration!
                    {
                        // If it is out of date or not there it will be built.
                        // If it is there and up to date, it will add 0.8 seconds to the build time.
                        Log.TraceInformation("Building UnrealHeaderTool...");

                        var UBTArguments = new StringBuilder();

                        UBTArguments.Append( "UnrealHeaderTool" );

                        // Which desktop platform do we need to compile UHT for?
                        UBTArguments.Append(" " + BuildHostPlatform.Current.Platform.ToString());
                        // NOTE: We force Development configuration for UHT so that it runs quickly, even when compiling debug
                        UBTArguments.Append( " " + UnrealTargetConfiguration.Development.ToString() );

                        // NOTE: We disable mutex when launching UBT from within UBT to compile UHT
                        UBTArguments.Append( " -NoMutex" );

                        if (UnrealBuildTool.CommandLineContains("-noxge"))
                        {
                            UBTArguments.Append(" -noxge");
                        }

                        if ( RunExternalExecutable( UnrealBuildTool.GetUBTPath(), UBTArguments.ToString() ) != 0 )
                        {
                            return false;
                        }
                    }

                    Progress.Write(1, 3);

                    var ActualTargetName = String.IsNullOrEmpty( Target.GetTargetName() ) ? "UE4" : Target.GetTargetName();
                    Log.TraceInformation( "Parsing headers for {0}", ActualTargetName );

                    string HeaderToolPath = GetHeaderToolPath();
                    if (!File.Exists(HeaderToolPath))
                    {
                        throw new BuildException( "Unable to generate headers because UnrealHeaderTool binary was not found ({0}).", Path.GetFullPath( HeaderToolPath ) );
                    }
//.........这里部分代码省略.........
开发者ID:colwalder,项目名称:unrealengine,代码行数:101,代码来源:ExternalExecution.cs

示例7: GetDependencyCachePathForTarget

		/// <summary>
		/// Gets the dependency cache path and filename for the specified target.
		/// </summary>
		/// <param name="Target">Current build target</param>
		/// <returns>Cache Path</returns>
		public static FileReference GetDependencyCachePathForTarget(UEBuildTarget Target)
		{
			DirectoryReference PlatformIntermediatePath;
			if (Target.ProjectFile != null)
			{
				PlatformIntermediatePath = DirectoryReference.Combine(Target.ProjectFile.Directory, BuildConfiguration.PlatformIntermediateFolder);
			}
			else
			{
				PlatformIntermediatePath = new DirectoryReference(BuildConfiguration.PlatformIntermediatePath);
			}
			return FileReference.Combine(PlatformIntermediatePath, Target.GetTargetName(), "FlatCPPIncludes.bin");
		}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:18,代码来源:FlatCPPIncludeDepencencyCache.cs

示例8: ExecuteHeaderToolIfNecessary

        /**
         * Builds and runs the header tool and touches the header directories.
         * Performs any early outs if headers need no changes, given the UObject modules, tool path, game name, and configuration
         */
        public static bool ExecuteHeaderToolIfNecessary( UEBuildTarget Target, List<UHTModuleInfo> UObjectModules, string ModuleInfoFileName )
        {
            bool bSuccess = true;

            // We never want to try to execute the header tool when we're already trying to build it!
            var bIsBuildingUHT = Target.GetTargetName().Equals( "UnrealHeaderTool", StringComparison.InvariantCultureIgnoreCase );
            var BuildPlatform = UEBuildPlatform.GetBuildPlatform(Target.Platform);
            var CppPlatform = BuildPlatform.GetCPPTargetPlatform(Target.Platform);
            var ToolChain = UEToolChain.GetPlatformToolChain(CppPlatform);
            var RootLocalPath = Path.GetFullPath(ProjectFileGenerator.RootRelativePath);
            var Manifest = new UHTManifest(UnrealBuildTool.BuildingRocket() || UnrealBuildTool.RunningRocket(), Target, RootLocalPath, ToolChain.ConvertPath(RootLocalPath + '\\'), UObjectModules);

            // ensure the headers are up to date
            if (!bIsBuildingUHT &&
                (UEBuildConfiguration.bForceHeaderGeneration == true || AreGeneratedCodeFilesOutOfDate(Target, UObjectModules)))
            {
             				// Always build UnrealHeaderTool if header regeneration is required, unless we're running within a Rocket ecosystem
                if (UnrealBuildTool.RunningRocket() == false && UEBuildConfiguration.bDoNotBuildUHT == false)
                {
                    // If it is out of date or not there it will be built.
                    // If it is there and up to date, it will add 0.8 seconds to the build time.
                    Log.TraceInformation("Building UnrealHeaderTool...");

                    var UBTArguments = new StringBuilder();

                    UBTArguments.Append( "UnrealHeaderTool" );

                    // Which desktop platform do we need to compile UHT for?
                    var UHTPlatform = UnrealTargetPlatform.Win64;
                    if( Utils.IsRunningOnMono )
                    {
                        UHTPlatform = UnrealTargetPlatform.Mac;
                    }
                    UBTArguments.Append( " " + UHTPlatform.ToString() );

                    // NOTE: We force Development configuration for UHT so that it runs quickly, even when compiling debug
                    UBTArguments.Append( " " + UnrealTargetConfiguration.Development.ToString() );

                    // NOTE: We disable mutex when launching UBT from within UBT to compile UHT
                    UBTArguments.Append( " -NoMutex" );

                    if (UnrealBuildTool.CommandLineContains("-noxge"))
                    {
                        UBTArguments.Append(" -noxge");
                    }

                    bSuccess = RunExternalExecutable( UnrealBuildTool.GetUBTPath(), UBTArguments.ToString() );
                }

                if( bSuccess )
                {
                    var ActualTargetName = String.IsNullOrEmpty( Target.GetTargetName() ) ? "UE4" : Target.GetTargetName();
                    Log.TraceInformation( "Parsing headers for {0}", ActualTargetName );

                    string HeaderToolPath = GetHeaderToolPath();
                    if (!File.Exists(HeaderToolPath))
                    {
                        throw new BuildException( "Unable to generate headers because UnrealHeaderTool binary was not found ({0}).", Path.GetFullPath( HeaderToolPath ) );
                    }

                    // Disable extensions when serializing to remove the $type fields
                    Directory.CreateDirectory(Path.GetDirectoryName(ModuleInfoFileName));
                    System.IO.File.WriteAllText(ModuleInfoFileName, fastJSON.JSON.Instance.ToJSON(Manifest, new fastJSON.JSONParameters{ UseExtensions = false }));

                    string CmdLine = (UnrealBuildTool.HasUProjectFile()) ? "\"" + UnrealBuildTool.GetUProjectFile() + "\"" : Target.GetTargetName();
                    CmdLine += " \"" + ModuleInfoFileName + "\" -LogCmds=\"loginit warning, logexit warning, logdatabase error\"";
                    if (UnrealBuildTool.RunningRocket())
                    {
                        CmdLine += " -rocket -installed";
                    }

                    if (UEBuildConfiguration.bFailIfGeneratedCodeChanges)
                    {
                        CmdLine += " -FailIfGeneratedCodeChanges";
                    }

                    Stopwatch s = new Stopwatch();
                    s.Start();
                    bSuccess = RunExternalExecutable(ExternalExecution.GetHeaderToolPath(), CmdLine);
                    s.Stop();

                    if (bSuccess)
                    {
                        //if( BuildConfiguration.bPrintDebugInfo )
                        {
                            Log.TraceInformation( "Code generation finished for {0} and took {1}", ActualTargetName, (double)s.ElapsedMilliseconds/1000.0 );
                        }

                        // Now that UHT has successfully finished generating code, we need to update all cached FileItems in case their last write time has changed.
                        // Otherwise UBT might not detect changes UHT made.
                        DateTime StartTime = DateTime.UtcNow;
                        FileItem.ResetInfos();
                        double ResetDuration = (DateTime.UtcNow - StartTime).TotalSeconds;
                        Log.TraceVerbose("FileItem.ResetInfos() duration: {0}s", ResetDuration);
                    }
                    else
//.........这里部分代码省略.........
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:101,代码来源:ExternalExecution.cs

示例9: GetGeneratedCodeDirectoryForModule

        /// <summary>
        /// Determines where generated code files will be stored for this module
        /// </summary>
        /// <param name="ModuleDirectory">Module's base directory</param>
        /// <param name="ModuleName">Name of module</param>
        /// <returns></returns>
        public static string GetGeneratedCodeDirectoryForModule(UEBuildTarget Target, string ModuleDirectory, string ModuleName)
        {
            string BaseDirectory = null;
            if ((Target.ShouldCompileMonolithic() || Target.Rules.Type == TargetRules.TargetType.Program) &&
                (!UnrealBuildTool.BuildingRocket()) &&
                (!UnrealBuildTool.RunningRocket() || Utils.IsFileUnderDirectory(ModuleDirectory, UnrealBuildTool.GetUProjectPath())))
            {
                // Monolithic configurations and programs have their intermediate headers stored under their
                // respective project folders with the exception of rocket which always stores engine modules in the engine folder.
                string RootDirectory = UnrealBuildTool.GetUProjectPath();
                if (String.IsNullOrEmpty(RootDirectory))
                {
                    // Intermediates under Engine intermediate folder (program name will be appended later)
                    RootDirectory = Path.GetFullPath(BuildConfiguration.RelativeEnginePath);
                }
                BaseDirectory = Path.Combine(RootDirectory, BuildConfiguration.PlatformIntermediateFolder, Target.GetTargetName());
            }
            else if (Plugins.IsPluginModule(ModuleName))
            {
                // Plugin module
                BaseDirectory = Path.Combine(Plugins.GetPluginInfoForModule(ModuleName).Directory, BuildConfiguration.PlatformIntermediateFolder);
            }
            else
            {
                var AllProjectFolders = UEBuildTarget.DiscoverAllGameFolders();
                BaseDirectory = AllProjectFolders.Find(ProjectFolder => Utils.IsFileUnderDirectory( ModuleDirectory, ProjectFolder ));
                if (BaseDirectory == null)
                {
                    // Must be an engine module or program module
                    BaseDirectory = ProjectFileGenerator.EngineRelativePath;
                }

                BaseDirectory = Path.GetFullPath(Path.Combine(BaseDirectory, BuildConfiguration.PlatformIntermediateFolder));
            }

            // Construct the intermediate path.
            var GeneratedCodeDirectory = Path.Combine(BaseDirectory, "Inc", ModuleName);
            return GeneratedCodeDirectory + Path.DirectorySeparatorChar;
        }
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:45,代码来源:UEBuildModule.cs

示例10: GeneratePathForTarget

		/// <summary>
		/// Generates a full path to action history file for the specified target.
		/// </summary>
		public static FileReference GeneratePathForTarget(UEBuildTarget Target)
		{
			DirectoryReference Folder = null;
			if (Target.ShouldCompileMonolithic() || Target.TargetType == TargetRules.TargetType.Program)
			{
				// Monolithic configs and programs have their Action History stored in their respective project folders
				// or under engine intermediate folder + program name folder
				DirectoryReference RootDirectory;
				if (Target.ProjectFile != null)
				{
					RootDirectory = Target.ProjectFile.Directory;
				}
				else
				{
					RootDirectory = UnrealBuildTool.EngineDirectory;
				}
				Folder = DirectoryReference.Combine(RootDirectory, BuildConfiguration.PlatformIntermediateFolder, Target.GetTargetName());
			}
			else
			{
				// Shared action history (unless this is an installed build target)
				Folder = (UnrealBuildTool.IsEngineInstalled() && Target.ProjectFile != null) ?
					DirectoryReference.Combine(Target.ProjectFile.Directory, BuildConfiguration.BaseIntermediateFolder) :
					DirectoryReference.Combine(UnrealBuildTool.EngineDirectory, BuildConfiguration.BaseIntermediateFolder);
			}
			return FileReference.Combine(Folder, "ActionHistory.bin");
		}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:30,代码来源:ActionHistory.cs


注:本文中的UnrealBuildTool.UEBuildTarget.GetTargetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。