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


C# UnrealBuildTool.FileItem类代码示例

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


FileItem类属于UnrealBuildTool命名空间,在下文中一共展示了FileItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Load

		/// <summary>
		/// Loads the cache from disk
		/// </summary>
		/// <param name="Cache">The file to load</param>
		/// <returns>The loaded instance</returns>
		public static FlatCPPIncludeDependencyCache Load(FileItem Cache)
		{
			FlatCPPIncludeDependencyCache Result = null;
			try
			{
				using (FileStream Stream = new FileStream(Cache.AbsolutePath, FileMode.Open, FileAccess.Read))
				{	
					// @todo ubtmake: We can store the cache in a cheaper/smaller way using hash file names and indices into included headers, but it might actually slow down load times
					// @todo ubtmake: If we can index PCHs here, we can avoid storing all of the PCH's included headers (PCH's action should have been invalidated, so we shouldn't even have to report the PCH's includes as our indirect includes)
					BinaryFormatter Formatter = new BinaryFormatter();
					Result = Formatter.Deserialize(Stream) as FlatCPPIncludeDependencyCache;
					Result.CacheFileItem = Cache;
					Result.bIsDirty = false;
				}
			}
			catch (Exception Ex)
			{
				// Don't bother failing if the file format has changed, simply abort the cache load
				if (Ex.Message.Contains( "cannot be converted to type" ))	// To catch serialization differences added when we added the DependencyInfo struct
				{
					Console.Error.WriteLine("Failed to read FlatCPPIncludeDependencyCache: {0}", Ex.Message);
				}
			}
			return Result;
		}
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:30,代码来源:FlatCPPIncludeDepencencyCache.cs

示例2: GenerateDebugInfo

        /**
         * Generates debug info for a given executable
         *
         * @param Executable FileItem describing the executable to generate debug info for
         */
        public static FileItem GenerateDebugInfo(FileItem Executable)
        {
            // Make a file item for the source and destination files
            string FullDestPathRoot = Executable.AbsolutePath + ".app.dSYM";
            string FullDestPath = FullDestPathRoot;
            FileItem DestFile = FileItem.GetRemoteItemByPath(FullDestPath, UnrealTargetPlatform.IOS);

            // Make the compile action
            Action GenDebugAction = new Action(ActionType.GenerateDebugInfo);
            if (!Utils.IsRunningOnMono)
            {
                GenDebugAction.ActionHandler = new Action.BlockingActionHandler(RPCUtilHelper.RPCActionHandler);
            }
            GenDebugAction.WorkingDirectory = GetMacDevSrcRoot();
            GenDebugAction.CommandPath = "sh";

            // note that the source and dest are switched from a copy command
            GenDebugAction.CommandArguments = string.Format("-c '{0}/usr/bin/dsymutil {1} -o {2}; cd {2}/..; zip -r -y -1 {3}.app.dSYM.zip {3}.app.dSYM'",
                DeveloperDir,
                Executable.AbsolutePath,
                FullDestPathRoot,
                Path.GetFileName(Executable.AbsolutePath));
            GenDebugAction.PrerequisiteItems.Add(Executable);
            GenDebugAction.ProducedItems.Add(DestFile);
            GenDebugAction.StatusDescription = GenDebugAction.CommandArguments;// string.Format("Generating debug info for {0}", Path.GetFileName(Executable.AbsolutePath));
            GenDebugAction.bCanExecuteRemotely = false;

            return DestFile;
        }
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:34,代码来源:IOSToolChain.cs

示例3: PrecompileHeaderEnvironment

 public PrecompileHeaderEnvironment( string InitModuleName, string InitPCHHeaderNameInCode, FileItem InitPrecompiledHeaderIncludeFilename, CPPCLRMode InitCLRMode, ModuleRules.CodeOptimization InitOptimizeCode )
 {
     ModuleName = InitModuleName;
     PCHHeaderNameInCode = InitPCHHeaderNameInCode;
     PrecompiledHeaderIncludeFilename = InitPrecompiledHeaderIncludeFilename;
     CLRMode = InitCLRMode;
     OptimizeCode = InitOptimizeCode;
 }
开发者ID:colwalder,项目名称:unrealengine,代码行数:8,代码来源:UEBuildModule.cs

