protected override void WriteDebugSolutionFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, DirectoryReference IntermediateProjectFilesPath)
        {
            //build and collect UnrealVS configuration
            StringBuilder UnrealVSContent = new StringBuilder();

            foreach (UnrealTargetPlatform SupportedPlatform in SupportedPlatforms)
            {
                PlatformProjectGenerator ProjGenerator = PlatformProjectGenerators.GetPlatformProjectGenerator(SupportedPlatform, true);
                if (ProjGenerator != null)
                {
                    ProjGenerator.GetUnrealVSConfigurationEntries(UnrealVSContent);
                }
            }
            if (UnrealVSContent.Length > 0)
            {
                UnrealVSContent.Insert(0, "<UnrealVS>" + ProjectFileGenerator.NewLine);
                UnrealVSContent.Append("</UnrealVS>" + ProjectFileGenerator.NewLine);

                string ConfigFilePath = FileReference.Combine(IntermediateProjectFilesPath, "UnrealVS.xml").FullName;
                bool   bSuccess       = ProjectFileGenerator.WriteFileIfChanged(ConfigFilePath, UnrealVSContent.ToString());
            }
        }
 public CodeLiteFolder(ProjectFileGenerator InitOwnerProjectFileGenerator, string InitFolderName)
     : base(InitOwnerProjectFileGenerator, InitFolderName)
 {
 }
