13 implementations of ItemSpec
Microsoft.Build (3)
Microsoft.Build.Engine.UnitTests (4)
Microsoft.Build.Framework (1)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (1)
Microsoft.Build.Tasks.UnitTests (1)
Microsoft.Build.Utilities.Core (1)
MSBuild (1)
MSBuildTaskHost (1)
12 writes to ItemSpec
Microsoft.Build (1)
Microsoft.Build.Engine.OM.UnitTests (1)
Microsoft.Build.Tasks.CodeAnalysis (4)
Microsoft.Build.Tasks.Core (4)
Microsoft.Build.Tasks.UnitTests (2)
1590 references to ItemSpec
Crossgen2Tasks (20)
ILLink.Tasks (18)
installer.tasks (8)
Microsoft.Build (26)
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (9)
317string projectPath = FileUtilities.AttemptToShortenPath(project.ItemSpec);
347Log.LogErrorWithCodeFromResources("MSBuild.ProjectUpgradeNeededToVcxProj", project.ItemSpec);
385Log.LogMessageFromResources(MessageImportance.High, "MSBuild.ProjectFileNotFoundMessage", project.ItemSpec);
390Log.LogErrorWithCodeFromResources("MSBuild.ProjectFileNotFound", project.ItemSpec);
553string projectPath = FileUtilities.AttemptToShortenPath(projects[i].ItemSpec);
555projectNames[i] = projects[i].ItemSpec;
691outputItemFromTarget.ItemSpec = Path.Combine(projectDirectory[i], outputItemFromTarget.ItemSpec);
695log.LogWarningWithCodeFromResources(null, projects[i].ItemSpec, 0, 0, 0, 0, "MSBuild.CannotRebaseOutputItemPath", outputItemFromTarget.ItemSpec, e.Message);
Microsoft.Build.BuildCheck.UnitTests (2)
Microsoft.Build.Engine.OM.UnitTests (3)
Microsoft.Build.Engine.UnitTests (65)
TaskParameter_Tests.cs (22)
198Assert.Equal("foo", foo.ItemSpec);
207Assert.Equal("foo", foo2.ItemSpec);
226Assert.Equal("foo", foo.ItemSpec);
237Assert.Equal("foo", foo2.ItemSpec);
255Assert.Equal("foo", wrappedParameter[0].ItemSpec);
256Assert.Equal("bar", wrappedParameter[1].ItemSpec);
266Assert.Equal("foo", wrappedParameter2[0].ItemSpec);
267Assert.Equal("bar", wrappedParameter2[1].ItemSpec);
283Assert.Equal("foo;bar", foo.ItemSpec);
292Assert.Equal("foo;bar", foo2.ItemSpec);
308Assert.Equal("foo%3bbar", foo.ItemSpec);
317Assert.Equal("foo%3bbar", foo2.ItemSpec);
328Assert.Equal("foo%3bbar", foo4.ItemSpec);
344Assert.Equal("foo;bar", foo.ItemSpec);
354Assert.Equal("foo;bar", foo2.ItemSpec);
375Assert.Equal("foo", foo.ItemSpec);
386Assert.Equal("foo", foo2.ItemSpec);
408Assert.Equal("foo", foo.ItemSpec);
419Assert.Equal("foo", foo2.ItemSpec);
432Assert.Equal("foo", foo4.ItemSpec);
455Assert.Equal("foo", foo.ItemSpec);
468Assert.Equal("foo", foo2.ItemSpec);
Microsoft.Build.Framework (3)
Microsoft.Build.Tasks.CodeAnalysis (35)
MapSourceRoots.cs (7)
99if (!EndsWithDirectorySeparator(sourceRoot.ItemSpec))
101Log.LogErrorFromResources("MapSourceRoots.PathMustEndWithSlashOrBackslash", Names.SourceRoot, sourceRoot.ItemSpec);
104if (rootByItemSpec.TryGetValue(sourceRoot.ItemSpec, out var existingRoot))
111rootByItemSpec.Add(sourceRoot.ItemSpec, sourceRoot);
130string localPath = root.ItemSpec;
190root.SetMetadata(Names.MappedPath, root.ItemSpec);
214Log.LogWarningFromResources("MapSourceRoots.ContainsDuplicate", Names.SourceRoot, left.ItemSpec, metadataName, leftValue, rightValue);
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (18)
MapSourceRootTests.cs (15)
19=> $"'{sourceRoot.ItemSpec}'" +
60Assert.Equal(Utilities.FixFilePath(@"c:\packages\SourcePackage1\"), task.MappedSourceRoots[0].ItemSpec);
63Assert.Equal(Utilities.FixFilePath(@"/packages/SourcePackage2/"), task.MappedSourceRoots[1].ItemSpec);
66Assert.Equal(Utilities.FixFilePath(@"c:\MyProjects\MyProject\"), task.MappedSourceRoots[2].ItemSpec);
70Assert.Equal(Utilities.FixFilePath(@"c:\MyProjects\MyProject\a\b\"), task.MappedSourceRoots[3].ItemSpec);
109Assert.Equal(Utilities.FixFilePath(@"!@#:;$%^&*()_+|{}\"), task.MappedSourceRoots[0].ItemSpec);
112Assert.Equal(Utilities.FixFilePath("****/"), task.MappedSourceRoots[1].ItemSpec);
116Assert.Equal(Utilities.FixFilePath(@"****\|||:;\"), task.MappedSourceRoots[2].ItemSpec);
186Assert.Equal(Utilities.FixFilePath(@"c:\MyProjects\MyProject\"), task.MappedSourceRoots[0].ItemSpec);
189Assert.Equal(Utilities.FixFilePath(@"c:\MyProjects\MyProject\a\a\"), task.MappedSourceRoots[1].ItemSpec);
192Assert.Equal(Utilities.FixFilePath(@"c:\MyProjects\MyProject\a\b\"), task.MappedSourceRoots[2].ItemSpec);
195Assert.Equal(Utilities.FixFilePath(@"c:\MyProjects\MyProject\a\c\"), task.MappedSourceRoots[3].ItemSpec);
224Assert.Equal(Utilities.FixFilePath(@"c:\packages\SourcePackage1\"), task.MappedSourceRoots[0].ItemSpec);
227Assert.Equal(Utilities.FixFilePath(@"C:\packages\SourcePackage1\"), task.MappedSourceRoots[1].ItemSpec);
230Assert.Equal(Utilities.FixFilePath(@"c:\packages\SourcePackage2\"), task.MappedSourceRoots[2].ItemSpec);
Microsoft.Build.Tasks.Core (334)
AssemblyDependency\ReferenceTable.cs (15)
553string itemSpec = referenceAssemblyName.ItemSpec;
686return new InvalidReferenceAssemblyNameException(referenceAssemblyName.ItemSpec);
868string itemSpec = referenceAssemblyFile.ItemSpec;
897throw new InvalidParameterValueException("AssemblyFiles", referenceAssemblyFile.ItemSpec, e.Message);
1488string dependeeItemSpec = dependee.ItemSpec;
1493if (string.Equals(dependeeItemSpec, assemblyReference.PrimarySourceItem.ItemSpec, StringComparison.OrdinalIgnoreCase))
1549if (assemblyReference.IsPrimary && assemblyReference.PrimarySourceItem.ItemSpec.Equals(itemSpec, StringComparison.OrdinalIgnoreCase))
3070_log.LogWarningWithCodeFromResources("ResolveAssemblyReference.PrimaryReferenceOutsideOfFramework", reference.PrimarySourceItem.ItemSpec /* primary item spec*/, reference.ReferenceVersion /*Version of dependent assembly*/, reference.ExclusionListLoggingProperties.HighestVersionInRedist /*Version found in redist*/);
3074_log.LogWarningWithCodeFromResources("ResolveAssemblyReference.DependencyReferenceOutsideOfFramework", referenceItem.ItemSpec /* primary item spec*/, assemblyName.FullName /*Dependent assemblyName*/, reference.ReferenceVersion /*Version of dependent assembly*/, reference.ExclusionListLoggingProperties.HighestVersionInRedist /*Version found in redist*/);
3085_log.LogWarningWithCodeFromResources("ResolveAssemblyReference.PrimaryReferenceOutsideOfFrameworkUsingAttribute", reference.PrimarySourceItem.ItemSpec /* primary item spec*/, reference.FrameworkNameAttribute /*Version of dependent assembly*/, targetedFramework);
3089_log.LogWarningWithCodeFromResources("ResolveAssemblyReference.DependencyReferenceOutsideOfFrameworkUsingAttribute", referenceItem.ItemSpec /* primary item spec*/, assemblyName.FullName /*Dependent assemblyName*/, reference.FrameworkNameAttribute, targetedFramework);
3100_log.LogWarningWithCodeFromResources("ResolveAssemblyReference.PrimaryReferenceInAnotherFramework", reference.PrimarySourceItem.ItemSpec /* primary item spec*/, targetedFramework);
3104_log.LogWarningWithCodeFromResources("ResolveAssemblyReference.DependencyReferenceInAnotherFramework", referenceItem.ItemSpec /* primary item spec*/, assemblyName.FullName /*Dependent assemblyName*/, targetedFramework);
3115_log.LogWarningWithCodeFromResources("ResolveAssemblyReference.FailedToResolveReferenceBecausePrimaryAssemblyInExclusionList", reference.PrimarySourceItem.ItemSpec, targetedFramework);
3119_log.LogWarningWithCodeFromResources("ResolveAssemblyReference.FailBecauseDependentAssemblyInExclusionList", referenceItem.ItemSpec, assemblyName.FullName, targetedFramework);
AssemblyDependency\ResolveAssemblyReference.cs (13)
1369log.AppendLine().Append(Strings.TwelveSpaces).Append(sourceItem.ItemSpec);
1474Log.LogMessage(importance, indent + item.ItemSpec);
1486Log.LogMessage(importance, indent + item.ItemSpec);
1871Log.LogMessage(importance, Strings.RequiredBy, dependee.ItemSpec);
2598if (fileExists(item.ItemSpec) && !Reference.IsFrameworkFile(item.ItemSpec, _targetFrameworkDirectories))
2602assemblyName = getAssemblyName(item.ItemSpec);
2765Log.LogErrorWithCodeFromResources("ResolveAssemblyReference.FrameworkDirectoryOnProfiles", item.ItemSpec);
2834string fileName = subsetItems.ItemSpec;
3056tableMap[installedAssemblyTable.ItemSpec] = new AssemblyTableInfo(installedAssemblyTable.ItemSpec, frameworkDirectory);
3113Log.LogMessageFromResources(MessageImportance.Normal, "ResolveAssemblyReference.IgnoringBecauseNonEmptySubtype", assembly.ItemSpec, subType);
3117Log.LogWarningWithCodeFromResources("ResolveAssemblyReference.FailedToResolveReferenceBecauseHigherTargetFramework", assembly.ItemSpec, assembly.GetMetadata(ItemMetadataNames.targetFramework));
Copy.cs (23)
472string destPath = DestinationFiles[i].ItemSpec;
476if (String.Equals(originalSource, SourceFiles[i].ItemSpec, StringComparison.OrdinalIgnoreCase))
485if (DoCopyIfNecessary(new FileState(SourceFiles[i].ItemSpec), new FileState(DestinationFiles[i].ItemSpec), copyFile))
487filesActuallyCopied[destPath] = SourceFiles[i].ItemSpec;
550string destPath = destItem.ItemSpec;
578string sourcePath = sourceItem.ItemSpec;
581MSBuildEventSource.Log.CopyUpToDateStart(destItem.ItemSpec);
585SourceFiles[partition[partitionIndex - 1]].ItemSpec,
591new FileState(sourceItem.ItemSpec),
592new FileState(destItem.ItemSpec),
605MSBuildEventSource.Log.CopyUpToDateStop(destItem.ItemSpec, true);
728() => Path.Combine(DestinationFolder.ItemSpec, Path.GetFileName(SourceFiles[i].ItemSpec)),
729SourceFiles[i].ItemSpec,
730DestinationFolder.ItemSpec,
754string src = FileUtilities.NormalizePath(sourceFolder.ItemSpec);
763sourceFolder.ItemSpec,
764DestinationFolder.ItemSpec,
772() => Path.Combine(DestinationFolder.ItemSpec, srcName, file),
773sourceFolder.ItemSpec,
774DestinationFolder.ItemSpec,
957if (DestinationFolder != null && FileSystems.Default.FileExists(DestinationFolder.ItemSpec))
CreateItem.cs (8)
108(!excludeItems.ContainsKey(i.ItemSpec)))
156if (FileMatcher.HasWildcards(i.ItemSpec))
158FileMatcher.Default.GetFileSpecInfo(i.ItemSpec, out string directoryPart, out string wildcardPart, out string filenamePart, out bool needsRecursion, out bool isLegalFileSpec);
164EscapingUtilities.UnescapeAll(i.ItemSpec),
174EscapingUtilities.UnescapeAll(i.ItemSpec),
181(files, action, _) = FileMatcher.Default.GetFiles(null /* use current directory */, i.ItemSpec);
188FileMatcher.Result match = FileMatcher.Default.FileMatch(i.ItemSpec, file);
221uniqueItems[item.ItemSpec] = String.Empty;
Delete.cs (11)
118while (!deletedFilesSet.Contains(file.ItemSpec))
122if (FileSystems.Default.FileExists(file.ItemSpec))
126Log.LogWarningFromResources("Delete.DeletingFile", file.ItemSpec);
131Log.LogMessageFromResources(MessageImportance.Normal, "Delete.DeletingFile", file.ItemSpec);
134File.Delete(file.ItemSpec);
138Log.LogMessageFromResources(MessageImportance.Low, "Delete.SkippingNonexistentFile", file.ItemSpec);
145deletedFilesSet.Add(file.ItemSpec);
149string lockedFileMessage = LockCheck.GetLockedFileMessage(file?.ItemSpec ?? string.Empty);
162deletedFilesSet.Add(file.ItemSpec);
182Log.LogWarningWithCodeFromResources("Delete.Error", file.ItemSpec, e.Message, lockedFileMessage);
186Log.LogErrorWithCodeFromResources("Delete.Error", file.ItemSpec, e.Message, lockedFileMessage);
FileIO\WriteLinesToFile.cs (14)
79buffer.AppendLine(line.ItemSpec);
99var directoryPath = Path.GetDirectoryName(FileUtilities.NormalizePath(File.ItemSpec));
111if (FileUtilities.FileExistsNoThrow(File.ItemSpec))
113string existingContents = System.IO.File.ReadAllText(File.ItemSpec);
118Log.LogMessageFromResources(MessageImportance.Low, "WriteLinesToFile.SkippingUnchangedFile", File.ItemSpec);
119MSBuildEventSource.Log.WriteLinesToFileUpToDateStop(File.ItemSpec, true);
124Log.LogErrorWithCodeFromResources("WriteLinesToFile.ErrorReadingFile", File.ItemSpec);
132Log.LogMessageFromResources(MessageImportance.Low, "WriteLinesToFile.ErrorReadingFile", File.ItemSpec);
134MSBuildEventSource.Log.WriteLinesToFileUpToDateStop(File.ItemSpec, false);
137System.IO.File.WriteAllText(File.ItemSpec, contentsAsString, encoding);
143Log.LogMessageFromResources(MessageImportance.Normal, "WriteLinesToFile.UnusedWriteOnlyWhenDifferent", File.ItemSpec);
147System.IO.File.AppendAllText(File.ItemSpec, buffer.ToString(), encoding);
152string lockedFileMessage = LockCheck.GetLockedFileMessage(File.ItemSpec);
153Log.LogErrorWithCodeFromResources("WriteLinesToFile.ErrorOrWarning", File.ItemSpec, e.Message, lockedFileMessage);
GenerateManifestBase.cs (21)
88AssemblyIdentity = AssemblyIdentity.FromAssemblyName(item.ItemSpec),
121assembly = _manifest.AssemblyReferences.Add(item.ItemSpec);
126AssemblyIdentity identity = AssemblyIdentity.FromAssemblyName(item.ItemSpec);
134assembly = new AssemblyReference(item.ItemSpec);
152AssemblyReference assembly = _manifest.AssemblyReferences.Add(item.ItemSpec);
160FileReference file = _manifest.FileReferences.Add(item.ItemSpec);
338targetPath = BaseReference.GetDefaultTargetPath(item.ItemSpec);
373Log.LogWarningWithCodeFromResources("GenerateManifest.InvalidItemValue", "AssemblyType", item.ItemSpec);
377Log.LogWarningWithCodeFromResources("GenerateManifest.InvalidItemValue", "AssemblyType", item.ItemSpec);
404Log.LogWarningWithCodeFromResources("GenerateManifest.InvalidItemValue", "DependencyType", item.ItemSpec);
408Log.LogWarningWithCodeFromResources("GenerateManifest.InvalidItemValue", "DependencyType", item.ItemSpec);
418return OutputManifest.ItemSpec;
436if (String.IsNullOrEmpty(InputManifest?.ItemSpec))
455_manifest = ManifestReader.ReadManifest(manifestType.Name, InputManifest.ItemSpec, true);
459Log.LogErrorWithCodeFromResources("GenerateManifest.ReadInputManifestFailed", InputManifest.ItemSpec, ex.Message);
485if (!String.IsNullOrEmpty(EntryPoint?.ItemSpec))
593string manifestFileName = Path.GetFileName(OutputManifest.ItemSpec);
618ManifestWriter.WriteManifest(_manifest, OutputManifest.ItemSpec, TargetFrameworkVersion);
622string lockedFileMessage = LockCheck.GetLockedFileMessage(OutputManifest.ItemSpec);
623Log.LogErrorWithCodeFromResources("GenerateManifest.WriteOutputManifestFailed", OutputManifest.ItemSpec, ex.Message, lockedFileMessage);
629Util.WriteLog(String.Format(CultureInfo.CurrentCulture, "Total time to generate manifest '{1}': t={0}", Environment.TickCount - _startTime, Path.GetFileName(OutputManifest.ItemSpec)));
GetCompatiblePlatform.cs (2)
64string? buildProjectReferenceAs = PlatformNegotiation.GetNearestPlatform(projectReferenceOverridePlatformNegotiationMetadata, referencedProjectPlatform, projectReferencePlatformsMetadata, projectReferenceLookupTableMetadata, PlatformLookupTable, AssignedProjectsWithPlatform[i].ItemSpec, CurrentProjectPlatform, Log);
67Log.LogMessageFromResources(MessageImportance.Low, "GetCompatiblePlatform.DisplayChosenPlatform", AssignedProjectsWithPlatform[i].ItemSpec, buildProjectReferenceAs);
GetSDKReferenceFiles.cs (21)
260string rootDirectory = resolvedSDKReference.ItemSpec;
266Log.LogErrorWithCodeFromResources("GetSDKReferenceFiles.CannotHaveEmptyTargetConfiguration", resolvedSDKReference.ItemSpec);
272Log.LogErrorWithCodeFromResources("GetSDKReferenceFiles.CannotHaveEmptyTargetArchitecture", resolvedSDKReference.ItemSpec);
309redistPaths = ToolLocationHelper.GetSDKRedistFolders(resolvedSDKReference.ItemSpec, targetedConfiguration, targetedArchitecture);
316Log.LogMessageFromResources(MessageImportance.Low, "GetSDKReferenceFiles.ExpandRedistFrom", path.Replace(resolvedSDKReference.ItemSpec, String.Empty));
337Log.LogMessageFromResources("GetSDKReferenceFiles.AddingRedistFile", redist.RedistFile.Replace(redist.SDKReferenceItem.ItemSpec, String.Empty), redist.TargetPath);
384IList<string> referencePaths = ToolLocationHelper.GetSDKReferenceFolders(resolvedSDKReference.ItemSpec, targetedConfiguration, targetedArchitecture);
390Log.LogMessageFromResources(MessageImportance.Low, "GetSDKReferenceFiles.ExpandReferencesFrom", path.Replace(resolvedSDKReference.ItemSpec, String.Empty));
411Log.LogMessageFromResources("GetSDKReferenceFiles.AddingReference", reference.AssemblyLocation.Replace(reference.SDKReferenceItem.ItemSpec, String.Empty));
470outputItem.SetMetadata("SDKRootPath", reference.SDKReferenceItem.ItemSpec);
546outputItem.SetMetadata("SDKRootPath", file.SDKReferenceItem.ItemSpec);
599Log.LogMessageFromResources("GetSDKReferenceFiles.ConflictReferenceSameSDK", winner.SDKReferenceItem.GetMetadata("OriginalItemSpec"), winner.AssemblyLocation.Replace(winner.SDKReferenceItem.ItemSpec, String.Empty), resolvedReference.AssemblyLocation.Replace(resolvedReference.SDKReferenceItem.ItemSpec, String.Empty));
603string message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("GetSDKReferenceFiles.ConflictReferenceSameSDK", winner.SDKReferenceItem.GetMetadata("OriginalItemSpec"), winner.AssemblyLocation.Replace(winner.SDKReferenceItem.ItemSpec, String.Empty), resolvedReference.AssemblyLocation.Replace(resolvedReference.SDKReferenceItem.ItemSpec, String.Empty));
639Log.LogMessageFromResources("GetSDKReferenceFiles.ConflictRedistSameSDK", redistFile.TargetPath, redistFile.SDKReferenceItem.GetMetadata("OriginalItemSpec"), winner.RedistFile.Replace(redistFile.SDKReferenceItem.ItemSpec, String.Empty), redistFile.RedistFile.Replace(redistFile.SDKReferenceItem.ItemSpec, String.Empty));
643string message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("GetSDKReferenceFiles.ConflictRedistSameSDK", redistFile.TargetPath, redistFile.SDKReferenceItem.GetMetadata("OriginalItemSpec"), winner.RedistFile.Replace(redistFile.SDKReferenceItem.ItemSpec, String.Empty), redistFile.RedistFile.Replace(redistFile.SDKReferenceItem.ItemSpec, String.Empty));
664ErrorUtilities.VerifyThrowArgument(sdkIdentity.Length != 0, "GetSDKReferenceFiles.NoOriginalItemSpec", sdk.ItemSpec);
665string sdkRoot = sdk.ItemSpec;
MSBuild.cs (9)
282string projectPath = FileUtilities.AttemptToShortenPath(project.ItemSpec);
312Log.LogErrorWithCodeFromResources("MSBuild.ProjectUpgradeNeededToVcxProj", project.ItemSpec);
348Log.LogMessageFromResources(MessageImportance.High, "MSBuild.ProjectFileNotFoundMessage", project.ItemSpec);
353Log.LogErrorWithCodeFromResources("MSBuild.ProjectFileNotFound", project.ItemSpec);
509string projectPath = FileUtilities.AttemptToShortenPath(projects[i].ItemSpec);
511projectNames[i] = projects[i].ItemSpec;
639outputItemFromTarget.ItemSpec = Path.Combine(projectDirectory[i], outputItemFromTarget.ItemSpec);
643log.LogWarningWithCodeFromResources(null, projects[i].ItemSpec, 0, 0, 0, 0, "MSBuild.CannotRebaseOutputItemPath", outputItemFromTarget.ItemSpec, e.Message);
ResolveManifestFiles.cs (22)
176_runtimePackAssets = RuntimePackAssets.ToDictionary(p => p.ItemSpec, StringComparer.OrdinalIgnoreCase);
259ITaskItem outputItem = new TaskItem(item.ItemSpec);
282ITaskItem outputItem = new TaskItem(item.ItemSpec);
286targetPath = Path.GetFileName(item.ItemSpec);
323ITaskItem outputItem = new TaskItem(item.ItemSpec);
347string[] pathSegments = PathUtil.GetPathSegments(item.ItemSpec);
349Debug.Assert(!String.IsNullOrEmpty(itemCulture), String.Format(CultureInfo.CurrentCulture, "Satellite item '{0}' is missing expected attribute '{1}'", item.ItemSpec, "Culture"));
364targetPath = Path.GetFileName(item.ItemSpec);
399AssemblyIdentity identity = AssemblyIdentity.FromManagedAssembly(item.ItemSpec);
505var outputAssembliesMap = outputAssemblies.ToDictionary(p => Path.GetFullPath(p.ItemSpec), StringComparer.OrdinalIgnoreCase);
517string key = Path.GetFullPath(item.ItemSpec);
579string fileExtension = Path.GetExtension(entry.item.ItemSpec);
667var outputEntryPoint = new TaskItem(entryPoint.ItemSpec);
730Log.LogWarningWithCodeFromResources("GenerateManifest.InvalidItemValue", "FileType", item.ItemSpec);
745_runtimePackAssets.TryGetValue(item.ItemSpec, out _))
755AssemblyIdentity identity = AssemblyIdentity.FromManagedAssembly(item.ItemSpec);
756if (item.ItemSpec.EndsWith(".dll") && identity == null && !isDotNetCore)
804this.key = item.ItemSpec?.ToLowerInvariant();
855fusionName = Path.Combine(destSubDir, Path.GetFileNameWithoutExtension(item.ItemSpec));
859fusionName = Path.GetFileNameWithoutExtension(item.ItemSpec);
908AssemblyIdentity identity = AssemblyIdentity.FromManagedAssembly(item.ItemSpec);
919AssemblyIdentity identity = AssemblyIdentity.FromManagedAssembly(item.ItemSpec);
ResolveSDKReference.cs (8)
288if (ParseSDKReference(runtimeDependencyOnlyItem.ItemSpec, out string dependencyName, out string dependencyVersion))
300string installLocation = installedsdk.ItemSpec;
560bool splitSuccessful = ParseSDKReference(referenceItem.ItemSpec, out string sdkSimpleName, out string rawSdkVersion);
564LogErrorOrWarning(new Tuple<string, object[]>("ResolveSDKReference.SDKReferenceIncorrectFormat", [referenceItem.ItemSpec]));
599Log.LogMessageFromResources(MessageImportance.Low, "ResolveSDKReference.SearchingForSDK", reference.ReferenceItem.ItemSpec);
616LogErrorOrWarning(new Tuple<string, object[]>("ResolveSDKReference.CouldNotResolveSDK", [reference.ReferenceItem.ItemSpec]));
915ResolvedPath = FileUtilities.EnsureTrailingSlash(sdk.ItemSpec);
1019AddResolutionErrorOrWarning("ResolveSDKReference.ErrorResolvingSDK", ReferenceItem.ItemSpec, ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ResolveSDKReference.ErrorReadingManifest", _sdkManifestPath, _sdkManifest.ReadErrorMessage));
Unzip.cs (6)
90destinationDirectory = Directory.CreateDirectory(DestinationFolder.ItemSpec);
94Log.LogErrorWithCodeFromResources("Unzip.ErrorCouldNotCreateDestinationDirectory", DestinationFolder.ItemSpec, e.Message);
109if (!FileSystems.Default.FileExists(sourceFile.ItemSpec))
111Log.LogErrorWithCodeFromResources("Unzip.ErrorFileDoesNotExist", sourceFile.ItemSpec);
117using (FileStream stream = new FileStream(sourceFile.ItemSpec, FileMode.Open, FileAccess.Read, FileShare.Read, bufferSize: 0x1000, useAsync: false))
143Log.LogErrorWithCodeFromResources("Unzip.ErrorCouldNotOpenFile", sourceFile.ItemSpec, e.Message);
XmlPoke.cs (6)
66using (FileStream fs = new FileStream(XmlInputPath.ItemSpec, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
77Log.LogErrorWithCodeFromResources("XmlPeekPoke.InputFileError", XmlInputPath.ItemSpec, e.Message);
127iter.Current.InnerXml = Value.ItemSpec;
128Log.LogMessageFromResources(MessageImportance.Low, "XmlPoke.Replaced", iter.Current.Name, Value.ItemSpec);
132Log.LogErrorWithCodeFromResources("XmlPoke.PokeError", Value.ItemSpec, e.Message);
142using (Stream stream = File.Create(XmlInputPath.ItemSpec))
Microsoft.Build.Tasks.UnitTests (658)
AssignCulture_Tests.cs (26)
33Assert.Equal("MyResource.fr.resx", t.AssignedFiles[0].ItemSpec);
34Assert.Equal("MyResource.resx", t.CultureNeutralAssignedFiles[0].ItemSpec);
53Assert.Equal("MyResource.fr.resx", t.AssignedFiles[0].ItemSpec);
54Assert.Equal("MyResource.resx", t.CultureNeutralAssignedFiles[0].ItemSpec);
75Assert.Equal("MyResource.fr.resx", t.AssignedFiles[0].ItemSpec);
76Assert.Equal("MyResource.resx", t.CultureNeutralAssignedFiles[0].ItemSpec);
97Assert.Equal("MyResource.fr.resx", t.AssignedFiles[0].ItemSpec);
98Assert.Equal("MyResource.resx", t.CultureNeutralAssignedFiles[0].ItemSpec);
118Assert.Equal("MyResource.resx", t.AssignedFiles[0].ItemSpec);
119Assert.Equal("MyResource.resx", t.CultureNeutralAssignedFiles[0].ItemSpec);
137Assert.Equal("MyResource", t.AssignedFiles[0].ItemSpec);
138Assert.Equal("MyResource", t.CultureNeutralAssignedFiles[0].ItemSpec);
157Assert.Equal("MyResource..resx", t.AssignedFiles[0].ItemSpec);
158Assert.Equal("MyResource..resx", t.CultureNeutralAssignedFiles[0].ItemSpec);
203Assert.Equal($"MyResource.{culture}.resx", t.AssignedFiles[0].ItemSpec);
204Assert.Equal("MyResource.resx", t.CultureNeutralAssignedFiles[0].ItemSpec);
225Assert.Equal($"MyResource.{culture}.resx", t.AssignedFiles[0].ItemSpec);
226Assert.Equal("MyResource.resx", t.CultureNeutralAssignedFiles[0].ItemSpec);
243Assert.Equal($"MyResource.{culture}.resx", t.AssignedFiles[0].ItemSpec);
244Assert.Equal("MyResource.resx", t.CultureNeutralAssignedFiles[0].ItemSpec);
261Assert.Equal($"MyResource.{culture}.resx", t.AssignedFiles[0].ItemSpec);
262Assert.Equal("MyResource.resx", t.CultureNeutralAssignedFiles[0].ItemSpec);
282Assert.Equal("MyResource.fr.resx", t.AssignedFiles[0].ItemSpec);
283Assert.Equal("MyResource.fr.resx", t.CultureNeutralAssignedFiles[0].ItemSpec);
303Assert.Equal("MyResource.fr.resx", t.AssignedFiles[0].ItemSpec);
304Assert.Equal("MyResource.resx", t.CultureNeutralAssignedFiles[0].ItemSpec);
Copy_Tests.cs (26)
1618Assert.Equal(validOutFile, t.CopiedFiles[0].ItemSpec);
1623Assert.Equal(invalidFile, t.DestinationFiles[0].ItemSpec);
1624Assert.Equal(validOutFile, t.DestinationFiles[1].ItemSpec);
1625Assert.Equal(validOutFile, t.CopiedFiles[0].ItemSpec);
1693Assert.Equal(file, t.DestinationFiles[0].ItemSpec);
1712Assert.Equal(file, t.DestinationFiles[0].ItemSpec);
1764Assert.Equal(filename.ToLowerInvariant(), t.DestinationFiles[0].ItemSpec);
1819Assert.Equal(file, t.DestinationFiles[0].ItemSpec);
1820Assert.Equal(dest2, t.DestinationFiles[1].ItemSpec);
1821Assert.Equal(file, t.CopiedFiles[0].ItemSpec);
1901Assert.Equal(destFile, t.DestinationFiles[0].ItemSpec);
1902Assert.Equal(destFile, t.CopiedFiles[0].ItemSpec);
1962Assert.Equal(destFile, t.DestinationFiles[0].ItemSpec);
1963Assert.Equal(destFile, t.CopiedFiles[0].ItemSpec);
1993using (StreamWriter sw = FileUtilities.OpenWrite(item.ItemSpec, false)) // HIGHCHAR: Test writes in UTF8 without preamble.
2051using (StreamWriter sw = FileUtilities.OpenWrite(item.ItemSpec, false)) // HIGHCHAR: Test writes in UTF8 without preamble.
2588Assert.Equal(destFile, t.DestinationFiles[0].ItemSpec);
2589Assert.Equal(destFile, t.CopiedFiles[0].ItemSpec);
2687Assert.Equal(destFile1, t.DestinationFiles[0].ItemSpec);
2688Assert.Equal(destFile2, t.DestinationFiles[1].ItemSpec);
2689Assert.Equal(destFile1, t.CopiedFiles[0].ItemSpec);
2690Assert.Equal(destFile2, t.CopiedFiles[1].ItemSpec);
2780Assert.Equal(destFile, t.DestinationFiles[0].ItemSpec);
2781Assert.Equal(destFile, t.CopiedFiles[0].ItemSpec);
2845Assert.Equal(destFile, t.DestinationFiles[0].ItemSpec);
2846Assert.Equal(destFile, t.CopiedFiles[0].ItemSpec);
CreateCSharpManifestResourceName_Tests.cs (12)
375Assert.Equal(@"CustomToolTest.SR1", resourceNames[0].ItemSpec);
404t.ManifestResourceNames[0].ItemSpec.ShouldBe("MyStuff.Namespace.Class", "Expecting to find the namespace & class name from SR1.cs");
444t.ManifestResourceNames[0].ItemSpec.ShouldBe(ResourceFileName, "Expecting to find the namespace & class name from SR1.cs");
477t.ManifestResourceNames[0].ItemSpec.ShouldBe("MyStuff.Namespace.Class", "Expecting to find the namespace & class name from SR1.cs");
511t.ManifestResourceNames[0].ItemSpec.ShouldBe("SR1", "Expected only the file name.");
542t.ManifestResourceNames[0].ItemSpec.ShouldBe("MyStuff2.Namespace.Class2", "Expected the namespace & class of SR2.");
576t.ManifestResourceNames[0].ItemSpec.ShouldBe("SR1", "Expected only the file name.");
613t.ManifestResourceNames[0].ItemSpec.ShouldBe("MyStuff.Namespace.Class.de", "Expected Namespace.Class.Culture");
808Assert.Equal(@"strings.resx", resourceFiles[0].ItemSpec);
834Assert.Equal(@"pic.bmp", resourceFiles[0].ItemSpec);
860Assert.Equal(@"pic.bmp", resourceFiles[0].ItemSpec);
885Assert.Equal(@"strings.resx", resourceFiles[0].ItemSpec);
GetSDKReference_Tests.cs (94)
437Assert.Equal(winmd, t.References[0].ItemSpec, true);
438Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec), true);
447Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec), true);
456Assert.Equal("A.winmd", Path.GetFileName(t.CopyLocalFiles[0].ItemSpec), true);
465Assert.Equal("E.dll", Path.GetFileName(t.CopyLocalFiles[5].ItemSpec), true);
474Assert.Equal("B.xml", Path.GetFileName(t.CopyLocalFiles[2].ItemSpec));
559Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec), true);
568Assert.Equal("B.winmd", Path.GetFileName(t.References[1].ItemSpec), true);
577Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec), true);
612string sdkRoot = item.ItemSpec;
637Assert.DoesNotContain(references1, i => i.ItemSpec.Equals(ref2.ItemSpec, StringComparison.InvariantCultureIgnoreCase));
642string sdkRoot2 = item.ItemSpec;
677engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[0].ItemSpec.Replace(t.References[0].GetMetadata("SDKRootPath"), String.Empty));
678engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[1].ItemSpec.Replace(t.References[1].GetMetadata("SDKRootPath"), String.Empty));
679engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[2].ItemSpec.Replace(t.References[2].GetMetadata("SDKRootPath"), String.Empty));
680engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[3].ItemSpec.Replace(t.References[3].GetMetadata("SDKRootPath"), String.Empty));
681engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[4].ItemSpec.Replace(t.References[4].GetMetadata("SDKRootPath"), String.Empty));
682engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[5].ItemSpec.Replace(t.References[5].GetMetadata("SDKRootPath"), String.Empty));
683engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[6].ItemSpec.Replace(t.References[6].GetMetadata("SDKRootPath"), String.Empty));
684engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[7].ItemSpec.Replace(t.References[7].GetMetadata("SDKRootPath"), String.Empty));
686Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec));
693Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec));
726engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[0].ItemSpec.Replace(t.References[0].GetMetadata("SDKRootPath"), String.Empty));
727engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[1].ItemSpec.Replace(t.References[1].GetMetadata("SDKRootPath"), String.Empty));
728engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[2].ItemSpec.Replace(t.References[2].GetMetadata("SDKRootPath"), String.Empty));
729engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[3].ItemSpec.Replace(t.References[3].GetMetadata("SDKRootPath"), String.Empty));
730engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[4].ItemSpec.Replace(t.References[4].GetMetadata("SDKRootPath"), String.Empty));
732Assert.Equal("A.dll", Path.GetFileName(t.References[0].ItemSpec), true);
739Assert.Equal("h.dll", Path.GetFileName(t.References[4].ItemSpec), true);
818engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[0].ItemSpec.Replace(t.References[0].GetMetadata("SDKRootPath"), String.Empty));
819engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[1].ItemSpec.Replace(t.References[1].GetMetadata("SDKRootPath"), String.Empty));
820engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[2].ItemSpec.Replace(t.References[2].GetMetadata("SDKRootPath"), String.Empty));
821engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[3].ItemSpec.Replace(t.References[3].GetMetadata("SDKRootPath"), String.Empty));
822engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[4].ItemSpec.Replace(t.References[4].GetMetadata("SDKRootPath"), String.Empty));
823engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[5].ItemSpec.Replace(t.References[5].GetMetadata("SDKRootPath"), String.Empty));
824engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[6].ItemSpec.Replace(t.References[6].GetMetadata("SDKRootPath"), String.Empty));
825engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[7].ItemSpec.Replace(t.References[7].GetMetadata("SDKRootPath"), String.Empty));
827Assert.True(t.References[0].ItemSpec.IndexOf("x64", StringComparison.OrdinalIgnoreCase) > -1);
828Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec));
837Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec));
870engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[0].ItemSpec.Replace(t.References[0].GetMetadata("SDKRootPath"), String.Empty));
871engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[1].ItemSpec.Replace(t.References[1].GetMetadata("SDKRootPath"), String.Empty));
872engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[2].ItemSpec.Replace(t.References[2].GetMetadata("SDKRootPath"), String.Empty));
873engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[3].ItemSpec.Replace(t.References[3].GetMetadata("SDKRootPath"), String.Empty));
874engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[4].ItemSpec.Replace(t.References[4].GetMetadata("SDKRootPath"), String.Empty));
875engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[5].ItemSpec.Replace(t.References[5].GetMetadata("SDKRootPath"), String.Empty));
876engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[6].ItemSpec.Replace(t.References[6].GetMetadata("SDKRootPath"), String.Empty));
877engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[7].ItemSpec.Replace(t.References[7].GetMetadata("SDKRootPath"), String.Empty));
879Assert.True(t.References[0].ItemSpec.IndexOf("x64", StringComparison.OrdinalIgnoreCase) > -1);
880Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec));
889Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec));
921engine.AssertLogDoesntContainMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[0].ItemSpec.Replace(t.References[0].GetMetadata("SDKRootPath"), String.Empty));
922engine.AssertLogDoesntContainMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[1].ItemSpec.Replace(t.References[1].GetMetadata("SDKRootPath"), String.Empty));
923engine.AssertLogDoesntContainMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[2].ItemSpec.Replace(t.References[2].GetMetadata("SDKRootPath"), String.Empty));
924engine.AssertLogDoesntContainMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[3].ItemSpec.Replace(t.References[3].GetMetadata("SDKRootPath"), String.Empty));
925engine.AssertLogDoesntContainMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[4].ItemSpec.Replace(t.References[4].GetMetadata("SDKRootPath"), String.Empty));
926engine.AssertLogDoesntContainMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[5].ItemSpec.Replace(t.References[5].GetMetadata("SDKRootPath"), String.Empty));
927engine.AssertLogDoesntContainMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[6].ItemSpec.Replace(t.References[6].GetMetadata("SDKRootPath"), String.Empty));
928engine.AssertLogDoesntContainMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingReference", t.References[7].ItemSpec.Replace(t.References[7].GetMetadata("SDKRootPath"), String.Empty));
959engine.AssertLogDoesntContainMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[0].ItemSpec.Replace(t.RedistFiles[0].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[0].GetMetadata("TargetPath"));
960engine.AssertLogDoesntContainMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[1].ItemSpec.Replace(t.RedistFiles[1].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[1].GetMetadata("TargetPath"));
961engine.AssertLogDoesntContainMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[2].ItemSpec.Replace(t.RedistFiles[2].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[2].GetMetadata("TargetPath"));
962engine.AssertLogDoesntContainMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[3].ItemSpec.Replace(t.RedistFiles[3].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[3].GetMetadata("TargetPath"));
963engine.AssertLogDoesntContainMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[4].ItemSpec.Replace(t.RedistFiles[4].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[4].GetMetadata("TargetPath"));
965Assert.Equal("A.dll", Path.GetFileName(t.RedistFiles[0].ItemSpec));
971Assert.Equal("B.dll", Path.GetFileName(t.RedistFiles[1].ItemSpec), true);
977Assert.Equal("B.PRI", Path.GetFileName(t.RedistFiles[2].ItemSpec), true);
983Assert.Equal("C.dll", Path.GetFileName(t.RedistFiles[3].ItemSpec), true);
989Assert.Equal("D.dll", Path.GetFileName(t.RedistFiles[4].ItemSpec), true);
1020engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[0].ItemSpec.Replace(t.RedistFiles[0].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[0].GetMetadata("TargetPath"));
1021engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[1].ItemSpec.Replace(t.RedistFiles[1].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[1].GetMetadata("TargetPath"));
1022engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[2].ItemSpec.Replace(t.RedistFiles[2].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[2].GetMetadata("TargetPath"));
1023engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[3].ItemSpec.Replace(t.RedistFiles[3].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[3].GetMetadata("TargetPath"));
1024engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[4].ItemSpec.Replace(t.RedistFiles[4].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[4].GetMetadata("TargetPath"));
1051Assert.True(t.RedistFiles[0].ItemSpec.IndexOf("x64", StringComparison.OrdinalIgnoreCase) > -1);
1052engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[0].ItemSpec.Replace(t.RedistFiles[0].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[0].GetMetadata("TargetPath"));
1053engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[1].ItemSpec.Replace(t.RedistFiles[1].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[1].GetMetadata("TargetPath"));
1054engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[2].ItemSpec.Replace(t.RedistFiles[2].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[2].GetMetadata("TargetPath"));
1055engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[3].ItemSpec.Replace(t.RedistFiles[3].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[3].GetMetadata("TargetPath"));
1056engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[4].ItemSpec.Replace(t.RedistFiles[4].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[4].GetMetadata("TargetPath"));
1083Assert.True(t.RedistFiles[0].ItemSpec.IndexOf("x64", StringComparison.OrdinalIgnoreCase) > -1);
1084engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[0].ItemSpec.Replace(t.RedistFiles[0].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[0].GetMetadata("TargetPath"));
1085engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[1].ItemSpec.Replace(t.RedistFiles[1].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[1].GetMetadata("TargetPath"));
1086engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[2].ItemSpec.Replace(t.RedistFiles[2].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[2].GetMetadata("TargetPath"));
1087engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[3].ItemSpec.Replace(t.RedistFiles[3].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[3].GetMetadata("TargetPath"));
1088engine.AssertLogContainsMessageFromResource(_resourceDelegate, "GetSDKReferenceFiles.AddingRedistFile", t.RedistFiles[4].ItemSpec.Replace(t.RedistFiles[4].GetMetadata("SDKRootPath"), String.Empty), t.RedistFiles[4].GetMetadata("TargetPath"));
1371Assert.Equal("A.dll", Path.GetFileName(t.RedistFiles[0].ItemSpec), true);
1377Assert.Equal("B.dll", Path.GetFileName(t.RedistFiles[1].ItemSpec), true);
1383Assert.Equal("B.dll", Path.GetFileName(t.RedistFiles[2].ItemSpec), true);
1389Assert.Equal("B.pri", Path.GetFileName(t.RedistFiles[3].ItemSpec), true);
1395Assert.Equal("B.PRI", Path.GetFileName(t.RedistFiles[4].ItemSpec), true);
1401Assert.Equal("C.dll", Path.GetFileName(t.RedistFiles[5].ItemSpec), true);
1407Assert.Equal("D.dll", Path.GetFileName(t.RedistFiles[6].ItemSpec), true);
Move_Tests.cs (13)
52Assert.Equal(destinationFile, t.DestinationFiles[0].ItemSpec);
98Assert.Equal(destinationFile, t.DestinationFiles[0].ItemSpec);
146Assert.Equal(destinationFile, t.DestinationFiles[0].ItemSpec);
460Assert.Equal(validOutFile, t.MovedFiles[0].ItemSpec);
465Assert.Equal(invalidFile, t.DestinationFiles[0].ItemSpec);
466Assert.Equal(validOutFile, t.DestinationFiles[1].ItemSpec);
467Assert.Equal(validOutFile, t.MovedFiles[0].ItemSpec);
619Assert.Equal(filename.ToLowerInvariant(), t.DestinationFiles[0].ItemSpec);
663Assert.Equal(file, t.DestinationFiles[0].ItemSpec);
664Assert.Equal(dest2, t.DestinationFiles[1].ItemSpec);
666Assert.Equal(file, t.MovedFiles[0].ItemSpec);
716Assert.Equal(destFile, t.DestinationFiles[0].ItemSpec);
717Assert.Equal(destFile, t.MovedFiles[0].ItemSpec);
ReadLinesFromFile_Tests.cs (12)
47Assert.Equal("Line1", r.Lines[0].ItemSpec);
56Assert.Equal("Line1", r.Lines[0].ItemSpec);
57Assert.Equal("Line2", r.Lines[1].ItemSpec);
58Assert.Equal("Line3", r.Lines[2].ItemSpec);
94Assert.Equal("Line1_%3b_", r.Lines[0].ItemSpec);
103Assert.Equal("Line1_%3b_", r.Lines[0].ItemSpec);
104Assert.Equal("Line2", r.Lines[1].ItemSpec);
105Assert.Equal("Line3", r.Lines[2].ItemSpec);
139Assert.Equal("My special character is \u00C3", r.Lines[0].ItemSpec);
199Assert.Equal("Line1", r.Lines[0].ItemSpec);
200Assert.Equal("Line2", r.Lines[1].ItemSpec);
201Assert.Equal("Line3", r.Lines[2].ItemSpec);
RemoveDuplicates_Tests.cs (11)
28Assert.Equal("MyFile.txt", t.Filtered[0].ItemSpec);
46Assert.Equal("MyFile.txt", t.Filtered[0].ItemSpec);
71Assert.Equal("MyFile2.txt", t.Filtered[0].ItemSpec);
72Assert.Equal("MyFile1.txt", t.Filtered[1].ItemSpec);
73Assert.Equal("MyFile3.txt", t.Filtered[2].ItemSpec);
97Assert.Equal("MyFile2.txt", t.Filtered[0].ItemSpec);
98Assert.Equal("MyFile1.txt", t.Filtered[1].ItemSpec);
99Assert.Equal("MyFile3.txt", t.Filtered[2].ItemSpec);
116Assert.Equal("MyFile1.txt", t.Filtered[0].ItemSpec);
117Assert.Equal("MyFile2.txt", t.Filtered[1].ItemSpec);
135Assert.Equal("MyFile.txt", t.Filtered[0].ItemSpec);
ResolveSDKReference_Tests.cs (64)
451Assert.Equal(_sdkPath, t.ResolvedSDKReferences[0].ItemSpec);
513Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
567string errorMessage = t.Log.FormatResourceString("ResolveSDKReference.SDKReferenceIncorrectFormat", referenceInclude.ItemSpec);
672string errorMessage = t.Log.FormatResourceString("ResolveSDKReference.Prefer32BitNotSupportedWithNeutralProject", item.ItemSpec);
895string errorMessage = t.Log.FormatResourceString("ResolveSDKReference.Prefer32BitNotSupportedWithNeutralProject", item.ItemSpec);
1096Assert.Equal(_sdkPath, t.ResolvedSDKReferences[0].ItemSpec);
1105Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
1134Assert.Equal(_sdkPath, t.ResolvedSDKReferences[0].ItemSpec);
1143Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
1175Assert.Equal(_sdkPath, t.ResolvedSDKReferences[0].ItemSpec);
1184Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
1213Assert.Equal(_sdkPath, t.ResolvedSDKReferences[0].ItemSpec);
1220Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
1252Assert.Equal(_sdkPath, t.ResolvedSDKReferences[0].ItemSpec);
1261Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
1286Assert.Equal(_sdkPath, t.ResolvedSDKReferences[0].ItemSpec);
1293Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
1357Assert.Equal(_sdkPath, t.ResolvedSDKReferences[0].ItemSpec);
1366Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
1424Assert.Equal(_sdkPath, t.ResolvedSDKReferences[0].ItemSpec);
1532Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
1533Assert.Equal(goodSDKLocation, t.ResolvedSDKReferences[1].ItemSpec);
1759Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
1776Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
1858Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
1870Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
1937Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
1946Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
2008Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
2016Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
2072Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
2082Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
2148Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
2157Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
2216Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
2225Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
2286Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
2295Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
2500Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
2509Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
2574Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
2641Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
2705Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
2773Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
2870Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
2871Assert.Equal(testDirectory2, t.ResolvedSDKReferences[1].ItemSpec);
2872Assert.Equal(testDirectory3, t.ResolvedSDKReferences[2].ItemSpec);
2968Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
2969Assert.Equal(testDirectory2, t.ResolvedSDKReferences[1].ItemSpec);
2970Assert.Equal(testDirectory3, t.ResolvedSDKReferences[2].ItemSpec);
3080Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
3081Assert.Equal(testDirectory2, t.ResolvedSDKReferences[1].ItemSpec);
3082Assert.Equal(testDirectory3, t.ResolvedSDKReferences[2].ItemSpec);
3083Assert.Equal(testDirectory4, t.ResolvedSDKReferences[3].ItemSpec);
3179Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
3180Assert.Equal(testDirectory2, t.ResolvedSDKReferences[1].ItemSpec);
3181Assert.Equal(testDirectory3, t.ResolvedSDKReferences[2].ItemSpec);
3255Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
3330Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
3339Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
3474Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
3483Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
3610Assert.Equal(testDirectory, t.ResolvedSDKReferences[0].ItemSpec);
3619Assert.Equal(item.ItemSpec, t.ResolvedSDKReferences[0].GetMetadata("OriginalItemSpec"), true);
ResourceHandling\GenerateResource_Tests.cs (290)
74string resourcesFile = t.OutputResources[0].ItemSpec;
76resourcesFile = t.FilesWritten[0].ItemSpec;
92File.Delete(t.Sources[0].ItemSpec);
95if (File.Exists(item.ItemSpec))
97File.Delete(item.ItemSpec);
140File.Delete(item.ItemSpec);
162string resourcesFile = t.OutputResources[0].ItemSpec;
164resourcesFile = t.FilesWritten[0].ItemSpec;
175File.Delete(t.Sources[0].ItemSpec);
178if (File.Exists(item.ItemSpec))
180File.Delete(item.ItemSpec);
211resourcesFile = t.OutputResources[0].ItemSpec;
213Assert.Equal(t.FilesWritten[0].ItemSpec, resourcesFile);
250Assert.Equal(".resx", Path.GetExtension(t.FilesWritten[0].ItemSpec));
257Assert.Equal(".txt", Path.GetExtension(t2a.FilesWritten[0].ItemSpec));
261t2b.Sources = new ITaskItem[] { new TaskItem(t2a.FilesWritten[0].ItemSpec) };
264Assert.Equal(".resx", Path.GetExtension(t2b.FilesWritten[0].ItemSpec));
267Assert.Equal(Utilities.ReadFileContent(t.OutputResources[0].ItemSpec),
268Utilities.ReadFileContent(t2b.OutputResources[0].ItemSpec));
269Utilities.AssertLogContainsResource(t2b, "GenerateResource.ProcessingFile", t2b.Sources[0].ItemSpec, t2b.OutputResources[0].ItemSpec);
270Utilities.AssertLogContainsResource(t2b, "GenerateResource.ReadResourceMessage", 4, t2b.Sources[0].ItemSpec);
274File.Delete(t.OutputResources[0].ItemSpec);
275File.Delete(t2a.OutputResources[0].ItemSpec);
278File.Delete(item.ItemSpec);
302resourcesFile = t.FilesWritten[0].ItemSpec;
305Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", t.Sources[0].ItemSpec, outputFile);
306Utilities.AssertLogContainsResource(t, "GenerateResource.ReadResourceMessage", 4, t.Sources[0].ItemSpec);
309File.Delete(t.Sources[0].ItemSpec);
312File.Delete(item.ItemSpec);
334var resourceOutput = t.OutputResources[0].ItemSpec;
336Path.GetExtension(t.FilesWritten[0].ItemSpec).ShouldBe(".resources");
349Utilities.AssertLogContainsResource(t, "GenerateResource.OutputDoesntExist", t.OutputResources[0].ItemSpec);
362File.GetLastAccessTime(t2.OutputResources[0].ItemSpec).ShouldBe(DateTime.Now, TimeSpan.FromSeconds(5));
364Utilities.AssertLogContainsResource(t2, "GenerateResource.InputNewer", t2.Sources[0].ItemSpec, t2.OutputResources[0].ItemSpec);
379Utilities.AssertLogContainsResource(t, "GenerateResource.OutputDoesntExist", t.OutputResources[0].ItemSpec);
390Utilities.AssertLogContainsResource(t2, "GenerateResource.ResourceNotFound", t2.Sources[0].ItemSpec);
412Path.GetExtension(t.OutputResources[0].ItemSpec).ShouldBe(".resources");
413Path.GetExtension(t.FilesWritten[0].ItemSpec).ShouldBe(".resources");
421DateTime firstWriteTime = File.GetLastWriteTime(t.OutputResources[0].ItemSpec);
427File.GetLastWriteTime(t2.OutputResources[0].ItemSpec).ShouldBeGreaterThan(firstWriteTime);
434t2.OutputResources[0].ItemSpec);
439File.Delete(t.Sources[0].ItemSpec);
443if (File.Exists(item.ItemSpec))
445File.Delete(item.ItemSpec);
465Utilities.AssertLogContainsResource(t1, "GenerateResource.OutputDoesntExist", t1.OutputResources[0].ItemSpec);
483File.Delete(output[0].ItemSpec);
487Utilities.AssertLogContainsResource(t3, "GenerateResource.ProcessingFile", sources[0].ItemSpec, output[0].ItemSpec);
494Utilities.AssertLogContainsResource(t4, "GenerateResource.OutputDoesntExist", t4.OutputResources[0].ItemSpec);
568File.Delete(t.Sources[0].ItemSpec);
573File.Delete(item.ItemSpec);
606File.Delete(t.Sources[0].ItemSpec);
610File.Delete(item.ItemSpec);
633Path.GetExtension(t.OutputResources[0].ItemSpec).ShouldBe(".resources");
634Path.GetExtension(t.FilesWritten[0].ItemSpec).ShouldBe(".resources");
657File.Delete(t.Sources[0].ItemSpec);
661if (File.Exists(item.ItemSpec))
663File.Delete(item.ItemSpec);
689DateTime firstOutputCreationTime = File.GetLastWriteTime(createResources.OutputResources[0].ItemSpec);
690DateTime secondOutputCreationTime = File.GetLastWriteTime(createResources.OutputResources[1].ItemSpec);
694t2.StateFile = new TaskItem(createResources.StateFile.ItemSpec);
714File.GetLastWriteTime(t2.OutputResources[0].ItemSpec).ShouldBeGreaterThan(firstOutputCreationTime);
715File.GetLastWriteTime(t2.OutputResources[1].ItemSpec).ShouldBe(secondOutputCreationTime);
718t2.OutputResources[0].ItemSpec.ShouldBe(createResources.OutputResources[0].ItemSpec);
719t2.OutputResources[1].ItemSpec.ShouldBe(createResources.OutputResources[1].ItemSpec);
720t2.FilesWritten[0].ItemSpec.ShouldBe(createResources.FilesWritten[0].ItemSpec);
721t2.FilesWritten[1].ItemSpec.ShouldBe(createResources.FilesWritten[1].ItemSpec);
723Utilities.AssertLogContainsResource(t2, "GenerateResource.InputNewer", firstResx, t2.OutputResources[0].ItemSpec);
747string resourcesFile = t.OutputResources[0].ItemSpec;
749resourcesFile = t.FilesWritten[0].ItemSpec;
754DateTime time = File.GetLastWriteTime(t.OutputResources[0].ItemSpec);
764Assert.True(time.Equals(File.GetLastWriteTime(t2.OutputResources[0].ItemSpec)));
769File.Delete(t.Sources[0].ItemSpec);
773if (File.Exists(item.ItemSpec))
775File.Delete(item.ItemSpec);
805Assert.Equal(t.OutputResources[0].ItemSpec, resourcesFile1);
806Assert.Equal(t.FilesWritten[0].ItemSpec, resourcesFile1);
807Assert.Equal(t.OutputResources[1].ItemSpec, resourcesFile2);
808Assert.Equal(t.FilesWritten[1].ItemSpec, resourcesFile2);
817DateTime time = File.GetLastWriteTime(t.OutputResources[0].ItemSpec);
818DateTime time2 = File.GetLastWriteTime(t.OutputResources[1].ItemSpec);
824Assert.Equal(t2.OutputResources[0].ItemSpec, resourcesFile1);
825Assert.Equal(t2.FilesWritten[0].ItemSpec, resourcesFile1);
826Assert.Equal(t2.OutputResources[1].ItemSpec, resourcesFile2);
827Assert.Equal(t2.FilesWritten[1].ItemSpec, resourcesFile2);
831Assert.True(time.Equals(File.GetLastWriteTime(t2.OutputResources[0].ItemSpec)));
832Assert.True(time2.Equals(File.GetLastWriteTime(t2.OutputResources[1].ItemSpec)));
887DateTime firstWriteTime = File.GetLastWriteTime(initialCreator.OutputResources[0].ItemSpec);
897File.GetLastWriteTime(incrementalUpToDate.OutputResources[0].ItemSpec).ShouldBe(firstWriteTime);
917File.GetLastWriteTime(incrementalOutOfDate.OutputResources[0].ItemSpec).ShouldBeGreaterThan(firstWriteTime);
919resourcesFile = incrementalOutOfDate.OutputResources[0].ItemSpec;
921Utilities.AssertLogContainsResource(incrementalOutOfDate, "GenerateResource.InputNewer", localSystemDll, incrementalOutOfDate.OutputResources[0].ItemSpec);
964if (!File.Exists(file.ItemSpec))
966File.WriteAllText(file.ItemSpec, "");
986File.SetLastWriteTime(additionalInputs[1].ItemSpec, newTime);
993Utilities.AssertLogContainsResource(t3, "GenerateResource.InputNewer", additionalInputs[1].ItemSpec, t3.OutputResources[0].ItemSpec);
994resourcesFile = t3.OutputResources[0].ItemSpec;
1008if (additionalInputs?[0] != null && File.Exists(additionalInputs[0].ItemSpec))
1010File.Delete(additionalInputs[0].ItemSpec);
1013if (additionalInputs?[1] != null && File.Exists(additionalInputs[1].ItemSpec))
1015File.Delete(additionalInputs[1].ItemSpec);
1040string resourcesFile = t.OutputResources[0].ItemSpec;
1047File.Delete(t.Sources[0].ItemSpec);
1050File.Delete(item.ItemSpec);
1071Assert.Equal(".resx", Path.GetExtension(t.FilesWritten[0].ItemSpec));
1075t2a.Sources = new ITaskItem[] { new TaskItem(t.FilesWritten[0].ItemSpec) };
1076t2a.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(t.FilesWritten[0].ItemSpec, ".resources")) };
1078Assert.Equal(".resources", Path.GetExtension(t2a.FilesWritten[0].ItemSpec));
1082t2b.Sources = new ITaskItem[] { new TaskItem(t2a.FilesWritten[0].ItemSpec) };
1084File.Delete(t2b.OutputResources[0].ItemSpec);
1086Assert.Equal(".resx", Path.GetExtension(t2b.FilesWritten[0].ItemSpec));
1089Assert.Equal(Utilities.ReadFileContent(t.OutputResources[0].ItemSpec),
1090Utilities.ReadFileContent(t2b.OutputResources[0].ItemSpec));
1094File.Delete(t.OutputResources[0].ItemSpec);
1095File.Delete(t2a.OutputResources[0].ItemSpec);
1098File.Delete(item.ItemSpec);
1121string resourcesFile = t.OutputResources[0].ItemSpec;
1132resourcesFile = t2.FilesWritten[0].ItemSpec;
1138File.Delete(t.Sources[0].ItemSpec);
1141File.Delete(item.ItemSpec);
1144File.Delete(t2.Sources[0].ItemSpec);
1147File.Delete(item.ItemSpec);
1167string resourcesFile = t.OutputResources[0].ItemSpec;
1169string stronglyTypedClassName = Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec);
1172resourcesFile = t.FilesWritten[0].ItemSpec;
1176string stronglyTypedFileName = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs");
1177Assert.Equal(t.FilesWritten[2].ItemSpec, stronglyTypedFileName);
1200File.Delete(t.Sources[0].ItemSpec);
1204if (File.Exists(item.ItemSpec))
1206File.Delete(item.ItemSpec);
1230string resourcesFile = t.OutputResources[0].ItemSpec;
1232string stronglyTypedClassName = Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec);
1235resourcesFile = t.FilesWritten[0].ItemSpec;
1240string stronglyTypedFileName = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs");
1241Assert.Equal(t.FilesWritten[2].ItemSpec, stronglyTypedFileName);
1269Assert.Equal(t2.OutputResources[0].ItemSpec, resourcesFile);
1270Assert.Equal(t2.FilesWritten[0].ItemSpec, resourcesFile);
1273Assert.Equal(t2.FilesWritten[2].ItemSpec, Path.ChangeExtension(t2.Sources[0].ItemSpec, ".cs"));
1278File.Delete(t.Sources[0].ItemSpec);
1282if (File.Exists(item.ItemSpec))
1284File.Delete(item.ItemSpec);
1289if (File.Exists(item.ItemSpec))
1291File.Delete(item.ItemSpec);
1325resourcesFile = t.OutputResources[0].ItemSpec;
1328Assert.Equal(t.FilesWritten[2].ItemSpec, strFile);
1356Assert.Equal(t.OutputResources[0].ItemSpec, resourcesFile);
1358Assert.Equal(t.FilesWritten[2].ItemSpec, strFile);
1416resourcesFile = t.OutputResources[0].ItemSpec;
1419Assert.Equal(".resources", Path.GetExtension(t.FilesWritten[0].ItemSpec));
1423Assert.Equal(t.FilesWritten[1].ItemSpec, strFile);
1428Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", txtFile, t.OutputResources[0].ItemSpec);
1476string stronglyTypedFileName = Path.ChangeExtension(t.Sources[0].ItemSpec, ".vb");
1477Assert.Equal(t.FilesWritten[2].ItemSpec, stronglyTypedFileName);
1479string resourcesFile = t.OutputResources[0].ItemSpec;
1481resourcesFile = t.FilesWritten[0].ItemSpec;
1507File.Delete(t.Sources[0].ItemSpec);
1511if (File.Exists(item.ItemSpec))
1513File.Delete(item.ItemSpec);
1535string resourcesFile = t.OutputResources[0].ItemSpec;
1537resourcesFile = t.FilesWritten[0].ItemSpec;
1543string STRfile = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs");
1548Assert.Equal(t.StronglyTypedClassName, Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec));
1560File.Delete(t.Sources[0].ItemSpec);
1564if (File.Exists(item.ItemSpec))
1566File.Delete(item.ItemSpec);
1593string resourcesFile = t.OutputResources[0].ItemSpec;
1595resourcesFile = t.FilesWritten[0].ItemSpec;
1601string STRfile = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs");
1606Assert.Equal(t.StronglyTypedClassName, Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec));
1630FileUtilities.DeleteNoThrow(item.ItemSpec);
1718File.Delete(t.Sources[0].ItemSpec);
1721File.Delete(item.ItemSpec);
1737File.Delete(t.Sources[0].ItemSpec);
1740File.Delete(item.ItemSpec);
1789Assert.Equal(t.OutputResources[0].ItemSpec, resourcesFile2);
1791Assert.Equal(t.FilesWritten[0].ItemSpec, resourcesFile2);
1868Assert.Equal(t.OutputResources[0].ItemSpec, resourcesFile2);
1870Assert.Equal(t.FilesWritten[0].ItemSpec, resourcesFile2);
1922File.Delete(t.Sources[0].ItemSpec);
1925File.Delete(item.ItemSpec);
1949File.Delete(t.Sources[0].ItemSpec);
1953File.Delete(item.ItemSpec);
1976resourcesFile = t.OutputResources[0].ItemSpec;
1978Assert.Equal(t.FilesWritten[0].ItemSpec, t.OutputResources[0].ItemSpec);
2064File.Delete(t.Sources[0].ItemSpec);
2067File.Delete(item.ItemSpec);
2120File.Delete(t.Sources[0].ItemSpec);
2124File.Delete(item.ItemSpec);
2204Assert.Equal("MyAlternateResource.resources", t.OutputResources[0].ItemSpec);
2210File.Delete(t.Sources[0].ItemSpec);
2213File.Delete(item.ItemSpec);
2234Assert.Equal(resourcesFile, t.OutputResources[0].ItemSpec);
2240File.Delete(t.Sources[0].ItemSpec);
2243File.Delete(item.ItemSpec);
2267string outputFile = Path.ChangeExtension(t.Sources[i].ItemSpec, ".resources");
2268Assert.Equal(outputFile, t.OutputResources[i].ItemSpec);
2274File.Delete(item.ItemSpec);
2279File.Delete(item.ItemSpec);
2307Assert.Equal(t.FilesWritten[i].ItemSpec, t.OutputResources[i].ItemSpec);
2308Assert.True(File.Exists(t.FilesWritten[i].ItemSpec));
2314File.Delete(t.StateFile.ItemSpec);
2317File.Delete(item.ItemSpec);
2321File.Delete(item.ItemSpec);
2344File.Delete(Path.ChangeExtension(taskItem.ItemSpec, ".resources"));
2353string outputFile = Path.ChangeExtension(t.Sources[0].ItemSpec, ".resources");
2354Assert.Equal(outputFile, t.OutputResources[0].ItemSpec);
2355Assert.True(File.Exists(t.OutputResources[0].ItemSpec));
2356outputFile = Path.ChangeExtension(t.Sources[1].ItemSpec, ".resources");
2357Assert.Equal(outputFile, t.OutputResources[1].ItemSpec);
2358Assert.True(File.Exists(t.OutputResources[1].ItemSpec));
2360outputFile = Path.ChangeExtension(t.Sources[2].ItemSpec, ".resources");
2363outputFile = Path.ChangeExtension(t.Sources[3].ItemSpec, ".resources");
2364Assert.Equal(outputFile, t.OutputResources[2].ItemSpec);
2365Assert.True(File.Exists(t.OutputResources[2].ItemSpec));
2368Assert.Equal(t.FilesWritten[0].ItemSpec, Path.ChangeExtension(t.Sources[0].ItemSpec, ".resources"));
2369Assert.Equal(t.FilesWritten[1].ItemSpec, Path.ChangeExtension(t.Sources[1].ItemSpec, ".resources"));
2381Assert.Equal(t.FilesWritten[2].ItemSpec, Path.ChangeExtension(t.Sources[3].ItemSpec, ".resources"));
2395File.Delete(item.ItemSpec);
2399if (File.Exists(item.ItemSpec))
2401File.Delete(item.ItemSpec);
2429Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", textFile, t.OutputResources[0].ItemSpec);
2441File.Delete(t.Sources[0].ItemSpec);
2445if (File.Exists(item.ItemSpec))
2447File.Delete(item.ItemSpec);
2466File.Delete(Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs"));
2471Utilities.AssertLogContainsResource(t, "GenerateResource.ProcessingFile", textFile, t.OutputResources[0].ItemSpec);
2475Assert.Equal(t.StronglyTypedFileName, Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs"));
2486File.Delete(t.Sources[0].ItemSpec);
2491if (File.Exists(item.ItemSpec))
2493File.Delete(item.ItemSpec);
2527if (item.ItemSpec != null)
2529File.Delete(item.ItemSpec);
2589Assert.Equal(t.OutputResources[0].ItemSpec, resourcesFile);
2618File.SetAttributes(t.StateFile.ItemSpec, FileAttributes.ReadOnly);
2629File.Delete(t.Sources[0].ItemSpec);
2630File.SetAttributes(t.StateFile.ItemSpec, FileAttributes.Normal);
2635if (item.ItemSpec != null)
2637File.Delete(item.ItemSpec);
2664File.Delete(t.Sources[0].ItemSpec);
2669if (item.ItemSpec != null)
2671File.Delete(item.ItemSpec);
2696File.Delete(t.Sources[0].ItemSpec);
2701if (item.ItemSpec != null)
2703File.Delete(item.ItemSpec);
2728File.Delete(t.Sources[0].ItemSpec);
2733if (item.ItemSpec != null)
2735File.Delete(item.ItemSpec);
2760File.Delete(t.Sources[0].ItemSpec);
2765if (item.ItemSpec != null)
2767File.Delete(item.ItemSpec);
3631string resourcesFile = t.OutputResources[0].ItemSpec;
3633resourcesFile = t.FilesWritten[0].ItemSpec;
3653File.Delete(t.Sources[0].ItemSpec);
3656if (File.Exists(item.ItemSpec))
3658File.Delete(item.ItemSpec);
3688string outputResourceFile = task.OutputResources[0].ItemSpec;
3689task.OutputResources[0].ItemSpec.ShouldBe(task.FilesWritten[0].ItemSpec);
3696string resourcesFile = t.OutputResources[0].ItemSpec;
3705resourcesFile = t.OutputResources[0].ItemSpec;
3828Assert.True(File.Exists(t.StateFile.ItemSpec)); // "State file should exist"
3835if (t.StateFile.ItemSpec.Equals(t.FilesWritten[i].ItemSpec))
3867return t.OutputResources[0].ItemSpec;
3887File.GetLastWriteTime(t.OutputResources[0].ItemSpec).ShouldBeGreaterThanOrEqualTo(File.GetLastWriteTime(t.Sources[0].ItemSpec), $"we're talking here about {t.OutputResources[0].ItemSpec} and {t.Sources[0].ItemSpec}");
4237string resourcesFile = t.OutputResources[0].ItemSpec;
4240Assert.Equal(Path.GetFileNameWithoutExtension(textFile), Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec));
4243string stronglyTypedClassName = Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec);
4250resourcesFile = t.FilesWritten[0].ItemSpec;
4256Assert.Equal(Path.ChangeExtension(t.Sources[0].ItemSpec, codeFileExtension), t.StronglyTypedFileName);
4257Assert.Equal(t.FilesWritten[2].ItemSpec, t.StronglyTypedFileName);
4297File.Delete(t.Sources[0].ItemSpec);
4301if (File.Exists(item.ItemSpec))
4303File.Delete(item.ItemSpec);
WriteCodeFragment_Tests.cs (36)
91Assert.Equal(file, task.OutputFile.ItemSpec);
94File.Delete(task.OutputFile.ItemSpec);
116Assert.Equal(expectedFile, task.OutputFile.ItemSpec);
136Assert.Equal(file.ItemSpec, task.OutputFile.ItemSpec);
137Assert.True(File.Exists(task.OutputFile.ItemSpec));
160Assert.Equal(fileName, task.OutputFile.ItemSpec);
185Assert.Equal(file, task.OutputFile.ItemSpec);
331string content = File.ReadAllText(task.OutputFile.ItemSpec);
357string content = File.ReadAllText(task.OutputFile.ItemSpec);
382Assert.True(File.Exists(task.OutputFile.ItemSpec));
383Assert.Equal(Path.GetTempPath(), task.OutputFile.ItemSpec.Substring(0, Path.GetTempPath().Length));
384Assert.Equal(".cs", task.OutputFile.ItemSpec.Substring(task.OutputFile.ItemSpec.Length - 3));
386File.Delete(task.OutputFile.ItemSpec);
405Assert.True(File.Exists(task.OutputFile.ItemSpec));
406Assert.Equal(folder.ItemSpec, task.OutputFile.ItemSpec.Substring(0, folder.ItemSpec.Length));
407Assert.Equal(".cs", task.OutputFile.ItemSpec.Substring(task.OutputFile.ItemSpec.Length - 3));
464File.Delete(task.OutputFile.ItemSpec);
510string content = File.ReadAllText(task.OutputFile.ItemSpec);
515File.Delete(task.OutputFile.ItemSpec);
534string content = File.ReadAllText(task.OutputFile.ItemSpec);
539File.Delete(task.OutputFile.ItemSpec);
566string content = File.ReadAllText(task.OutputFile.ItemSpec);
572File.Delete(task.OutputFile.ItemSpec);
602string content = File.ReadAllText(task.OutputFile.ItemSpec);
611File.Delete(task.OutputFile.ItemSpec);
705string content = File.ReadAllText(task.OutputFile.ItemSpec);
713File.Delete(task.OutputFile.ItemSpec);
738string content = File.ReadAllText(task.OutputFile.ItemSpec);
743File.Delete(task.OutputFile.ItemSpec);
1105string content = File.ReadAllText(task.OutputFile.ItemSpec);
1119if ((task.OutputFile is not null) && File.Exists(task.OutputFile.ItemSpec))
1121File.Delete(task.OutputFile.ItemSpec);
1143if ((task.OutputFile is not null) && File.Exists(task.OutputFile.ItemSpec))
1145File.Delete(task.OutputFile.ItemSpec);
Microsoft.Build.UnitTests.Shared (7)
Microsoft.Build.Utilities.Core (14)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (8)
Microsoft.DotNet.Arcade.Sdk (11)
Microsoft.DotNet.Arcade.Sdk.Tests (1)
Microsoft.DotNet.Build.Tasks.Feed (34)
Microsoft.DotNet.Build.Tasks.Installers (28)
Microsoft.DotNet.Build.Tasks.Packaging (81)
GenerateRuntimeDependencies.cs (9)
85Log.LogMessage(LogImportance.Low, "Aliasing {0} -> {1}", alias, dependency.ItemSpec);
86packageAliases[alias] = dependency.ItemSpec;
98Log.LogMessage(LogImportance.Low, "Skipping dependencies {0} since they don't have a TargetRuntime.", String.Join(", ", runtimeGroup.Select(d => d.ItemSpec)));
102if (runtimeGroup.Any(d => d.ItemSpec == c_emptyDependency))
115var dependencyGroups = targetPackageGroup.GroupBy(d => d.ItemSpec);
156Log.LogWarning("Dependency {0} specified TargetPackageAlias {1} but no package was found defining this alias.", dependency.ItemSpec, targetPackageAlias);
165Log.LogMessage(LogImportance.Low, "Dependency {0} has no parent so will assume {1}.", dependency.ItemSpec, PackageId);
179Log.LogWarning("Dependency {0} has no version", dependency.ItemSpec);
184Log.LogError("Dependency {0} has invalid version {1}", dependency.ItemSpec, dependencyVersionString);
ValidatePackage.cs (12)
363AllSupportedFrameworks = _frameworks.Values.Where(fx => fx.SupportedVersion != null).Select(fx => fx.ToItem()).OrderBy(i => i.ItemSpec).ToArray();
383Log.LogError($"PackageIndex from {String.Join(", ", PackageIndexes.Select(i => i.ItemSpec))} is missing an entry for package {PackageId}. Please run /t:UpdatePackageIndex on this project to commit an update.");
400Log.LogError($"PackageIndex from {String.Join(", ", PackageIndexes.Select(i => i.ItemSpec))} is missing an assembly version entry for {fileVersion} for package {PackageId}. Please run /t:UpdatePackageIndex on this project to commit an update.");
407Log.LogError($"PackageIndex from {String.Join(", ", PackageIndexes.Select(i => i.ItemSpec))} indicates that assembly version {fileVersion} is contained in non-stable package version {packageVersion} which differs from this package version {thisPackageVersion}.");
417Log.LogError($"PackageIndex from {String.Join(", ", PackageIndexes.Select(i => i.ItemSpec))} is has an assembly version entry(s) for {String.Join(", ", orphanedAssemblyVersions)} which are no longer in package {PackageId}. Please run /t:UpdatePackageIndex on this project to commit an update.");
430Log.LogError($"PackageIndex from {String.Join(", ", PackageIndexes.Select(i => i.ItemSpec))} is missing an baseline entry(s) for native module {PackageId}. Please run /t:UpdatePackageIndex on this project to commit an update.");
441Log.LogError($"PackageIndex from {String.Join(", ", PackageIndexes.Select(i => i.ItemSpec))} is missing ModulesToPackages entry(s) for {String.Join(", ", missingModuleNames)} to package {PackageId}. Please add a an entry for the appropriate package.");
463fx = FrameworkUtilities.ParseNormalized(framework.ItemSpec);
467Log.LogError($"Could not parse Framework {framework.ItemSpec}. {ex}");
473Log.LogError($"Did not recognize {framework.ItemSpec} as valid Framework.");
500string fxString = supportedFramework.ItemSpec;
531Log.LogError($"Could not parse Version {version} on SupportedFramework item {supportedFramework.ItemSpec}. {ex}");
Microsoft.DotNet.Build.Tasks.Packaging.Tests (15)
Microsoft.DotNet.Build.Tasks.TargetFramework (3)
Microsoft.DotNet.Build.Tasks.VisualStudio (1)
Microsoft.DotNet.Build.Tasks.Workloads (9)
Microsoft.DotNet.Build.Tasks.Workloads.Tests (27)
CreateVisualStudioWorkloadTests.cs (20)
76ITaskItem manifestMsiItem = createWorkloadTask.Msis.Where(m => m.ItemSpec.ToLowerInvariant().Contains("d96ba8044ad35589f97716ecbf2732fb-x64.msi")).FirstOrDefault();
81Assert.Equal("{C4F269D9-6B65-36C5-9556-75B78EFE9EDA}", MsiUtils.GetProperty(manifestMsiItem.ItemSpec, MsiProperty.UpgradeCode));
84Assert.Equal("6.33.28", MsiUtils.GetProperty(manifestMsiItem.ItemSpec, MsiProperty.ProductVersion));
85Assert.Equal("Microsoft.NET.Workload.Emscripten,6.0.200,x64", MsiUtils.GetProviderKeyName(manifestMsiItem.ItemSpec));
89using SummaryInfo si = new(manifestMsiItem.ItemSpec, enableWrite: false);
97i => i.ItemSpec.Contains("microsoft.net.sdk.emscripten.5.6.swixproj")).ItemSpec), "component.swr"));
102i => i.ItemSpec.Contains("microsoft.net.sdk.emscripten.pre.5.6.swixproj")).ItemSpec), "component.swr"));
143ITaskItem pythonPackSwixItem = createWorkloadTask.SwixProjects.Where(s => s.ItemSpec.Contains(@"Microsoft.Emscripten.Python.6.0.4\x64")).FirstOrDefault();
144string packMsiSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(pythonPackSwixItem.ItemSpec), "msi.swr"));
153Assert.All(swixComponentProjects, c => Assert.True(c.ItemSpec.Contains(".pre.") && c.GetMetadata(Metadata.IsPreview) == "true" ||
154!c.ItemSpec.Contains(".pre.") && c.GetMetadata(Metadata.IsPreview) == "false"));
212ITaskItem manifestMsiItem = createWorkloadTask.Msis.Where(m => m.ItemSpec.ToLowerInvariant().Contains("d96ba8044ad35589f97716ecbf2732fb-arm64.msi")).FirstOrDefault();
217Assert.Equal("{CBA7CF4A-F3C9-3B75-8F1F-0D08AF7CD7BE}", MsiUtils.GetProperty(manifestMsiItem.ItemSpec, MsiProperty.UpgradeCode));
220Assert.Equal("6.33.28", MsiUtils.GetProperty(manifestMsiItem.ItemSpec, MsiProperty.ProductVersion));
221Assert.Equal("Microsoft.NET.Workload.Emscripten,6.0.200,arm64", MsiUtils.GetProviderKeyName(manifestMsiItem.ItemSpec));
225using SummaryInfo si = new(manifestMsiItem.ItemSpec, enableWrite: false);
232i => i.ItemSpec.Contains("microsoft.net.sdk.emscripten.5.6.swixproj")).ItemSpec), "component.swr"));
Microsoft.DotNet.Deployment.Tasks.Links (1)
Microsoft.DotNet.GenAPI (1)
Microsoft.DotNet.GenFacades (4)
Microsoft.DotNet.Helix.Sdk (13)
FindDotNetCliPackage.cs (9)
155"sdk" => $"{feed.ItemSpec}/Sdk/{version}/dotnet-sdk-{effectiveVersion}-{Runtime}.{extension}{sasToken}",
157$"{feed.ItemSpec}/aspnetcore/Runtime/{version}/aspnetcore-runtime-{effectiveVersion}-{Runtime}.{extension}{sasToken}",
158_ => $"{feed.ItemSpec}/Runtime/{version}/dotnet-runtime-{effectiveVersion}-{Runtime}.{extension}{sasToken}"
187"sdk" => await GetMatchingProductVersionTxtContents($"{feed.ItemSpec}/Sdk/{version}", "sdk-productVersion.txt", sasToken),
188"aspnetcore-runtime" => await GetMatchingProductVersionTxtContents($"{feed.ItemSpec}/aspnetcore/Runtime/{version}", "aspnetcore-productVersion.txt", sasToken),
189_ => await GetMatchingProductVersionTxtContents($"{feed.ItemSpec}/Runtime/{version}", "runtime-productVersion.txt", sasToken)
329"sdk" => $"{feed.ItemSpec}/Sdk/{Channel}/latest.version",
330"aspnetcore-runtime" => $"{feed.ItemSpec}/aspnetcore/Runtime/{Channel}/latest.version",
331_ => $"{feed.ItemSpec}/Runtime/{Channel}/latest.version"
Microsoft.DotNet.Helix.Sdk.Tests (2)
Microsoft.DotNet.PackageTesting (3)
Microsoft.DotNet.SharedFramework.Sdk (21)
Microsoft.DotNet.SignCheck (1)
Microsoft.DotNet.SignTool (10)
Microsoft.DotNet.SignTool.Tests (1)
Microsoft.DotNet.SourceBuild.Tasks (2)
Microsoft.DotNet.VersionTools.Tasks (16)
Microsoft.DotNet.XliffTasks (15)
Microsoft.Extensions.ApiDescription.Client (2)
Microsoft.Extensions.ApiDescription.Client.Tests (19)
Microsoft.NETCore.Platforms (2)
MSBuild (3)
MSBuildTaskHost (2)
PortableTask (1)
PresentationBuildTasks (38)
SemanticSearch.BuildTask (4)