示例4: AddFile

			public void AddFile(FileItem File)
			{
				Files.Add(File);

				long FileLength = File.Info.Length;
				TotalLength += FileLength;
				VirtualLength += FileLength;
			}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:8,代码来源:Unity.cs

示例5: AddFile

			/// <summary>
			/// Adds a file to the current unity file.  If splitting is required and the total size of the
			/// unity file exceeds the split limit, then a new file is automatically started.
			/// </summary>
			/// <param name="File">The file to add.</param>
			public void AddFile(FileItem File)
			{
				CurrentCollection.AddFile(File);
				if (SplitLength != -1 && CurrentCollection.TotalLength > SplitLength)
				{
					EndCurrentUnityFile();
				}
			}
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:13,代码来源:Unity.cs

示例6: DependencyCache

 /**
  * Constructor
  *
  * @param	Cache	File associated with this cache
  */
 protected DependencyCache(FileItem Cache)
 {
     CacheCreateDate = DateTimeOffset.Now;
     CacheUpdateDate = DateTimeOffset.Now;
     CachePath = Cache.AbsolutePath;
     DependencyMap = new Dictionary<string, DependencyInfo>(StringComparer.InvariantCultureIgnoreCase);
     bIsDirty = false;
     CreateFileExistsInfo();
 }
开发者ID:Art1stical,项目名称:AHRUnrealEngine,代码行数:14,代码来源:DependencyCache.cs

示例7: DependencyCache

 /**
  * Constructor
  *
  * @param	Cache	File associated with this cache
  */
 protected DependencyCache(FileItem Cache)
 {
     CacheCreateDate = DateTimeOffset.Now;
     CacheUpdateDate = DateTimeOffset.Now;
     CachePath = Cache.AbsolutePath;
     DependencyMap = new Dictionary<string, DependencyInfo>();
     bIsDirty = false;
     CreateFileExistsInfo();
 }
开发者ID:colwalder,项目名称:unrealengine,代码行数:14,代码来源:DependencyCache.cs

示例8: GenerateDebugInfo

        /**
         * Generates debug info for a given executable
         *
         * @param Executable FileItem describing the executable to generate debug info for
         */
        public static FileItem GenerateDebugInfo(FileItem Executable)
        {
            // Make a file item for the source and destination files
            string FullDestPathRoot = Executable.AbsolutePath + ".dSYM";
            string FullDestPath = FullDestPathRoot;

            FileItem DestFile;
            if (!Utils.IsRunningOnMono && BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac)
            {
                DestFile = FileItem.GetRemoteItemByPath (FullDestPath, UnrealTargetPlatform.IOS);
            }
            else
            {
                DestFile = FileItem.GetItemByPath (FullDestPath);
            }

            // Make the compile action
            Action GenDebugAction = new Action(ActionType.GenerateDebugInfo);
            if (!Utils.IsRunningOnMono)
            {
                GenDebugAction.ActionHandler = new Action.BlockingActionHandler(RPCUtilHelper.RPCActionHandler);
            }

            IOSToolChain Toolchain = UEToolChain.GetPlatformToolChain(CPPTargetPlatform.IOS) as IOSToolChain;
            GenDebugAction.WorkingDirectory = Toolchain.GetMacDevSrcRoot();
            GenDebugAction.CommandPath = "sh";

            // note that the source and dest are switched from a copy command
            if (!Utils.IsRunningOnMono && BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac)
            {
                GenDebugAction.CommandArguments = string.Format("-c '/usr/bin/dsymutil \"{0}\" -f -o \"{1}\"; cd \"{1}/..\"; zip -r -y -1 {2}.dSYM.zip {2}.dSYM'",
                    Executable.AbsolutePath,
                    FullDestPathRoot,
                    Path.GetFileName(Executable.AbsolutePath));
            }
            else
            {
                GenDebugAction.CommandArguments = string.Format("-c '/usr/bin/dsymutil \"{0}\" -f -o \"{1}\"'",
                    Executable.AbsolutePath,
                    FullDestPathRoot);
            }

            GenDebugAction.PrerequisiteItems.Add(Executable);
            GenDebugAction.ProducedItems.Add(DestFile);
            GenDebugAction.StatusDescription = GenDebugAction.CommandArguments;// string.Format("Generating debug info for {0}", Path.GetFileName(Executable.AbsolutePath));
            GenDebugAction.bCanExecuteRemotely = false;

            return DestFile;
        }
