本文整理汇总了C#中FileReference.GetFileNameWithoutAnyExtensions方法的典型用法代码示例。如果您正苦于以下问题:C# FileReference.GetFileNameWithoutAnyExtensions方法的具体用法?C# FileReference.GetFileNameWithoutAnyExtensions怎么用?C# FileReference.GetFileNameWithoutAnyExtensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileReference
的用法示例。
在下文中一共展示了FileReference.GetFileNameWithoutAnyExtensions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExecuteBuild
public override void ExecuteBuild()
{
// Get the list of platform names
string[] FeaturePacks = ParseParamValue("FeaturePacks").Split(';');
string TempDir = ParseParamValue("TempDir");
UnrealTargetPlatform HostPlatform = (UnrealTargetPlatform)Enum.Parse(typeof(UnrealTargetPlatform), ParseParamValue("HostPlatform"));
string TargetPlatforms = ParseParamValue("TargetPlatforms");
string SavedDir = ParseParamValue("SavedDir");
// Get paths to everything within the temporary directory
string EditorExe = CommandUtils.GetEditorCommandletExe(TempDir, HostPlatform);
string RelativePakPath = "Engine/DerivedDataCache/Compressed.ddp";
string OutputPakFile = CommandUtils.CombinePaths(TempDir, RelativePakPath);
string OutputCsvFile = Path.ChangeExtension(OutputPakFile, ".csv");
List<string> ProjectPakFiles = new List<string>();
List<string> FeaturePackPaths = new List<string>();
// loop through all the projects first and bail out if one of them doesn't exist.
foreach (string FeaturePack in FeaturePacks)
{
if (!String.IsNullOrWhiteSpace(FeaturePack))
{
string FeaturePackPath = CommandUtils.CombinePaths(CommandUtils.RootDirectory.FullName, FeaturePack);
if (!CommandUtils.FileExists(FeaturePackPath))
{
throw new AutomationException("Could not find project: " + FeaturePack);
}
FeaturePackPaths.Add(FeaturePackPath);
}
}
// loop through all the paths and generate ddc data for them
foreach (string FeaturePackPath in FeaturePackPaths)
{
string ProjectSpecificPlatforms = TargetPlatforms;
FileReference FileRef = new FileReference(FeaturePackPath);
string GameName = FileRef.GetFileNameWithoutAnyExtensions();
ProjectDescriptor Project = ProjectDescriptor.FromFile(FeaturePackPath);
if (Project.TargetPlatforms != null && Project.TargetPlatforms.Length > 0)
{
// Restrict target platforms used to those specified in project file
List<string> FilteredPlatforms = new List<string>();
// Always include the editor platform for cooking
string EditorCookPlatform = Platform.GetPlatform(HostPlatform).GetEditorCookPlatform();
if (TargetPlatforms.Contains(EditorCookPlatform))
{
FilteredPlatforms.Add(EditorCookPlatform);
}
foreach (string TargetPlatform in Project.TargetPlatforms)
{
if (TargetPlatforms.Contains(TargetPlatform))
{
FilteredPlatforms.Add(TargetPlatform);
}
}
ProjectSpecificPlatforms = CommandUtils.CombineCommandletParams(FilteredPlatforms.Distinct().ToArray());
}
CommandUtils.Log("Generating DDC data for {0} on {1}", GameName, ProjectSpecificPlatforms);
CommandUtils.DDCCommandlet(FileRef, EditorExe, null, ProjectSpecificPlatforms, "-fill -DDC=CreateInstalledEnginePak -ProjectOnly");
string ProjectPakFile = CommandUtils.CombinePaths(Path.GetDirectoryName(OutputPakFile), String.Format("Compressed-{0}.ddp", GameName));
CommandUtils.DeleteFile(ProjectPakFile);
CommandUtils.RenameFile(OutputPakFile, ProjectPakFile);
string ProjectCsvFile = Path.ChangeExtension(ProjectPakFile, ".csv");
CommandUtils.DeleteFile(ProjectCsvFile);
CommandUtils.RenameFile(OutputCsvFile, ProjectCsvFile);
ProjectPakFiles.Add(Path.GetFileName(ProjectPakFile));
}
// Generate DDC for the editor, and merge all the other PAK files in
CommandUtils.Log("Generating DDC data for engine content on {0}", TargetPlatforms);
CommandUtils.DDCCommandlet(null, EditorExe, null, TargetPlatforms, "-fill -DDC=CreateInstalledEnginePak " + CommandUtils.MakePathSafeToUseWithCommandLine("-MergePaks=" + String.Join("+", ProjectPakFiles)));
string SavedPakFile = CommandUtils.CombinePaths(SavedDir, RelativePakPath);
CommandUtils.CopyFile(OutputPakFile, SavedPakFile);
}