Exemplo n.º 3
0
        /// <summary>
        /// For additional Project file *PROJECTNAME*-AndroidRun.androidproj that needs to be written out.  This is currently used only on Android.
        /// </summary>
        /// <param name="ProjectFile">ProjectFile object</param>
        public override Tuple <ProjectFile, string> WriteAdditionalProjFile(ProjectFile ProjectFile)
        {
            if (!IsVSAndroidSupportInstalled())
            {
                return(null);
            }

            string ProjectName = ProjectFile.ProjectFilePath.GetFileNameWithoutExtension() + "-AndroidRun";

            string FileName = ProjectName + ".androidproj";

            string FileText = "<?xml version=\"1.0\" encoding=\"utf-8\"?> " + ProjectFileGenerator.NewLine +
                              "<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\"> " + ProjectFileGenerator.NewLine +
                              "	<ItemGroup Label=\"ProjectConfigurations\"> " + ProjectFileGenerator.NewLine +
                              "		<ProjectConfiguration Include=\"Debug|ARM\"> "+ ProjectFileGenerator.NewLine +
                              "			<Configuration>Debug</Configuration> "+ ProjectFileGenerator.NewLine +
                              "			<Platform>ARM</Platform> "+ ProjectFileGenerator.NewLine +
                              "		</ProjectConfiguration> "+ ProjectFileGenerator.NewLine +
                              "		<ProjectConfiguration Include=\"Release|ARM\"> "+ ProjectFileGenerator.NewLine +
                              "			<Configuration>Release</Configuration> "+ ProjectFileGenerator.NewLine +
                              "			<Platform>ARM</Platform> "+ ProjectFileGenerator.NewLine +
                              "		</ProjectConfiguration> "+ ProjectFileGenerator.NewLine +
                              "		<ProjectConfiguration Include=\"Debug|ARM64\"> "+ ProjectFileGenerator.NewLine +
                              "			<Configuration>Debug</Configuration> "+ ProjectFileGenerator.NewLine +
                              "			<Platform>ARM64</Platform> "+ ProjectFileGenerator.NewLine +
                              "		</ProjectConfiguration> "+ ProjectFileGenerator.NewLine +
                              "		<ProjectConfiguration Include=\"Release|ARM64\"> "+ ProjectFileGenerator.NewLine +
                              "			<Configuration>Release</Configuration> "+ ProjectFileGenerator.NewLine +
                              "			<Platform>ARM64</Platform> "+ ProjectFileGenerator.NewLine +
                              "		</ProjectConfiguration> "+ ProjectFileGenerator.NewLine +
                              "		<ProjectConfiguration Include=\"Debug|x64\"> "+ ProjectFileGenerator.NewLine +
                              "			<Configuration>Debug</Configuration> "+ ProjectFileGenerator.NewLine +
                              "			<Platform>x64</Platform> "+ ProjectFileGenerator.NewLine +
                              "		</ProjectConfiguration> "+ ProjectFileGenerator.NewLine +
                              "		<ProjectConfiguration Include=\"Release|x64\"> "+ ProjectFileGenerator.NewLine +
                              "			<Configuration>Release</Configuration> "+ ProjectFileGenerator.NewLine +
                              "			<Platform>x64</Platform> "+ ProjectFileGenerator.NewLine +
                              "		</ProjectConfiguration> "+ ProjectFileGenerator.NewLine +
                              "		<ProjectConfiguration Include=\"Debug|x86\"> "+ ProjectFileGenerator.NewLine +
                              "			<Configuration>Debug</Configuration> "+ ProjectFileGenerator.NewLine +
                              "			<Platform>x86</Platform> "+ ProjectFileGenerator.NewLine +
                              "		</ProjectConfiguration> "+ ProjectFileGenerator.NewLine +
                              "		<ProjectConfiguration Include=\"Release|x86\"> "+ ProjectFileGenerator.NewLine +
                              "			<Configuration>Release</Configuration> "+ ProjectFileGenerator.NewLine +
                              "			<Platform>x86</Platform> "+ ProjectFileGenerator.NewLine +
                              "		</ProjectConfiguration> "+ ProjectFileGenerator.NewLine +
                              "	</ItemGroup> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Label=\"Globals\"> " + ProjectFileGenerator.NewLine +
                              "		<RootNamespace>"+ ProjectName + "</RootNamespace> " + ProjectFileGenerator.NewLine +
                              "		<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion> "+ ProjectFileGenerator.NewLine +
                              "		<ProjectVersion>1.0</ProjectVersion> "+ ProjectFileGenerator.NewLine +

                              //Set the project guid
                              "		<ProjectGuid>"+ System.Guid.NewGuid().ToString("B").ToUpper() + "</ProjectGuid> " + ProjectFileGenerator.NewLine +

                              "		<ConfigurationType>Application</ConfigurationType> "+ ProjectFileGenerator.NewLine +
                              "		<_PackagingProjectWithoutNativeComponent>true</_PackagingProjectWithoutNativeComponent> "+ ProjectFileGenerator.NewLine +
                              "		<LaunchActivity Condition=\"\'$(LaunchActivity)\' == \'\'\">com."+ ProjectName + "." + ProjectName + "</LaunchActivity> " + ProjectFileGenerator.NewLine +
                              "		<JavaSourceRoots>src</JavaSourceRoots> "+ ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<Import Project=\"$(AndroidTargetsPath)\\Android.Default.props\" /> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Debug|ARM\'\" Label=\"Configuration\"> " + ProjectFileGenerator.NewLine +
                              "		<UseDebugLibraries>true</UseDebugLibraries> "+ ProjectFileGenerator.NewLine +
                              "		<TargetName>$(RootNamespace)</TargetName> "+ ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Release|ARM\'\" Label=\"Configuration\"> " + ProjectFileGenerator.NewLine +
                              "		<UseDebugLibraries>false</UseDebugLibraries> "+ ProjectFileGenerator.NewLine +
                              "		<TargetName>$(RootNamespace)</TargetName> "+ ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Debug|ARM64\'\" Label=\"Configuration\"> " + ProjectFileGenerator.NewLine +
                              "		<UseDebugLibraries>true</UseDebugLibraries> "+ ProjectFileGenerator.NewLine +
                              "		<TargetName>$(RootNamespace)</TargetName> "+ ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Release|ARM64\'\" Label=\"Configuration\"> " + ProjectFileGenerator.NewLine +
                              "		<UseDebugLibraries>false</UseDebugLibraries> "+ ProjectFileGenerator.NewLine +
                              "		<TargetName>$(RootNamespace)</TargetName> "+ ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Debug|x64\'\" Label=\"Configuration\"> " + ProjectFileGenerator.NewLine +
                              "		<UseDebugLibraries>true</UseDebugLibraries> "+ ProjectFileGenerator.NewLine +
                              "		<TargetName>$(RootNamespace)</TargetName> "+ ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Release|x64\'\" Label=\"Configuration\"> " + ProjectFileGenerator.NewLine +
                              "		<UseDebugLibraries>false</UseDebugLibraries> "+ ProjectFileGenerator.NewLine +
                              "		<TargetName>$(RootNamespace)</TargetName> "+ ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Debug|x86\'\" Label=\"Configuration\"> " + ProjectFileGenerator.NewLine +
                              "		<UseDebugLibraries>true</UseDebugLibraries> "+ ProjectFileGenerator.NewLine +
                              "		<TargetName>$(RootNamespace)</TargetName> "+ ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Release|x86\'\" Label=\"Configuration\"> " + ProjectFileGenerator.NewLine +
                              "		<UseDebugLibraries>false</UseDebugLibraries> "+ ProjectFileGenerator.NewLine +
                              "		<TargetName>$(RootNamespace)</TargetName> "+ ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<Import Project=\"$(AndroidTargetsPath)\\Android.props\" /> " + ProjectFileGenerator.NewLine +
                              "	<ImportGroup Label=\"ExtensionSettings\" /> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Label=\"UserMacros\" /> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Debug|ARM\'\"> " + ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Release|ARM\'\"> " + ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Debug|ARM64\'\"> " + ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Release|ARM64\'\"> " + ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Debug|x64\'\"> " + ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Release|x64\'\"> " + ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Debug|x86\'\"> " + ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Release|x86\'\"> " + ProjectFileGenerator.NewLine +
                              "	</PropertyGroup> " + ProjectFileGenerator.NewLine +
                              "	<ItemDefinitionGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Debug|ARM\'\"> " + ProjectFileGenerator.NewLine +
                              "		<AntPackage> "+ ProjectFileGenerator.NewLine +
                              "			<AndroidAppLibName /> "+ ProjectFileGenerator.NewLine +
                              "		</AntPackage> "+ ProjectFileGenerator.NewLine +
                              "	</ItemDefinitionGroup> " + ProjectFileGenerator.NewLine +
                              "	<ItemDefinitionGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Release|ARM\'\"> " + ProjectFileGenerator.NewLine +
                              "		<AntPackage> "+ ProjectFileGenerator.NewLine +
                              "			<AndroidAppLibName /> "+ ProjectFileGenerator.NewLine +
                              "		</AntPackage> "+ ProjectFileGenerator.NewLine +
                              "	</ItemDefinitionGroup> " + ProjectFileGenerator.NewLine +
                              "	<ItemDefinitionGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Debug|ARM64\'\"> " + ProjectFileGenerator.NewLine +
                              "		<AntPackage> "+ ProjectFileGenerator.NewLine +
                              "			<AndroidAppLibName /> "+ ProjectFileGenerator.NewLine +
                              "		</AntPackage> "+ ProjectFileGenerator.NewLine +
                              "	</ItemDefinitionGroup> " + ProjectFileGenerator.NewLine +
                              "	<ItemDefinitionGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Release|ARM64\'\"> " + ProjectFileGenerator.NewLine +
                              "		<AntPackage> "+ ProjectFileGenerator.NewLine +
                              "			<AndroidAppLibName /> "+ ProjectFileGenerator.NewLine +
                              "		</AntPackage> "+ ProjectFileGenerator.NewLine +
                              "	</ItemDefinitionGroup> " + ProjectFileGenerator.NewLine +
                              "	<ItemDefinitionGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Debug|x64\'\"> " + ProjectFileGenerator.NewLine +
                              "		<AntPackage> "+ ProjectFileGenerator.NewLine +
                              "			<AndroidAppLibName /> "+ ProjectFileGenerator.NewLine +
                              "		</AntPackage> "+ ProjectFileGenerator.NewLine +
                              "	</ItemDefinitionGroup> " + ProjectFileGenerator.NewLine +
                              "	<ItemDefinitionGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Release|x64\'\"> " + ProjectFileGenerator.NewLine +
                              "		<AntPackage> "+ ProjectFileGenerator.NewLine +
                              "			<AndroidAppLibName /> "+ ProjectFileGenerator.NewLine +
                              "		</AntPackage> "+ ProjectFileGenerator.NewLine +
                              "	</ItemDefinitionGroup> " + ProjectFileGenerator.NewLine +
                              "	<ItemDefinitionGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Debug|x86\'\"> " + ProjectFileGenerator.NewLine +
                              "		<AntPackage> "+ ProjectFileGenerator.NewLine +
                              "			<AndroidAppLibName /> "+ ProjectFileGenerator.NewLine +
                              "		</AntPackage> "+ ProjectFileGenerator.NewLine +
                              "	</ItemDefinitionGroup> " + ProjectFileGenerator.NewLine +
                              "	<ItemDefinitionGroup Condition=\"\'$(Configuration)|$(Platform)\'==\'Release|x86\'\"> " + ProjectFileGenerator.NewLine +
                              "		<AntPackage> "+ ProjectFileGenerator.NewLine +
                              "			<AndroidAppLibName /> "+ ProjectFileGenerator.NewLine +
                              "		</AntPackage> "+ ProjectFileGenerator.NewLine +
                              "	</ItemDefinitionGroup> " + ProjectFileGenerator.NewLine +
                              "	<Import Project=\"$(AndroidTargetsPath)\\Android.targets\" /> " + ProjectFileGenerator.NewLine +
                              "	<ImportGroup Label=\"ExtensionTargets\" /> " + ProjectFileGenerator.NewLine +
                              "</Project>";

            bool Success = ProjectFileGenerator.WriteFileIfChanged(ProjectFileGenerator.IntermediateProjectFilesPath + "\\" + FileName, FileText);

            FileReference           ProjectFilePath = FileReference.Combine(ProjectFileGenerator.IntermediateProjectFilesPath, FileName);
            AndroidDebugProjectFile Project         = new AndroidDebugProjectFile(ProjectFilePath);

            Project.ShouldBuildForAllSolutionTargets       = false;
            Project.ShouldBuildByDefaultForSolutionTargets = false;

            return(Success ? new Tuple <ProjectFile, string>(Project, "UE4 Android Debug Projects") : null);
        }