开发者ID:mymei,项目名称:UE4,代码行数:54,代码来源:IOSToolChain.cs

示例9: BatchFileInfo

        public static void BatchFileInfo(FileItem[] Files)
        {
            // build a list of file paths to get info about
            StringBuilder FileList = new StringBuilder();
            foreach (FileItem File in Files)
            {
                FileList.AppendFormat("{0}\n", File.AbsolutePath);
            }

            // execute the command!
            Int64[] FileSizeAndDates = RPCUtility.CommandHelper.RPCBatchFileInfo(GetSocket(), FileList.ToString());

            // now update the source times
            for (int Index = 0; Index < Files.Length; Index++)
            {
                Files[Index].Length = FileSizeAndDates[Index * 2 + 0];
                Files[Index].LastWriteTime = new DateTimeOffset(RPCUtility.CommandHelper.FromRemoteTime(FileSizeAndDates[Index * 2 + 1]));
                Files[Index].bExists = FileSizeAndDates[Index * 2 + 0] >= 0;
            }
        }
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:20,代码来源:RPCUtilHelper.cs

示例10: GetResponseFileName

        /// <summary>
        /// Get the name of the response file for the current linker environment and output file
        /// </summary>
        /// <param name="LinkEnvironment"></param>
        /// <param name="OutputFile"></param>
        /// <returns></returns>
        public static string GetResponseFileName( LinkEnvironment LinkEnvironment, FileItem OutputFile )
        {
            // Construct a relative path for the intermediate response file
            string ResponseFileName = Path.Combine( LinkEnvironment.Config.IntermediateDirectory, Path.GetFileName( OutputFile.AbsolutePath ) + ".response" );
            if (UnrealBuildTool.HasUProjectFile())
            {
                // If this is the uproject being built, redirect the intermediate
                if (Utils.IsFileUnderDirectory( OutputFile.AbsolutePath, UnrealBuildTool.GetUProjectPath() ))
                {
                    ResponseFileName = Path.Combine(
                        UnrealBuildTool.GetUProjectPath(),
                        BuildConfiguration.PlatformIntermediateFolder,
                        Path.GetFileNameWithoutExtension(UnrealBuildTool.GetUProjectFile()),
                        LinkEnvironment.Config.TargetConfiguration.ToString(),
                        Path.GetFileName(OutputFile.AbsolutePath) + ".response");
                }
            }
            // Convert the relative path to an absolute path
            ResponseFileName = Path.GetFullPath( ResponseFileName );

            return ResponseFileName;
        }
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:28,代码来源:UEToolChain.cs

示例11: Load

		/// <summary>
		/// Loads the cache from disk
		/// </summary>
		/// <param name="Cache">The file to load</param>
		/// <returns>The loaded instance</returns>
		public static FlatCPPIncludeDependencyCache Load(FileItem Cache)
		{
			FlatCPPIncludeDependencyCache Result = null;
			try
			{
				string CacheBuildMutexPath = Cache.AbsolutePath + ".buildmutex";

				// If the .buildmutex file for the cache is present, it means that something went wrong between loading
				// and saving the cache last time (most likely the UBT process being terminated), so we don't want to load
				// it.
				if (!File.Exists(CacheBuildMutexPath))
				{
					using (File.Create(CacheBuildMutexPath))
					{
					}

					using (FileStream Stream = new FileStream(Cache.AbsolutePath, FileMode.Open, FileAccess.Read))
					{
						// @todo ubtmake: We can store the cache in a cheaper/smaller way using hash file names and indices into included headers, but it might actually slow down load times
						// @todo ubtmake: If we can index PCHs here, we can avoid storing all of the PCH's included headers (PCH's action should have been invalidated, so we shouldn't even have to report the PCH's includes as our indirect includes)
						BinaryFormatter Formatter = new BinaryFormatter();
						Result = Formatter.Deserialize(Stream) as FlatCPPIncludeDependencyCache;
						Result.CacheFileItem = Cache;
						Result.bIsDirty = false;
					}
				}
			}
			catch (Exception Ex)
			{
				// Don't bother failing if the file format has changed, simply abort the cache load
				if (Ex.Message.Contains( "cannot be converted to type" ))	// To catch serialization differences added when we added the DependencyInfo struct
				{
					Console.Error.WriteLine("Failed to read FlatCPPIncludeDependencyCache: {0}", Ex.Message);
				}
			}
			return Result;
		}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:42,代码来源:FlatCPPIncludeDepencencyCache.cs

