Ejemplo n.º 1
0
        protected override ProjectFile AllocateProjectFile(FileReference InitFilePath)
        {
            RiderProjectFile projectFile = new RiderProjectFile(InitFilePath)
            {
                RootPath = InitFilePath.Directory, Arguments = Arguments, TargetTypes = TargetTypes
            };

            return(projectFile);
        }
Ejemplo n.º 2
0
        protected override bool WriteProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators)
        {
            using (ProgressWriter Progress = new ProgressWriter("Writing project files...", true))
            {
                List <ProjectFile> ProjectsToGenerate = new List <ProjectFile>(GeneratedProjectFiles);
                if (ProjectNames.Any())
                {
                    ProjectsToGenerate = ProjectsToGenerate.Where(it =>
                                                                  ProjectNames.Contains(it.ProjectFilePath.GetFileNameWithoutAnyExtensions())).ToList();
                }

                int TotalProjectFileCount = ProjectsToGenerate.Count;

                HashSet <UnrealTargetPlatform> PlatformsToGenerate = new HashSet <UnrealTargetPlatform>(SupportedPlatforms);
                if (Platforms.Any())
                {
                    PlatformsToGenerate.IntersectWith(Platforms);
                }

                List <UnrealTargetPlatform> FilteredPlatforms = PlatformsToGenerate.Where(it =>
                {
                    // Skip deprecated platforms if they are not specified in commandline arguments directly
                    if (DeprecatedPlatforms.Contains(it) && !Platforms.Contains(it))
                    {
                        return(false);
                    }

                    if (UEBuildPlatform.IsPlatformAvailable(it))
                    {
                        return(true);
                    }
                    Log.TraceWarning(
                        "Platform {0} is not a valid platform to build. Check that the SDK is installed properly",
                        it);
                    Log.TraceWarning("Platform will be ignored in project file generation");
                    return(false);
                }).ToList();

                HashSet <UnrealTargetConfiguration> ConfigurationsToGenerate = new HashSet <UnrealTargetConfiguration>(SupportedConfigurations);
                if (TargetConfigurations.Any())
                {
                    ConfigurationsToGenerate.IntersectWith(TargetConfigurations);
                }

                for (int ProjectFileIndex = 0; ProjectFileIndex < ProjectsToGenerate.Count; ++ProjectFileIndex)
                {
                    RiderProjectFile CurProject = ProjectsToGenerate[ProjectFileIndex] as RiderProjectFile;
                    if (CurProject != null)
                    {
                        if (!CurProject.WriteProjectFile(FilteredPlatforms, ConfigurationsToGenerate.ToList(),
                                                         PlatformProjectGenerators, Minimize))
                        {
                            return(false);
                        }
                    }

                    Progress.Write(ProjectFileIndex + 1, TotalProjectFileCount);
                }

                Progress.Write(TotalProjectFileCount, TotalProjectFileCount);
            }

            return(true);
        }