public override void GenerateProjectConfigurationGeneral(IVcxprojGenerationContext context, IFileGenerator generator) { var devEnv = context.DevelopmentEnvironment; var resolver = generator.Resolver; string remoteProjectPath = @"$(RemoteRootDir)"; Options.Vc.RemoteBuild.ProjectDirectory projectDirectoryOption = Options.GetObject <Options.Vc.RemoteBuild.ProjectDirectory>(context.Configuration); if (projectDirectoryOption != null) { remoteProjectPath += Util.WindowsSeparator + projectDirectoryOption.Value; remoteProjectPath = remoteProjectPath.TrimEnd(Util.WindowsSeparator); } string remoteBinPath = remoteProjectPath + Util.WindowsSeparator + resolver.Resolve("[options.OutputDirectory]").TrimEnd(Util.WindowsSeparator); if (context.Configuration.StartWorkingDirectory.Length > 0) { remoteBinPath = context.Configuration.StartWorkingDirectory; } string remoteCommand = remoteProjectPath + Util.WindowsSeparator + resolver.Resolve("[options.OutputFile]"); using (generator.Declare("LinuxRemoteRootDir", @"~/" + devEnv.ToString())) // Should this be configurable? using (generator.Declare("LinuxRemoteProjectDir", remoteProjectPath.Replace(Util.WindowsSeparator, Util.UnixSeparator))) using (generator.Declare("LinuxRemoteDebuggerWorkingDirectory", remoteBinPath.Replace(Util.WindowsSeparator, Util.UnixSeparator))) using (generator.Declare("LinuxRemoteDebuggerCommand", remoteCommand.Replace(Util.WindowsSeparator, Util.UnixSeparator))) { generator.Write(_projectConfigurationsGeneral); } }
public override void GeneratePlatformResourceFileList(IVcxprojGenerationContext context, IFileGenerator fileGenerator, Strings alreadyWrittenPriFiles, IList <Vcxproj.ProjectFile> resourceFiles, IList <Vcxproj.ProjectFile> imageResourceFiles) { // adding the durango resw file, if they were not in PRIFiles var resourceResw = new List <Vcxproj.ProjectFile>(); foreach (string file in context.Project.XResourcesResw) { var projectFile = new Vcxproj.ProjectFile(context, file); if (!alreadyWrittenPriFiles.Contains(projectFile.FileNameProjectRelative)) { resourceResw.Add(projectFile); } } if (resourceResw.Count > 0) { fileGenerator.Write(_projectFilesBegin); foreach (var projectFile in resourceResw) { using (fileGenerator.Declare("file", projectFile)) { fileGenerator.Write(_projectPriResource); } resourceFiles.Add(projectFile); } fileGenerator.Write(_projectFilesEnd); } // adding the durango img file if (context.Project.XResourcesImg.Count > 0) { fileGenerator.Write(_projectFilesBegin); foreach (string file in context.Project.XResourcesImg) { var projectFile = new Vcxproj.ProjectFile(context, file); using (fileGenerator.Declare("file", projectFile)) { fileGenerator.Write(_projectImgResource); } imageResourceFiles.Add(projectFile); } fileGenerator.Write(_projectFilesEnd); } // WARNING: THIS IS A PATCH TO ADD THE XMANIFEST FILE IN THE FILE LIST // This is not a clean way to do but it is the only way we found so far if (context.ProjectConfigurations.First().NeedsAppxManifestFile) { fileGenerator.Write(_projectFilesBegin); { string file = Sharpmake.Util.GetAppxManifestFileName(context.ProjectConfigurations.First()); var projectFile = new Vcxproj.ProjectFile(context, file); using (fileGenerator.Declare("file", projectFile)) { fileGenerator.Write(_projectFilesXManifest); } } fileGenerator.Write(_projectFilesEnd); } }
public static void WriteProjectConfigurationsDescription(IEnumerable <Project.Configuration> configurations, IFileGenerator fileGenerator) { fileGenerator.Write(Template.Project.ProjectBeginConfigurationDescription); var platformNames = new Strings(); var configNames = new Strings(); foreach (var conf in configurations) { var platformName = Util.GetPlatformString(conf.Platform, conf.Project, conf.Target); platformNames.Add(platformName); configNames.Add(conf.Name); } // write all combinations to avoid "Incomplete Configuration" VS warning foreach (var configName in configNames.SortedValues) { foreach (var platformName in platformNames.SortedValues) { using (fileGenerator.Declare("platformName", platformName)) using (fileGenerator.Declare("configName", configName)) { fileGenerator.Write(Template.Project.ProjectConfigurationDescription); } } } fileGenerator.Write(Template.Project.ProjectEndConfigurationDescription); }
public override void GeneratePlatformSpecificProjectDescription(IVcxprojGenerationContext context, IFileGenerator generator) { using (generator.Declare("platformName", SimplePlatformString)) { generator.Write(Vcxproj.Template.Project.ProjectDescriptionStartPlatformConditional); { string applicationTypeRevision; bool hasFastBuildConfig = context.ProjectConfigurations.Any(conf => conf.IsFastBuild); bool hasNonFastBuildConfig = context.ProjectConfigurations.Any(conf => !conf.IsFastBuild); if (hasFastBuildConfig && hasNonFastBuildConfig) { applicationTypeRevision = "1.0"; } else { applicationTypeRevision = hasFastBuildConfig ? FileGeneratorUtilities.RemoveLineTag : "1.0"; } using (generator.Declare("applicationType", "Linux")) using (generator.Declare("applicationTypeRevision", applicationTypeRevision)) using (generator.Declare("targetLinuxPlatform", "Generic")) { generator.Write(_projectDescriptionPlatformSpecific); } } generator.Write(Vcxproj.Template.Project.PropertyGroupEnd); } }
public override void GeneratePlatformSpecificProjectDescription(IVcxprojGenerationContext context, IFileGenerator generator) { string platformFolder = MSBuildGlobalSettings.GetCppPlatformFolder(context.DevelopmentEnvironmentsRange.MinDevEnv, Platform.win64); if (string.IsNullOrEmpty(platformFolder) || !ClangForWindows.Settings.OverridenLLVMInstallDir) { return; } generator.Write(Vcxproj.Template.Project.ProjectDescriptionStartPlatformConditional); { if (!string.IsNullOrEmpty(platformFolder)) { using (generator.Declare("custompropertyname", "_PlatformFolder")) using (generator.Declare("custompropertyvalue", Util.EnsureTrailingSeparator(platformFolder))) // _PlatformFolder require the path to end with a "\" generator.Write(Vcxproj.Template.Project.CustomProperty); } if (ClangForWindows.Settings.OverridenLLVMInstallDir) { using (generator.Declare("custompropertyname", "LLVMInstallDir")) using (generator.Declare("custompropertyvalue", ClangForWindows.Settings.LLVMInstallDir.TrimEnd(Util._pathSeparators))) // trailing separator will be added by LLVM.Cpp.Common.props generator.Write(Vcxproj.Template.Project.CustomProperty); } } generator.Write(Vcxproj.Template.Project.PropertyGroupEnd); }
public override void GeneratePlatformSpecificProjectDescription(IVcxprojGenerationContext context, IFileGenerator generator) { if (!ClangForWindows.Settings.OverridenLLVMInstallDir) { return; } if (context.DevelopmentEnvironmentsRange.MinDevEnv != context.DevelopmentEnvironmentsRange.MaxDevEnv) { throw new Error("Different vs versions not supported in the same vcxproj"); } DevEnv uniqueDevEnv = context.DevelopmentEnvironmentsRange.MinDevEnv; using (generator.Declare("platformName", SimplePlatformString)) { generator.Write(Vcxproj.Template.Project.ProjectDescriptionStartPlatformConditional); { switch (uniqueDevEnv) { case DevEnv.vs2017: { string platformFolder = MSBuildGlobalSettings.GetCppPlatformFolder(context.DevelopmentEnvironmentsRange.MinDevEnv, Platform.win64); if (!string.IsNullOrEmpty(platformFolder)) { using (generator.Declare("platformFolder", Util.EnsureTrailingSeparator(platformFolder))) // _PlatformFolder require the path to end with a "\" generator.Write(Vcxproj.Template.Project.PlatformFolderOverride); } } break; case DevEnv.vs2019: { // Note1: _PlatformFolder override is deprecated starting with vs2019, so we write AdditionalVCTargetsPath instead // Note2: MSBuildGlobalSettings.SetCppPlatformFolder for vs2019 is no more the valid way to handle it. Older buildtools packages can anyway contain it, and need upgrade. if (!string.IsNullOrEmpty(MSBuildGlobalSettings.GetCppPlatformFolder(uniqueDevEnv, Platform.win64))) { throw new Error("SetCppPlatformFolder is not supported by VS2019 correctly: use of MSBuildGlobalSettings.SetCppPlatformFolder should be replaced by use of MSBuildGlobalSettings.SetAdditionalVCTargetsPath."); } // vs2019 use AdditionalVCTargetsPath string additionalVCTargetsPath = MSBuildGlobalSettings.GetAdditionalVCTargetsPath(uniqueDevEnv, Platform.win64); using (generator.Declare("additionalVCTargetsPath", Util.EnsureTrailingSeparator(additionalVCTargetsPath))) // the path shall end with a "\" generator.Write(Vcxproj.Template.Project.AdditionalVCTargetsPath); } break; default: throw new Error(uniqueDevEnv + " is not supported."); } ClangForWindows.WriteLLVMOverrides(context, generator); } generator.Write(Vcxproj.Template.Project.PropertyGroupEnd); } }
public override void GeneratePlatformSpecificProjectDescription(IVcxprojGenerationContext context, IFileGenerator generator) { using (generator.Declare("platformName", SimplePlatformString)) using (generator.Declare("applicationType", "Linux")) using (generator.Declare("applicationTypeRevision", "1.0")) using (generator.Declare("targetLinuxPlatform", "Generic")) { generator.Write(Vcxproj.Template.Project.ProjectDescriptionStartPlatformConditional); generator.Write(_projectDescriptionPlatformSpecific); generator.Write(Vcxproj.Template.Project.PropertyGroupEnd); } }
public override void GeneratePlatformSpecificProjectDescription(IVcxprojGenerationContext context, IFileGenerator generator) { generator.Write(_projectStartPlatformConditional); string msBuildPathOverrides = string.Empty; // MSBuild override when mixing devenvs in the same vcxproj is not supported, // but before throwing an exception check if we have some override for (DevEnv devEnv = context.DevelopmentEnvironmentsRange.MinDevEnv; devEnv <= context.DevelopmentEnvironmentsRange.MaxDevEnv; devEnv = (DevEnv)((int)devEnv << 1)) { switch (devEnv) { case DevEnv.vs2017: case DevEnv.vs2019: case DevEnv.vs2022: { // _PlatformFolder override is not enough for android, we need to know the AdditionalVCTargetsPath // Note that AdditionalVCTargetsPath is not officially supported by vs2017, but we use the variable anyway for convenience and consistency if (!string.IsNullOrEmpty(MSBuildGlobalSettings.GetCppPlatformFolder(devEnv, SharpmakePlatform))) { throw new Error($"SetCppPlatformFolder is not supported by {devEnv}: use of MSBuildGlobalSettings.SetCppPlatformFolder should be replaced by use of MSBuildGlobalSettings.SetAdditionalVCTargetsPath."); } string additionalVCTargetsPath = MSBuildGlobalSettings.GetAdditionalVCTargetsPath(devEnv, SharpmakePlatform); if (!string.IsNullOrEmpty(additionalVCTargetsPath)) { using (generator.Declare("additionalVCTargetsPath", Sharpmake.Util.EnsureTrailingSeparator(additionalVCTargetsPath))) msBuildPathOverrides += generator.Resolver.Resolve(Vcxproj.Template.Project.AdditionalVCTargetsPath); } } break; } } using (generator.Declare("androidApplicationModule", Options.GetOptionValue("androidApplicationModule", context.ProjectConfigurationOptions.Values))) using (generator.Declare("androidHome", Options.GetOptionValue("androidHome", context.ProjectConfigurationOptions.Values))) using (generator.Declare("javaHome", Options.GetOptionValue("javaHome", context.ProjectConfigurationOptions.Values))) using (generator.Declare("androidNdkVersion", Options.GetOptionValue("androidNdkVersion", context.ProjectConfigurationOptions.Values))) using (generator.Declare("androidMinSdkVersion", Options.GetOptionValue("androidMinSdkVersion", context.ProjectConfigurationOptions.Values))) using (generator.Declare("ndkRoot", Options.GetOptionValue("ndkRoot", context.ProjectConfigurationOptions.Values))) using (generator.Declare("androidEnablePackaging", Options.GetOptionValue("androidEnablePackaging", context.ProjectConfigurationOptions.Values))) using (generator.Declare("androidGradleBuildDir", Options.GetOptionValue("androidGradleBuildDir", context.ProjectConfigurationOptions.Values))) { generator.Write(_projectDescriptionPlatformSpecific); } if (!string.IsNullOrEmpty(msBuildPathOverrides)) { if (context.DevelopmentEnvironmentsRange.MinDevEnv != context.DevelopmentEnvironmentsRange.MaxDevEnv) { throw new Error("Different vs versions not supported in the same vcxproj"); } generator.WriteVerbatim(msBuildPathOverrides); } generator.Write(Vcxproj.Template.Project.ProjectDescriptionEnd); }
public override void GeneratePlatformSpecificProjectDescription(IVcxprojGenerationContext context, IFileGenerator generator) { if (GlobalSettings.OverridenDurangoXDK) { string durangoXdkKitPath = FileGeneratorUtilities.RemoveLineTag; string xdkEditionTarget = FileGeneratorUtilities.RemoveLineTag; string targetPlatformSdkPath = FileGeneratorUtilities.RemoveLineTag; string durangoXdkCompilers = FileGeneratorUtilities.RemoveLineTag; string gameOSFilePath = FileGeneratorUtilities.RemoveLineTag; string durangoXdkTasks = FileGeneratorUtilities.RemoveLineTag; string targetPlatformIdentifier = FileGeneratorUtilities.RemoveLineTag; if (!Util.IsDurangoSideBySideXDK()) { durangoXdkKitPath = Sharpmake.Util.EnsureTrailingSeparator(Path.Combine(GlobalSettings.DurangoXDK, "xdk")); // Set only if the machine has a SideBySide XDK installed, but we don't generate for one if (Util.IsDurangoSideBySideXDKInstalled()) { if (context.ProjectConfigurations.Any(conf => !conf.IsFastBuild)) { durangoXdkCompilers = durangoXdkKitPath; } gameOSFilePath = Path.Combine(GlobalSettings.DurangoXDK, "sideload", "era.xvd"); // Use the tasks of the system durangoXdkTasks = Sharpmake.Util.EnsureTrailingSeparator(Path.Combine(Util.GetDurangoXDKInstallPath(), Util.GetLatestDurangoSideBySideXDKInstalled(), "PC", "tasks")); targetPlatformIdentifier = "Xbox.xdk"; } } else { xdkEditionTarget = GlobalSettings.XdkEditionTarget; targetPlatformSdkPath = Util.GetDurangoExtensionXDK(); } using (generator.Declare("durangoXdkInstallPath", GlobalSettings.DurangoXDK)) using (generator.Declare("sdkReferenceDirectoryRoot", GlobalSettings.XboxOneExtensionSDK)) using (generator.Declare("durangoXdkKitPath", durangoXdkKitPath)) using (generator.Declare("xdkEditionTarget", xdkEditionTarget)) using (generator.Declare("targetPlatformSdkPath", targetPlatformSdkPath)) using (generator.Declare("durangoXdkCompilers", durangoXdkCompilers)) using (generator.Declare("gameOSFilePath", gameOSFilePath)) using (generator.Declare("durangoXdkTasks", durangoXdkTasks)) using (generator.Declare("targetPlatformIdentifier", targetPlatformIdentifier)) using (generator.Declare("xdkEditionRootVS2015", GlobalSettings.XdkEditionRootVS2015 ?? FileGeneratorUtilities.RemoveLineTag)) { generator.Write(_projectDescriptionPlatformSpecific); } } }
public static void WriteLLVMOverrides(IVcxprojGenerationContext context, IFileGenerator generator) { if (Settings.OverridenLLVMInstallDir) { bool hasClangConfiguration = context.ProjectConfigurations.Any(conf => Options.GetObject <Options.Vc.General.PlatformToolset>(conf).IsLLVMToolchain()); if (hasClangConfiguration) { using (generator.Declare("custompropertyname", "LLVMInstallDir")) using (generator.Declare("custompropertyvalue", Settings.LLVMInstallDir.TrimEnd(Util._pathSeparators))) // trailing separator will be added by LLVM.Cpp.Common.props generator.Write(Vcxproj.Template.Project.CustomProperty); } } }
public override void GeneratePlatformReferences(IVcxprojGenerationContext context, IFileGenerator generator) { // Write SDKReferences on durango if needed // TODO: add a consistency check between configurations Strings sdkReferences = new Strings(); foreach (var conf in context.ProjectConfigurations) { if (conf.Platform == Platform.durango) { sdkReferences.AddRange(Sharpmake.Options.GetStrings <Options.SDKReferences>(conf)); } } if (sdkReferences.Count > 0) { generator.Write(_sdkReferencesBegin); foreach (string sdkReference in sdkReferences) { using (generator.Declare("sdkReferenceInclude", sdkReference)) { generator.Write(_sdkReference); } } generator.Write(_sdkReferencesEnd); } }
public static void WriteCustomProperties(Dictionary <string, string> customProperties, IFileGenerator fileGenerator) { if (customProperties.Count == 0) { return; } fileGenerator.Write(Template.PropertyGroupStart); foreach (var kvp in customProperties) { using (fileGenerator.Declare("custompropertyname", kvp.Key)) using (fileGenerator.Declare("custompropertyvalue", kvp.Value)) fileGenerator.Write(Template.CustomProperty); } fileGenerator.Write(Template.PropertyGroupEnd); }
private void GenerateProjectReferences( GenerationContext context, IFileGenerator fileGenerator) { var dependencies = new UniqueList <ProjectDependencyInfo>(); foreach (var c in context.ProjectConfigurations) { foreach (var d in c.ConfigurationDependencies) { // Ignore projects marked as Export if (d.Project.SharpmakeProjectType == Project.ProjectTypeAttribute.Export) { continue; } ProjectDependencyInfo depInfo; depInfo.ProjectFullFileNameWithExtension = d.ProjectFullFileNameWithExtension; if (d.Project.SharpmakeProjectType != Project.ProjectTypeAttribute.Compile) { depInfo.ProjectGuid = d.ProjectGuid; } else { throw new NotImplementedException("Sharpmake.Compile not supported as a dependency by this generator."); } dependencies.Add(depInfo); } } if (dependencies.Count > 0) { fileGenerator.Write(Template.Project.ItemGroupBegin); foreach (var d in dependencies) { string include = Util.PathGetRelative(context.ProjectDirectory, d.ProjectFullFileNameWithExtension); using (fileGenerator.Declare("include", include)) using (fileGenerator.Declare("projectGUID", d.ProjectGuid)) { fileGenerator.Write(Template.Project.ProjectReference); } } fileGenerator.Write(Template.Project.ItemGroupEnd); } }
public override void GeneratePlatformSpecificProjectDescription(IVcxprojGenerationContext context, IFileGenerator generator) { string applicationTypeRevision = context.DevelopmentEnvironmentsRange.MinDevEnv == DevEnv.vs2017 ? "3.0" : "2.0"; using (generator.Declare("applicationTypeRevision", applicationTypeRevision)) { generator.Write(_projectDescriptionPlatformSpecific); } }
public override void GenerateRunFromPcDeployment(IVcxprojGenerationContext context, IFileGenerator generator) { var project = context.Project; string registerCommand = !string.IsNullOrEmpty(project.RunFromPcDeploymentRegisterCommand) ? project.RunFromPcDeploymentRegisterCommand : FileGeneratorUtilities.RemoveLineTag; using (generator.Declare("DurangoRunFromPCDeploymentRegisterCommand", registerCommand)) { generator.Write(_runFromPCDeployment); } }
public static void WriteEnvironmentVariables( IEnumerable <VariableAssignment> environmentVariables, IFileGenerator fileGenerator ) { if (!environmentVariables.Any()) { return; } fileGenerator.Write(Template.ItemGroupBegin); foreach (var environmentTuple in environmentVariables) { using (fileGenerator.Declare("environmentVariableName", environmentTuple.Identifier)) using (fileGenerator.Declare("environmentVariableValue", environmentTuple.Value)) fileGenerator.Write(Template.Project.ProjectBuildMacroEnvironmentVariable); } fileGenerator.Write(Template.ItemGroupEnd); }
public override void GeneratePlatformSpecificProjectDescription(IVcxprojGenerationContext context, IFileGenerator generator) { generator.Write(_projectStartPlatformConditional); string applicationTypeRevision = (context.DevelopmentEnvironmentsRange.MinDevEnv == DevEnv.vs2017 || context.DevelopmentEnvironmentsRange.MinDevEnv == DevEnv.vs2019) ? "3.0" : "2.0"; using (generator.Declare("applicationTypeRevision", applicationTypeRevision)) { generator.Write(_projectDescriptionPlatformSpecific); } generator.Write(Vcxproj.Template.Project.ProjectDescriptionEnd); }
/// <summary> /// Declares one or several variables to be replaced while resolving. /// </summary> /// <param name="fileGenerator">The <see cref="IFileGenerator"/> instance to use.</param> /// <param name="identifier">The symbol's identifier name.</param> /// <param name="value">The value of the symbol when resolving.</param> /// <returns>An object that implements <see cref="IDisposable"/> and will automatically undefine the variable when it's <see cref="IDisposable.Dispose"/> method is invoked.</returns> /// <exception cref="ArgumentNullException"><paramref name="fileGenerator"/> or <paramref name="identifier"/> is null.</exception> public static IDisposable Declare(this IFileGenerator fileGenerator, string identifier, object value) { if (fileGenerator == null) { throw new ArgumentNullException(nameof(fileGenerator)); } if (identifier == null) { throw new ArgumentNullException(nameof(identifier)); } return(fileGenerator.Declare(new VariableAssignment(identifier, value))); }
public static void WriteConfigurationsCustomPropsFiles( IEnumerable <Project.Configuration> configurations, string projectDirectoryCapitalized, IFileGenerator fileGenerator ) { foreach (Project.Configuration conf in configurations) { using (fileGenerator.Declare("platformName", Util.GetPlatformString(conf.Platform, conf.Project, conf.Target))) using (fileGenerator.Declare("conf", conf)) { foreach (string propsFile in conf.CustomPropsFiles) { string capitalizedFile = Project.GetCapitalizedFile(propsFile) ?? propsFile; string relativeFile = Util.PathGetRelative(projectDirectoryCapitalized, capitalizedFile); using (fileGenerator.Declare("importedPropsFile", relativeFile)) { fileGenerator.Write(Template.Project.ProjectConfigurationImportProps); } } } } }
public static void WriteProjectCustomPropsFiles( IEnumerable <string> customProps, string projectDirectoryCapitalized, IFileGenerator fileGenerator ) { foreach (string propsFile in customProps) { string capitalizedFile = Project.GetCapitalizedFile(propsFile) ?? propsFile; string relativeFile = Util.PathGetRelative(projectDirectoryCapitalized, capitalizedFile); using (fileGenerator.Declare("importedPropsFile", relativeFile)) { fileGenerator.Write(Template.Project.ProjectImportProps); } } }
private void GenerateFilesSection( GenerationContext context, IFileGenerator fileGenerator) { Strings projectFiles = context.Project.GetSourceFilesForConfigurations(context.ProjectConfigurations); // Add source files var allFiles = new List <Vcxproj.ProjectFile>(); foreach (string file in projectFiles) { var projectFile = new Vcxproj.ProjectFile(context, file); allFiles.Add(projectFile); } allFiles.Sort((l, r) => { return(string.Compare(l.FileNameProjectRelative, r.FileNameProjectRelative, StringComparison.InvariantCultureIgnoreCase)); }); var sourceFiles = new List <Vcxproj.ProjectFile>(); var contentFiles = new List <Vcxproj.ProjectFile>(); foreach (var projectFile in allFiles) { if (context.Project.SourceFilesCompileExtensions.Contains(projectFile.FileExtension)) { sourceFiles.Add(projectFile); } else { contentFiles.Add(projectFile); } } // Write content files if (contentFiles.Count > 0) { // Filter out the main 3 files from the list since they might share extensions string[] coreFiles = { fileGenerator.Resolver.Resolve(context.AndroidPackageProject.AntBuildXml), fileGenerator.Resolver.Resolve(context.AndroidPackageProject.AntProjectPropertiesFile), fileGenerator.Resolver.Resolve(context.AndroidPackageProject.AndroidManifest), }; fileGenerator.Write(Template.Project.ProjectFilesBegin); foreach (var file in contentFiles) { if (!coreFiles.Contains(fileGenerator.Resolver.Resolve(file.FileNameProjectRelative))) { using (fileGenerator.Declare("file", file)) fileGenerator.Write(Template.Project.ContentSimple); } } fileGenerator.Write(Template.Project.ProjectFilesEnd); } // Write source files if (sourceFiles.Count > 0) { fileGenerator.Write(Template.Project.ProjectFilesBegin); foreach (var file in sourceFiles) { using (fileGenerator.Declare("file", file)) fileGenerator.Write(Template.Project.ProjectFilesSource); } fileGenerator.Write(Template.Project.ProjectFilesEnd); } // Write Android project files fileGenerator.Write(Template.Project.ItemGroupBegin); if (_isGradleBuild) { foreach (var file in context.AndroidPackageProject.GradleTemplateFiles) { using (fileGenerator.Declare("gradleTemplateFile", file)) fileGenerator.Write(Template.Project.GradleTemplate); } } else { using (fileGenerator.Declare("antBuildXml", context.AndroidPackageProject.AntBuildXml)) using (fileGenerator.Declare("antProjectPropertiesFile", context.AndroidPackageProject.AntProjectPropertiesFile)) using (fileGenerator.Declare("androidManifest", context.AndroidPackageProject.AndroidManifest)) { fileGenerator.Write(Template.Project.AntBuildXml); fileGenerator.Write(Template.Project.AndroidManifest); fileGenerator.Write(Template.Project.AntProjectPropertiesFile); } } fileGenerator.Write(Template.Project.ItemGroupEnd); }
public override void GeneratePlatformSpecificProjectDescription(IVcxprojGenerationContext context, IFileGenerator generator) { string propertyGroups = string.Empty; // MSBuild override when mixing devenvs in the same vcxproj is not supported, // but before throwing an exception check if we have some override for (DevEnv devEnv = context.DevelopmentEnvironmentsRange.MinDevEnv; devEnv <= context.DevelopmentEnvironmentsRange.MaxDevEnv; devEnv = (DevEnv)((int)devEnv << 1)) { switch (devEnv) { case DevEnv.vs2015: case DevEnv.vs2017: { string platformFolder = MSBuildGlobalSettings.GetCppPlatformFolder(devEnv, Platform.win64); if (!string.IsNullOrEmpty(platformFolder)) { using (generator.Declare("platformFolder", Util.EnsureTrailingSeparator(platformFolder))) // _PlatformFolder require the path to end with a "\" propertyGroups += generator.Resolver.Resolve(Vcxproj.Template.Project.PlatformFolderOverride); } } break; case DevEnv.vs2019: case DevEnv.vs2022: { // Note1: _PlatformFolder override is deprecated starting with vs2019, so we write AdditionalVCTargetsPath instead // Note2: MSBuildGlobalSettings.SetCppPlatformFolder for vs2019 and above is no more the valid way to handle it. if (!string.IsNullOrEmpty(MSBuildGlobalSettings.GetCppPlatformFolder(devEnv, Platform.win64))) { throw new Error($"SetCppPlatformFolder is not supported by {devEnv}: use of MSBuildGlobalSettings.SetCppPlatformFolder should be replaced by use of MSBuildGlobalSettings.SetAdditionalVCTargetsPath."); } // vs2019 and up use AdditionalVCTargetsPath string additionalVCTargetsPath = MSBuildGlobalSettings.GetAdditionalVCTargetsPath(devEnv, Platform.win64); if (!string.IsNullOrEmpty(additionalVCTargetsPath)) { using (generator.Declare("additionalVCTargetsPath", Util.EnsureTrailingSeparator(additionalVCTargetsPath))) // the path shall end with a "\" propertyGroups += generator.Resolver.Resolve(Vcxproj.Template.Project.AdditionalVCTargetsPath); } } break; } } string llvmOverrideSection = ClangForWindows.GetLLVMOverridesSection(context, generator.Resolver); if (!string.IsNullOrEmpty(llvmOverrideSection)) { propertyGroups += llvmOverrideSection; } if (!string.IsNullOrEmpty(propertyGroups)) { if (context.DevelopmentEnvironmentsRange.MinDevEnv != context.DevelopmentEnvironmentsRange.MaxDevEnv) { throw new Error("Different vs versions not supported in the same vcxproj"); } using (generator.Declare("platformName", SimplePlatformString)) { generator.Write(Vcxproj.Template.Project.ProjectDescriptionStartPlatformConditional); generator.WriteVerbatim(propertyGroups); generator.Write(Vcxproj.Template.Project.PropertyGroupEnd); } } }
public override void GeneratePlatformResourceFileList(IVcxprojGenerationContext context, IFileGenerator fileGenerator, Strings alreadyWrittenPriFiles, IList <Vcxproj.ProjectFile> resourceFiles, IList <Vcxproj.ProjectFile> imageResourceFiles) { // adding the durango resw file, if they were not in PRIFiles var resourceResw = new List <Vcxproj.ProjectFile>(); foreach (string file in context.Project.XResourcesResw) { var projectFile = new Vcxproj.ProjectFile(context, file); if (!alreadyWrittenPriFiles.Contains(projectFile.FileNameProjectRelative)) { resourceResw.Add(projectFile); } } if (resourceResw.Count > 0) { fileGenerator.Write(_projectFilesBegin); foreach (var projectFile in resourceResw) { using (fileGenerator.Declare("file", projectFile)) { fileGenerator.Write(_projectPriResource); } resourceFiles.Add(projectFile); } fileGenerator.Write(_projectFilesEnd); } // adding the durango img file if (context.Project.XResourcesImg.Count > 0) { fileGenerator.Write(_projectFilesBegin); foreach (string file in context.Project.XResourcesImg) { var projectFile = new Vcxproj.ProjectFile(context, file); using (fileGenerator.Declare("file", projectFile)) { fileGenerator.Write(_projectImgResource); } imageResourceFiles.Add(projectFile); } fileGenerator.Write(_projectFilesEnd); } // WARNING: THIS IS A PATCH TO ADD THE XMANIFEST FILE IN THE FILE LIST // This is not a clean way to do but it is the only way we found so far var manifestFiles = context.ProjectConfigurations .Where(x => x.Platform == Platform.durango && x.NeedsAppxManifestFile) .Select(Sharpmake.Util.GetAppxManifestFileName) .Distinct() .ToList(); if (manifestFiles.Count > 1) { throw new Error("conf.AppxManifestFilePath must be identical for all Durango configurations."); } else if (manifestFiles.Count == 1) { fileGenerator.Write(_projectFilesBegin); { var projectFile = new Vcxproj.ProjectFile(context, manifestFiles[0]); using (fileGenerator.Declare("file", projectFile)) { fileGenerator.Write(_projectFilesXManifest); } } fileGenerator.Write(_projectFilesEnd); } }
public override void GeneratePlatformSpecificProjectDescription(IVcxprojGenerationContext context, IFileGenerator generator) { if (GlobalSettings.OverridenDurangoXDK) { string durangoXdkKitPath = FileGeneratorUtilities.RemoveLineTag; string xdkEditionTarget = FileGeneratorUtilities.RemoveLineTag; string targetPlatformSdkPath = FileGeneratorUtilities.RemoveLineTag; string durangoXdkCompilers = FileGeneratorUtilities.RemoveLineTag; string gameOSFilePath = FileGeneratorUtilities.RemoveLineTag; string durangoXdkTasks = FileGeneratorUtilities.RemoveLineTag; string targetPlatformIdentifier = FileGeneratorUtilities.RemoveLineTag; string platformFolder = MSBuildGlobalSettings.GetCppPlatformFolder(context.DevelopmentEnvironmentsRange.MinDevEnv, Platform.durango); string xdkEditionRootVS2015 = FileGeneratorUtilities.RemoveLineTag; string xdkEditionRootVS2017 = FileGeneratorUtilities.RemoveLineTag; string enableLegacyXdkHeaders = FileGeneratorUtilities.RemoveLineTag; if (!Util.IsDurangoSideBySideXDK()) { durangoXdkKitPath = Sharpmake.Util.EnsureTrailingSeparator(Path.Combine(GlobalSettings.DurangoXDK, "xdk")); // Set only if the machine has a SideBySide XDK installed, but we don't generate for one if (Util.IsDurangoSideBySideXDKInstalled()) { if (context.ProjectConfigurations.Any(conf => !conf.IsFastBuild)) { durangoXdkCompilers = durangoXdkKitPath; } gameOSFilePath = Path.Combine(GlobalSettings.DurangoXDK, "sideload", "era.xvd"); // Use the tasks of the system durangoXdkTasks = Sharpmake.Util.EnsureTrailingSeparator(Path.Combine(Util.GetDurangoXDKInstallPath(), Util.GetLatestDurangoSideBySideXDKInstalled(), "PC", "tasks")); targetPlatformIdentifier = "Xbox.xdk"; } } else { xdkEditionTarget = GlobalSettings.XdkEditionTarget; targetPlatformSdkPath = Util.GetDurangoExtensionXDK(); } generator.Write(Vcxproj.Template.Project.ProjectDescriptionStartPlatformConditional); { if (!string.IsNullOrEmpty(platformFolder)) { using (generator.Declare("custompropertyname", "_PlatformFolder")) using (generator.Declare("custompropertyvalue", Sharpmake.Util.EnsureTrailingSeparator(platformFolder))) // _PlatformFolder require the path to end with a "\" generator.Write(Vcxproj.Template.Project.CustomProperty); } if (DevEnv.vs2015 >= context.DevelopmentEnvironmentsRange.MinDevEnv && DevEnv.vs2015 <= context.DevelopmentEnvironmentsRange.MaxDevEnv) { var vs2015PlatformFolder = MSBuildGlobalSettings.GetCppPlatformFolder(DevEnv.vs2015, Platform.durango); if (!string.IsNullOrEmpty(vs2015PlatformFolder)) { xdkEditionRootVS2015 = vs2015PlatformFolder; } } if (DevEnv.vs2017 >= context.DevelopmentEnvironmentsRange.MinDevEnv && DevEnv.vs2017 <= context.DevelopmentEnvironmentsRange.MaxDevEnv) { var vs2017PlatformFolder = MSBuildGlobalSettings.GetCppPlatformFolder(DevEnv.vs2017, Platform.durango); if (!string.IsNullOrEmpty(vs2017PlatformFolder)) { xdkEditionRootVS2017 = vs2017PlatformFolder; } int xdkEdition; bool isMinFeb2018Xdk = Util.TryParseXdkEditionTarget(GlobalSettings.XdkEditionTarget, out xdkEdition) && xdkEdition >= GlobalSettings._feb2018XdkEditionTarget; if (GlobalSettings.EnableLegacyXdkHeaders && isMinFeb2018Xdk) { enableLegacyXdkHeaders = "true"; } } using (generator.Declare("durangoXdkInstallPath", GlobalSettings.DurangoXDK)) using (generator.Declare("sdkReferenceDirectoryRoot", GlobalSettings.XboxOneExtensionSDK)) using (generator.Declare("durangoXdkKitPath", durangoXdkKitPath)) using (generator.Declare("xdkEditionTarget", xdkEditionTarget)) using (generator.Declare("targetPlatformSdkPath", targetPlatformSdkPath)) using (generator.Declare("durangoXdkCompilers", durangoXdkCompilers)) using (generator.Declare("gameOSFilePath", gameOSFilePath)) using (generator.Declare("durangoXdkTasks", durangoXdkTasks)) using (generator.Declare("targetPlatformIdentifier", targetPlatformIdentifier)) using (generator.Declare("xdkEditionRootVS2015", xdkEditionRootVS2015)) using (generator.Declare("xdkEditionRootVS2017", xdkEditionRootVS2017)) using (generator.Declare("enableLegacyXdkHeaders", enableLegacyXdkHeaders)) { generator.Write(_projectDescriptionPlatformSpecific); } } generator.Write(Vcxproj.Template.Project.PropertyGroupEnd); } }
protected virtual void WriteWindowsKitsOverrides(IVcxprojGenerationContext context, IFileGenerator fileGenerator) { KitsRootEnum?kitsRootWritten = null; for (DevEnv devEnv = context.DevelopmentEnvironmentsRange.MinDevEnv; devEnv <= context.DevelopmentEnvironmentsRange.MaxDevEnv; devEnv = (DevEnv)((int)devEnv << 1)) { // there's no need to write the properties with older versions of vs, as we override // completely the VC++ directories entries in the vcxproj if (devEnv < DevEnv.vs2015) { continue; } KitsRootEnum kitsRootVersion = KitsRootPaths.GetUseKitsRootForDevEnv(devEnv); if (kitsRootWritten == null) { kitsRootWritten = kitsRootVersion; } else if (kitsRootWritten != kitsRootVersion) { throw new Error($"Different values of kitsRoot in the same vcxproj {context.ProjectFileName}"); } else { continue; } string windowsSdkDirKey = FileGeneratorUtilities.RemoveLineTag; string windowsSdkDirValue = FileGeneratorUtilities.RemoveLineTag; string UniversalCRTSdkDir_10 = FileGeneratorUtilities.RemoveLineTag; string UCRTContentRoot = FileGeneratorUtilities.RemoveLineTag; string targetPlatformVersionString = FileGeneratorUtilities.RemoveLineTag; if (kitsRootVersion != KitsRootEnum.KitsRoot81) // 8.1 is the default value for vs2015 and vs2017, so only specify a different platformVersion if we need to { targetPlatformVersionString = KitsRootPaths.GetWindowsTargetPlatformVersionForDevEnv(devEnv).ToVersionString(); } if (devEnv.OverridenWindowsPath()) { windowsSdkDirValue = Util.EnsureTrailingSeparator(KitsRootPaths.GetRoot(kitsRootVersion)); switch (kitsRootVersion) { case KitsRootEnum.KitsRoot: windowsSdkDirKey = "WindowsSdkDir_80"; break; case KitsRootEnum.KitsRoot81: windowsSdkDirKey = "WindowsSdkDir_81"; break; case KitsRootEnum.KitsRoot10: { windowsSdkDirKey = "WindowsSdkDir_10"; UniversalCRTSdkDir_10 = windowsSdkDirValue; // this variable is found in Windows Kits\10\DesignTime\CommonConfiguration\Neutral\uCRT.props // it is always read from the registry unless overridden, so we need to explicitly set it UCRTContentRoot = windowsSdkDirValue; } break; default: throw new NotImplementedException($"Unsupported kitsRoot '{kitsRootVersion}'"); } } using (fileGenerator.Declare("windowsSdkDirKey", windowsSdkDirKey)) using (fileGenerator.Declare("windowsSdkDirValue", windowsSdkDirValue)) using (fileGenerator.Declare("UniversalCRTSdkDir_10", UniversalCRTSdkDir_10)) using (fileGenerator.Declare("UCRTContentRoot", UCRTContentRoot)) using (fileGenerator.Declare("targetPlatformVersion", targetPlatformVersionString)) { fileGenerator.Write(_windowsSDKOverridesBegin); // vs2015 specific, we need to set the UniversalCRTSdkDir to $(UniversalCRTSdkDir_10) because it is not done in the .props if (devEnv == DevEnv.vs2015 && !string.Equals(UniversalCRTSdkDir_10, FileGeneratorUtilities.RemoveLineTag, StringComparison.Ordinal)) { using (fileGenerator.Declare("custompropertyname", "UniversalCRTSdkDir")) using (fileGenerator.Declare("custompropertyvalue", "$(UniversalCRTSdkDir_10)")) { fileGenerator.Write(fileGenerator.Resolver.Resolve(Vcxproj.Template.Project.CustomProperty)); } } fileGenerator.Write(_windowsSDKOverridesEnd); } } }
private void GenerateFilesSection( GenerationContext context, IFileGenerator fileGenerator) { Strings projectFiles = context.Project.GetSourceFilesForConfigurations(context.ProjectConfigurations); // Add source files var allFiles = new List <Vcxproj.ProjectFile>(); var includeFiles = new List <Vcxproj.ProjectFile>(); var sourceFiles = new List <Vcxproj.ProjectFile>(); var contentFiles = new List <Vcxproj.ProjectFile>(); foreach (string file in projectFiles) { var projectFile = new Vcxproj.ProjectFile(context, file); allFiles.Add(projectFile); } allFiles.Sort((l, r) => { return(string.Compare(l.FileNameProjectRelative, r.FileNameProjectRelative, StringComparison.InvariantCultureIgnoreCase)); }); // type -> files var customSourceFiles = new Dictionary <string, List <Vcxproj.ProjectFile> >(); foreach (var projectFile in allFiles) { string type = null; if (context.Project.ExtensionBuildTools.TryGetValue(projectFile.FileExtension, out type)) { List <Vcxproj.ProjectFile> files = null; if (!customSourceFiles.TryGetValue(type, out files)) { files = new List <Vcxproj.ProjectFile>(); customSourceFiles[type] = files; } files.Add(projectFile); } else if (context.Project.SourceFilesCompileExtensions.Contains(projectFile.FileExtension) || (String.Compare(projectFile.FileExtension, ".rc", StringComparison.OrdinalIgnoreCase) == 0)) { sourceFiles.Add(projectFile); } else if (String.Compare(projectFile.FileExtension, ".h", StringComparison.OrdinalIgnoreCase) == 0) { includeFiles.Add(projectFile); } else { contentFiles.Add(projectFile); } } // Write header files fileGenerator.Write(Template.Project.ProjectFilesBegin); foreach (var file in includeFiles) { using (fileGenerator.Declare("file", file)) fileGenerator.Write(Template.Project.ProjectFilesHeader); } fileGenerator.Write(Template.Project.ProjectFilesEnd); // Write content files fileGenerator.Write(Template.Project.ProjectFilesBegin); foreach (var file in contentFiles) { using (fileGenerator.Declare("file", file)) fileGenerator.Write(Template.Project.ContentSimple); } fileGenerator.Write(Template.Project.ProjectFilesEnd); // Write Android project files fileGenerator.Write(Template.Project.ItemGroupBegin); using (fileGenerator.Declare("antBuildXml", context.AndroidPackageProject.AntBuildXml)) using (fileGenerator.Declare("antProjectPropertiesFile", context.AndroidPackageProject.AntProjectPropertiesFile)) using (fileGenerator.Declare("androidManifest", context.AndroidPackageProject.AndroidManifest)) { fileGenerator.Write(Template.Project.AntBuildXml); fileGenerator.Write(Template.Project.AndroidManifest); fileGenerator.Write(Template.Project.AntProjectPropertiesFile); } fileGenerator.Write(Template.Project.ItemGroupEnd); }
public override void GeneratePlatformSpecificProjectDescription(IVcxprojGenerationContext context, IFileGenerator generator) { // When writing android properties section, do not add conditional properties for x64 and x86 if those // android targets are not used. This allows arm only projects to live alongside windows x64/x86 projects in the same file var buildTargets = context.ProjectConfigurationOptions .Where(conf => conf.Key.Platform == Platform.android && conf.Key.Target.HaveFragment <AndroidBuildTargets>()) .Select(conf => conf.Key.Target.GetFragment <AndroidBuildTargets>()) .Distinct() .Select(bt => { if (bt == AndroidBuildTargets.arm64_v8a) { return("ARM64"); } if (bt == AndroidBuildTargets.armeabi_v7a) { return("ARM"); } if (bt == AndroidBuildTargets.x86) { return("x86"); } /*if (bt == AndroidBuildTargets.x86_64)*/ return("x64"); }) .Select(bt => { using (generator.Declare("platform", bt)) return(generator.Resolver.Resolve(_projectStartPlatformConditionalPart)); }); using (generator.Declare("condition", string.Join(" OR ", buildTargets))) { generator.Write(_projectStartPlatformConditional); } string applicationType = "Android"; string applicationTypeRevision = Options.GetOptionValue("applicationTypeRevision", context.ProjectConfigurationOptions.Values, Options.Android.General.ApplicationTypeRevision.Default); string msBuildPathOverrides = string.Empty; // MSBuild override when mixing devenvs in the same vcxproj is not supported, // but before throwing an exception check if we have some override for (DevEnv devEnv = context.DevelopmentEnvironmentsRange.MinDevEnv; devEnv <= context.DevelopmentEnvironmentsRange.MaxDevEnv; devEnv = (DevEnv)((int)devEnv << 1)) { switch (devEnv) { case DevEnv.vs2017: case DevEnv.vs2019: case DevEnv.vs2022: { // _PlatformFolder override is not enough for android, we need to know the AdditionalVCTargetsPath // Note that AdditionalVCTargetsPath is not officially supported by vs2017, but we use the variable anyway for convenience and consistency if (!string.IsNullOrEmpty(MSBuildGlobalSettings.GetCppPlatformFolder(devEnv, SharpmakePlatform))) { throw new Error($"SetCppPlatformFolder is not supported by {devEnv}: use of MSBuildGlobalSettings.SetCppPlatformFolder should be replaced by use of MSBuildGlobalSettings.SetAdditionalVCTargetsPath."); } string additionalVCTargetsPath = MSBuildGlobalSettings.GetAdditionalVCTargetsPath(devEnv, SharpmakePlatform); if (!string.IsNullOrEmpty(additionalVCTargetsPath)) { using (generator.Declare("additionalVCTargetsPath", Sharpmake.Util.EnsureTrailingSeparator(additionalVCTargetsPath))) msBuildPathOverrides += generator.Resolver.Resolve(Vcxproj.Template.Project.AdditionalVCTargetsPath); // with vs2017, we need to set the _PlatformDefaultPropsPath property // otherwise the Microsoft.Cpp.Default.props won't be able to find the default platform props correctly if (devEnv == DevEnv.vs2017) { using (generator.Declare("applicationTypeRevision", applicationTypeRevision)) msBuildPathOverrides += generator.Resolver.Resolve(_projectPlatformDefaultPropsPath); // application type and revisions need to be cleared otherwise // the inclusion of the cpp default props will use the files from // the local vs installation and not the redirected one.. applicationType = RemoveLineTag; applicationTypeRevision = RemoveLineTag; } } } break; } } using (generator.Declare("applicationType", applicationType)) using (generator.Declare("applicationTypeRevision", applicationTypeRevision)) using (generator.Declare("androidHome", Options.GetOptionValue("androidHome", context.ProjectConfigurationOptions.Values))) using (generator.Declare("antHome", Options.GetOptionValue("antHome", context.ProjectConfigurationOptions.Values))) using (generator.Declare("javaHome", Options.GetOptionValue("javaHome", context.ProjectConfigurationOptions.Values))) using (generator.Declare("ndkRoot", Options.GetOptionValue("ndkRoot", context.ProjectConfigurationOptions.Values))) { generator.Write(_projectDescriptionPlatformSpecific); } if (!string.IsNullOrEmpty(msBuildPathOverrides)) { if (context.DevelopmentEnvironmentsRange.MinDevEnv != context.DevelopmentEnvironmentsRange.MaxDevEnv) { throw new Error("Different vs versions not supported in the same vcxproj"); } generator.WriteVerbatim(msBuildPathOverrides); } generator.Write(Vcxproj.Template.Project.ProjectDescriptionEnd); }
public override void GeneratePlatformSpecificProjectDescription(IVcxprojGenerationContext context, IFileGenerator generator) { generator.Write(_projectStartPlatformConditional); string applicationType = "Android"; string applicationTypeRevision = Options.GetOptionValue("applicationTypeRevision", context.ProjectConfigurationOptions.Values); string msBuildPathOverrides = string.Empty; // MSBuild override when mixing devenvs in the same vcxproj is not supported, // but before throwing an exception check if we have some override for (DevEnv devEnv = context.DevelopmentEnvironmentsRange.MinDevEnv; devEnv <= context.DevelopmentEnvironmentsRange.MaxDevEnv; devEnv = (DevEnv)((int)devEnv << 1)) { switch (devEnv) { case DevEnv.vs2017: case DevEnv.vs2019: { // _PlatformFolder override is not enough for android, we need to know the AdditionalVCTargetsPath // Note that AdditionalVCTargetsPath is not officially supported by vs2017, but we use the variable anyway for convenience and consistency if (!string.IsNullOrEmpty(MSBuildGlobalSettings.GetCppPlatformFolder(devEnv, SharpmakePlatform))) { throw new Error("SetCppPlatformFolder is not supported by AndroidPlatform correctly: use of MSBuildGlobalSettings.SetCppPlatformFolder should be replaced by use of MSBuildGlobalSettings.SetAdditionalVCTargetsPath."); } string additionalVCTargetsPath = MSBuildGlobalSettings.GetAdditionalVCTargetsPath(devEnv, SharpmakePlatform); if (!string.IsNullOrEmpty(additionalVCTargetsPath)) { using (generator.Declare("additionalVCTargetsPath", Sharpmake.Util.EnsureTrailingSeparator(additionalVCTargetsPath))) msBuildPathOverrides += generator.Resolver.Resolve(Vcxproj.Template.Project.AdditionalVCTargetsPath); // with vs2017, we need to set the _PlatformDefaultPropsPath property // otherwise the Microsoft.Cpp.Default.props won't be able to find the default platform props correctly if (devEnv == DevEnv.vs2017) { using (generator.Declare("applicationTypeRevision", applicationTypeRevision)) msBuildPathOverrides += generator.Resolver.Resolve(_projectPlatformDefaultPropsPath); // application type and revisions need to be cleared otherwise // the inclusion of the cpp default props will use the files from // the local vs installation and not the redirected one.. applicationType = RemoveLineTag; applicationTypeRevision = RemoveLineTag; } } } break; } } using (generator.Declare("applicationType", applicationType)) using (generator.Declare("applicationTypeRevision", applicationTypeRevision)) using (generator.Declare("androidHome", Options.GetOptionValue("androidHome", context.ProjectConfigurationOptions.Values))) using (generator.Declare("antHome", Options.GetOptionValue("antHome", context.ProjectConfigurationOptions.Values))) using (generator.Declare("javaHome", Options.GetOptionValue("javaHome", context.ProjectConfigurationOptions.Values))) using (generator.Declare("ndkRoot", Options.GetOptionValue("ndkRoot", context.ProjectConfigurationOptions.Values))) { generator.Write(_projectDescriptionPlatformSpecific); } if (!string.IsNullOrEmpty(msBuildPathOverrides)) { if (context.DevelopmentEnvironmentsRange.MinDevEnv != context.DevelopmentEnvironmentsRange.MaxDevEnv) { throw new Error("Different vs versions not supported in the same vcxproj"); } generator.WriteVerbatim(msBuildPathOverrides); } generator.Write(Vcxproj.Template.Project.ProjectDescriptionEnd); }