示例12: PostBuild

		public virtual ICollection<FileItem> PostBuild(FileItem Executable, LinkEnvironment ExecutableLinkEnvironment)
		{
			return new List<FileItem>();
		}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:4,代码来源:UEToolChain.cs

示例13: GetResponseFileName

		/// <summary>
		/// Get the name of the response file for the current linker environment and output file
		/// </summary>
		/// <param name="LinkEnvironment"></param>
		/// <param name="OutputFile"></param>
		/// <returns></returns>
		public static FileReference GetResponseFileName(LinkEnvironment LinkEnvironment, FileItem OutputFile)
		{
			// Construct a relative path for the intermediate response file
			return FileReference.Combine(LinkEnvironment.Config.IntermediateDirectory, OutputFile.Reference.GetFileName() + ".response");
		}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:11,代码来源:UEToolChain.cs

示例14: AddPrerequisiteSourceFile

		protected void AddPrerequisiteSourceFile(UEBuildTarget Target, UEBuildPlatform BuildPlatform, CPPEnvironment CompileEnvironment, FileItem SourceFile, List<FileItem> PrerequisiteItems)
		{
			PrerequisiteItems.Add(SourceFile);

			RemoteToolChain RemoteThis = this as RemoteToolChain;
			bool bAllowUploading = RemoteThis != null && BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac;	// Don't use remote features when compiling from a Mac
			if (bAllowUploading)
			{
				RemoteThis.QueueFileForBatchUpload(SourceFile);
			}

			if (!BuildConfiguration.bUseUBTMakefiles)	// In fast build iteration mode, we'll gather includes later on
			{
				// @todo ubtmake: What if one of the prerequisite files has become missing since it was updated in our cache? (usually, because a coder eliminated the source file)
				//		-> Two CASES:
				//				1) NOT WORKING: Non-unity file went away (SourceFile in this context).  That seems like an existing old use case.  Compile params or Response file should have changed?
				//				2) WORKING: Indirect file went away (unity'd original source file or include).  This would return a file that no longer exists and adds to the prerequiteitems list
				List<FileItem> IncludedFileList = CPPEnvironment.FindAndCacheAllIncludedFiles(Target, SourceFile, BuildPlatform, CompileEnvironment.Config.CPPIncludeInfo, bOnlyCachedDependencies: BuildConfiguration.bUseUBTMakefiles);
				if (IncludedFileList != null)
				{
					foreach (FileItem IncludedFile in IncludedFileList)
					{
						PrerequisiteItems.Add(IncludedFile);

						if (bAllowUploading &&
							!BuildConfiguration.bUseUBTMakefiles)	// With fast dependency scanning, we will not have an exhaustive list of dependencies here.  We rely on PostCodeGeneration() to upload these files.
						{
							RemoteThis.QueueFileForBatchUpload(IncludedFile);
						}
					}
				}
			}
		}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:33,代码来源:UEToolChain.cs

示例15: GatherPrerequisiteActions

        /**
         * Determines the full set of actions that must be built to produce an item.
         * @param OutputItem - The item to be built.
         * @param PrerequisiteActions - The actions that must be built and the root action are
         */
        public static void GatherPrerequisiteActions(
			FileItem OutputItem,
			ref HashSet<Action> PrerequisiteActions
			)
        {
            if (OutputItem != null && OutputItem.ProducingAction != null)
            {
                if (!PrerequisiteActions.Contains(OutputItem.ProducingAction))
                {
                    PrerequisiteActions.Add(OutputItem.ProducingAction);
                    foreach (FileItem PrerequisiteItem in OutputItem.ProducingAction.PrerequisiteItems)
                    {
                        GatherPrerequisiteActions(PrerequisiteItem, ref PrerequisiteActions);
                    }
                }
            }
        }
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:22,代码来源:ActionGraph.cs


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