Exemplo n.º 4
0
        /// <summary>
        /// For Additional Project Property file  VSAndroidUnreal.props file that need to be written out.  This is currently used only on Android.
        /// </summary>
        public override void WriteAdditionalPropFile()
        {
            if (!IsVSAndroidSupportInstalled())
            {
                return;
            }

            //This file only needs to be written once and doesn't change.
            if (VSPropsFileWritten)
            {
                return;
            }
            VSPropsFileWritten = true;


            string FileName = "VSAndroidUnreal.props";

            // Change the path to the Android SDK based on if we are using the Visual Studio Sandboxed SDK or not
            string vsAndroidSDKPath;

            if (VSSandboxedSDK)
            {
                vsAndroidSDKPath = "$(ProgramData)\\Microsoft\\AndroidSDK\\25";
            }
            else
            {
                vsAndroidSDKPath = "$(VS_AndroidHome)";
            }

            string FileText = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + ProjectFileGenerator.NewLine +
                              "<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">" + ProjectFileGenerator.NewLine +
                              "	<ImportGroup Label=\"PropertySheets\" />" + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup Label=\"UserMacros\">" + ProjectFileGenerator.NewLine +
                              "		<ANDROID_HOME>"+ vsAndroidSDKPath + "</ANDROID_HOME>" + ProjectFileGenerator.NewLine +
                              "		<JAVA_HOME>$(VS_JavaHome)</JAVA_HOME>"+ ProjectFileGenerator.NewLine +
                              "		<ANT_HOME>$(VS_AntHome)</ANT_HOME>"+ ProjectFileGenerator.NewLine +
                              "		<NDKROOT>$(VS_NdkRoot)</NDKROOT>"+ ProjectFileGenerator.NewLine +
                              "	</PropertyGroup>" + ProjectFileGenerator.NewLine +
                              "	<PropertyGroup />" + ProjectFileGenerator.NewLine +
                              "	<ItemDefinitionGroup />" + ProjectFileGenerator.NewLine +
                              "	<ItemGroup>" + ProjectFileGenerator.NewLine +
                              "		<BuildMacro Include=\"ANDROID_HOME\">"+ ProjectFileGenerator.NewLine +
                              "			<Value>$(ANDROID_HOME)</Value>"+ ProjectFileGenerator.NewLine +
                              "			<EnvironmentVariable>true</EnvironmentVariable>"+ ProjectFileGenerator.NewLine +
                              "		</BuildMacro>"+ ProjectFileGenerator.NewLine +
                              "		<BuildMacro Include=\"JAVA_HOME\">"+ ProjectFileGenerator.NewLine +
                              "			<Value>$(JAVA_HOME)</Value>"+ ProjectFileGenerator.NewLine +
                              "			<EnvironmentVariable>true</EnvironmentVariable>"+ ProjectFileGenerator.NewLine +
                              "		</BuildMacro>"+ ProjectFileGenerator.NewLine +
                              "		<BuildMacro Include=\"ANT_HOME\">"+ ProjectFileGenerator.NewLine +
                              "			<Value>$(ANT_HOME)</Value>"+ ProjectFileGenerator.NewLine +
                              "			<EnvironmentVariable>true</EnvironmentVariable>"+ ProjectFileGenerator.NewLine +
                              "		</BuildMacro>"+ ProjectFileGenerator.NewLine +
                              "		<BuildMacro Include=\"NDKROOT\">"+ ProjectFileGenerator.NewLine +
                              "			<Value>$(NDKROOT)</Value>"+ ProjectFileGenerator.NewLine +
                              "			<EnvironmentVariable>true</EnvironmentVariable>"+ ProjectFileGenerator.NewLine +
                              "		</BuildMacro>"+ ProjectFileGenerator.NewLine +
                              "	</ItemGroup>" + ProjectFileGenerator.NewLine +
                              "</Project>";

            ProjectFileGenerator.WriteFileIfChanged(ProjectFileGenerator.IntermediateProjectFilesPath + "\\" + FileName, FileText);
        }
 public virtual void GenerateGameProjectStub(ProjectFileGenerator InGenerator, string InTargetName, string InTargetFilepath, TargetRules InTargetRules,
                                             List <UnrealTargetPlatform> InPlatforms, List <UnrealTargetConfiguration> InConfigurations)
 {
     // Do nothing
 }
