/// <summary> /// Gets the relative paths for files that are relevant to this deployment /// </summary> public IEnumerable <string> GetRelevantRelativePaths(bool forServerDeployment) { List <string> result = new List <string>(m_filesNames.Count); foreach (var fileName in m_filesNames) { string extension = Path.GetExtension(fileName); if (!string.IsNullOrEmpty(extension) && (extension.Equals(".dll", StringComparison.OrdinalIgnoreCase) || extension.Equals(".exe", StringComparison.OrdinalIgnoreCase) || // For the server deployment we want to copy .pdb files in order to get symbols when crashes happen. // But it's wasteful to hash them for sake of the engine version. So exclude them in that context. (forServerDeployment ? extension.Equals(".pdb", StringComparison.OrdinalIgnoreCase) : false) || extension.Equals(".config", StringComparison.OrdinalIgnoreCase) || ExtensionUtilities.IsScriptExtension(extension) || extension.Equals(".ts", StringComparison.OrdinalIgnoreCase) || extension.Equals(".json", StringComparison.OrdinalIgnoreCase)) || string.Equals(BuildXLBrandingManifestFileName, fileName, StringComparison.OrdinalIgnoreCase) ) { // E.g. BuildXLEngine.DefaultCacheConfigFileName, EnlistmentLibrary configs result.Add(fileName); } } // Sort the list by path so the hash computed is consistent run to run on the same machine. result.Sort(); // Lets sanitize if we are on Unix based systems and make sure the paths are correct return(OperatingSystemHelper.IsUnixOS ? result.Select(entry => NormalizePath(entry)) : result); }
internal override void VisitProcess(Process process, ProcessType pipCategory) { string friendlyQualifier = Context.QualifierTable.GetCanonicalDisplayString(process.Provenance.QualifierId); // TODO: After fixing the qualifier in the DS, I will start using the qualifier id instead of friendly qualifier name // Context.QualifierTable.GetQualifiedOutputDirectoryPart(Context.StringTable, qualifierId).ToString(Context.StringTable); var arguments = Context.GetArgumentsDataFromProcess(process); Project project; if (!ProjectsByQualifier.TryGetValue(friendlyQualifier, out project)) { project = CreateProject(process); project.SetProperty("PlatformToolset", "v140"); FillProjectConfigurations(project); AddHeaderFiles(project); ProjectsByQualifier.Add(friendlyQualifier, project); } switch (pipCategory) { case ProcessType.Cl: IterateClArguments(project, arguments); break; case ProcessType.Link: IterateLinkArguments(project, arguments); // If this is DS, use WorkingDirectory as an output folder. var outputDir = ExtensionUtilities.IsScriptExtension(SpecFilePath.GetExtension(Context.PathTable).ToString(Context.StringTable)) ? process.WorkingDirectory : process.UniqueOutputDirectory; SetOutputDirectory(project, outputDir, OutputDirectoryType.Build); break; } }
/// <nodoc /> public static bool IsScriptFile([NotNull] this ISourceFile sourceFile) { Contract.Requires(sourceFile != null); return(sourceFile.OverrideIsScriptFile || ExtensionUtilities.IsScriptExtension(Path.GetExtension(sourceFile.FileName)) || sourceFile.FileName.StartsWith("Prelude.")); }