Exemplo n.º 6
0
 /// <summary>
 /// Constructor
 /// </summary>
 public KDevelopFolder(ProjectFileGenerator InitOwnerProjectFileGenerator, string InitFolderName)
     : base(InitOwnerProjectFileGenerator, InitFolderName)
 {
 }
        /// <summary>
        /// Execute the tool mode
        /// </summary>
        /// <param name="Arguments">Command line arguments</param>
        /// <returns>Exit code</returns>
        public override int Execute(CommandLineArguments Arguments)
        {
            // Apply any command line arguments to this class
            Arguments.ApplyTo(this);

            // Apply the XML config to this class
            XmlConfig.ApplyTo(this);

            // Parse rocket-specific arguments.
            FileReference ProjectFile;

            TryParseProjectFileArgument(Arguments, out ProjectFile);

            // If there aren't any formats set, read the default project file format from the config file
            if (ProjectFileFormats.Count == 0)
            {
                // Read from the XML config
                if (!String.IsNullOrEmpty(ProjectFileGeneratorSettings.Format))
                {
                    ProjectFileFormats.UnionWith(ProjectFileGeneratorSettings.ParseFormatList(ProjectFileGeneratorSettings.Format));
                }

                // Read from the editor config
                ProjectFileFormat PreferredSourceCodeAccessor;
                if (ProjectFileGenerator.GetPreferredSourceCodeAccessor(ProjectFile, out PreferredSourceCodeAccessor))
                {
                    ProjectFileFormats.Add(PreferredSourceCodeAccessor);
                }

                // If there's still nothing set, get the default project file format for this platform
                if (ProjectFileFormats.Count == 0)
                {
                    ProjectFileFormats.UnionWith(BuildHostPlatform.Current.GetDefaultProjectFileFormats());
                }
            }

            // Register all the platform project generators
            PlatformProjectGeneratorCollection PlatformProjectGenerators = new PlatformProjectGeneratorCollection();

            foreach (Type CheckType in Assembly.GetExecutingAssembly().GetTypes())
            {
                if (CheckType.IsClass && !CheckType.IsAbstract && CheckType.IsSubclassOf(typeof(PlatformProjectGenerator)))
                {
                    PlatformProjectGenerator Generator = (PlatformProjectGenerator)Activator.CreateInstance(CheckType, Arguments);
                    foreach (UnrealTargetPlatform Platform in Generator.GetPlatforms())
                    {
                        if (DisablePlatformProjectGenerators == null || !DisablePlatformProjectGenerators.Any(x => x.Equals(Platform.ToString(), StringComparison.OrdinalIgnoreCase)))
                        {
                            Log.TraceVerbose("Registering project generator {0} for {1}", CheckType, Platform);
                            PlatformProjectGenerators.RegisterPlatformProjectGenerator(Platform, Generator);
                        }
                    }
                }
            }

            // Create each project generator and run it
            List <ProjectFileGenerator> Generators = new List <ProjectFileGenerator>();

            foreach (ProjectFileFormat ProjectFileFormat in ProjectFileFormats.Distinct())
            {
                ProjectFileGenerator Generator;
                switch (ProjectFileFormat)
                {
                case ProjectFileFormat.Make:
                    Generator = new MakefileGenerator(ProjectFile);
                    break;

                case ProjectFileFormat.CMake:
                    Generator = new CMakefileGenerator(ProjectFile);
                    break;

                case ProjectFileFormat.QMake:
                    Generator = new QMakefileGenerator(ProjectFile);
                    break;

                case ProjectFileFormat.KDevelop:
                    Generator = new KDevelopGenerator(ProjectFile);
                    break;

                case ProjectFileFormat.CodeLite:
                    Generator = new CodeLiteGenerator(ProjectFile, Arguments);
                    break;

                case ProjectFileFormat.VisualStudio:
                    Generator = new VCProjectFileGenerator(ProjectFile, VCProjectFileFormat.Default, Arguments);
                    break;

                case ProjectFileFormat.VisualStudio2012:
                    Generator = new VCProjectFileGenerator(ProjectFile, VCProjectFileFormat.VisualStudio2012, Arguments);
                    break;

                case ProjectFileFormat.VisualStudio2013:
                    Generator = new VCProjectFileGenerator(ProjectFile, VCProjectFileFormat.VisualStudio2013, Arguments);
                    break;

                case ProjectFileFormat.VisualStudio2015:
                    Generator = new VCProjectFileGenerator(ProjectFile, VCProjectFileFormat.VisualStudio2015, Arguments);
                    break;

                case ProjectFileFormat.VisualStudio2017:
                    Generator = new VCProjectFileGenerator(ProjectFile, VCProjectFileFormat.VisualStudio2017, Arguments);
                    break;

                case ProjectFileFormat.VisualStudio2019:
                    Generator = new VCProjectFileGenerator(ProjectFile, VCProjectFileFormat.VisualStudio2019, Arguments);
                    break;

                case ProjectFileFormat.XCode:
                    Generator = new XcodeProjectFileGenerator(ProjectFile, Arguments);
                    break;

                case ProjectFileFormat.Eddie:
                    Generator = new EddieProjectFileGenerator(ProjectFile);
                    break;

                case ProjectFileFormat.VisualStudioCode:
                    Generator = new VSCodeProjectFileGenerator(ProjectFile);
                    break;

                case ProjectFileFormat.CLion:
                    Generator = new CLionGenerator(ProjectFile);
                    break;

                case ProjectFileFormat.VisualStudioMac:
                    Generator = new VCMacProjectFileGenerator(ProjectFile, Arguments);
                    break;

                default:
                    throw new BuildException("Unhandled project file type '{0}", ProjectFileFormat);
                }
                Generators.Add(Generator);
            }

            // Check there are no superfluous command line arguments
            // TODO (still pass raw arguments below)
            // Arguments.CheckAllArgumentsUsed();

            // Now generate project files
            ProjectFileGenerator.bGenerateProjectFiles = true;
            foreach (ProjectFileGenerator Generator in Generators)
            {
                if (!Generator.GenerateProjectFiles(PlatformProjectGenerators, Arguments.GetRawArray()))
                {
                    return((int)CompilationResult.OtherCompilationError);
                }
            }
            return((int)CompilationResult.Succeeded);
        }
        /// <summary>
        /// Gets the default compiler which should be used, if it's not set explicitly by the target, command line, or config file.
        /// </summary>
        /// <returns>The default compiler version</returns>
        internal static WindowsCompiler GetDefaultCompiler(FileReference ProjectFile)
        {
            // If there's no specific compiler set, try to pick the matching compiler for the selected IDE
            object ProjectFormatObject;

            if (XmlConfig.TryGetValue(typeof(VCProjectFileGenerator), "Version", out ProjectFormatObject))
            {
                VCProjectFileFormat ProjectFormat = (VCProjectFileFormat)ProjectFormatObject;
                if (ProjectFormat == VCProjectFileFormat.VisualStudio2017)
                {
                    return(WindowsCompiler.VisualStudio2017);
                }
                else if (ProjectFormat == VCProjectFileFormat.VisualStudio2015)
                {
                    return(WindowsCompiler.VisualStudio2015);
                }
            }

            // Check the editor settings too
            ProjectFileFormat PreferredAccessor;

            if (ProjectFileGenerator.GetPreferredSourceCodeAccessor(ProjectFile, out PreferredAccessor))
            {
                if (PreferredAccessor == ProjectFileFormat.VisualStudio2017)
                {
                    return(WindowsCompiler.VisualStudio2017);
                }
                else if (PreferredAccessor == ProjectFileFormat.VisualStudio2015)
                {
                    return(WindowsCompiler.VisualStudio2015);
                }
            }

            // Second, default based on what's installed, test for 2015 first
            DirectoryReference VCInstallDir;

            if (TryGetVCInstallDir(WindowsCompiler.VisualStudio2015, out VCInstallDir))
            {
                return(WindowsCompiler.VisualStudio2015);
            }
            if (TryGetVCInstallDir(WindowsCompiler.VisualStudio2017, out VCInstallDir))
            {
                return(WindowsCompiler.VisualStudio2017);
            }

            // If we do have a Visual Studio installation, but we're missing just the C++ parts, warn about that.
            DirectoryReference VSInstallDir;

            if (TryGetVSInstallDir(WindowsCompiler.VisualStudio2015, out VSInstallDir))
            {
                Log.TraceWarning("Visual Studio 2015 is installed, but is missing the C++ toolchain. Please verify that \"Common Tools for Visual C++ 2015\" are selected from the Visual Studio 2015 installation options.");
            }
            else if (TryGetVSInstallDir(WindowsCompiler.VisualStudio2017, out VSInstallDir))
            {
                Log.TraceWarning("Visual Studio 2017 is installed, but is missing the C++ toolchain. Please verify that the \"VC++ 2017 toolset\" component is selected in the Visual Studio 2017 installation options.");
            }
            else
            {
                Log.TraceWarning("No Visual C++ installation was found. Please download and install Visual Studio 2015 with C++ components.");
            }

            // Finally, default to VS2015 anyway
            return(WindowsCompiler.VisualStudio2015);
        }
 /// ProjectFileGenerator interface
 public override MasterProjectFolder AllocateMasterProjectFolder(ProjectFileGenerator InitOwnerProjectFileGenerator, string InitFolderName)
 {
     return(new VisualStudioSolutionFolder(InitOwnerProjectFileGenerator, InitFolderName));
 }
Exemplo n.º 10
0
 public EddieProjectFolder(ProjectFileGenerator InitOwnerProjectFileGenerator, string InitFolderName)
     : base(InitOwnerProjectFileGenerator, InitFolderName)
 {
 }
 public ProjectFileGeneratorTests()
 {
     _mockFileSystem       = new MockFileSystem();
     _projectFileGenerator = new ProjectFileGenerator(_mockFileSystem);
 }
Exemplo n.º 12
0
 public RiderMasterProjectFolder(ProjectFileGenerator InitOwnerProjectFileGenerator, string InitFolderName) :
     base(InitOwnerProjectFileGenerator, InitFolderName)
 {
 }
Exemplo n.º 13
0
 public override MasterProjectFolder AllocateMasterProjectFolder(ProjectFileGenerator OwnerProjectFileGenerator,
                                                                 string FolderName)
 {
     return(new RiderMasterProjectFolder(OwnerProjectFileGenerator, FolderName));
 }
Exemplo n.º 14
0
 /// <summary>
 /// Constructor
 /// </summary>
 public VisualStudioSolutionFolder(ProjectFileGenerator InitOwnerProjectFileGenerator, string InitFolderName)
     : base(InitOwnerProjectFileGenerator, InitFolderName)
 {
 }
        public void CommandViewModelTo(GenerateProjectFile cmd)
        {
            var Instance = new ProjectFileGenerator();

            Instance.GenerateProjectFiles(cmd.GeneratedProjectFileAbsolutePath, cmd.ProjectName);
        }
Exemplo n.º 16
0
 /// <summary>
 /// Constructor
 /// </summary>
 public QMakefileFolder(ProjectFileGenerator InitOwnerProjectFileGenerator, string InitFolderName)
     : base(InitOwnerProjectFileGenerator, InitFolderName)
 {
 }
Exemplo n.º 17
0
 /// ProjectFileGenerator interface
 public override MasterProjectFolder AllocateMasterProjectFolder(ProjectFileGenerator InitOwnerProjectFileGenerator, string InitFolderName)
 {
     return(new QMakefileFolder(InitOwnerProjectFileGenerator, InitFolderName));
 }
Exemplo n.º 18
0
 public GenerateProjectFile()
 {
     _projectFileGenerator = new ProjectFileGenerator();
 }